[Tutorial]Complex Object Spawning

About advanced scenes, and the Thyme scripting language used in Algodoo.

[Tutorial]Complex Object Spawning

Postby fox11trot » Sat Jan 09, 2010 10:49 pm

So let’s say you have an object in your scene that you want to spawn or you have a huge scene that slows down your computer and you want to spawn the scene in parts to keep down the lag. First, you select all of the objects that you want spawned and press ctrl – c on your keyboard. Then, go into Microsoft Word or another word processing program that supports the “Replace” function. Press ctrl – v and the coding for all the objects will paste into Word. Then, go into the Replace window after you have removed the part in the coding that has “phunlet created by” and and file info. Follow these steps in the Replace window:

1. Replace “angle = -“ with “angle = (-1) * “

2. Replace “rotation = -“ with “angle = (-1) * “

3. Replace “ = “ with “ := “
(make sure you have the space before and after the “=” sign so that you don’t replace == with :=:= or => with :=> etc.)

4. Make sure wildcards are ON and the replace “(e.this.*):(=)” , “(e.other.*):(=)” , “(e.geom.*):(=)” , and “(e.laser.*):(=)” with “\1\2”

(this is to ensure that all oncollide/onlaserhit/onhitbylaser scripts are functioning)
5. Turn wildcards OFF and replace paragraph marks with spaces

After all this press ctrl – a and ctrl – c and go into phun / algodoo. Use either oncollide or onlaserhit and make a spawner that runs the oncollide/onlaserhit script only once. Paste the code that you just copied in Word and you have an extremely complex object spawner!

I have tested this process a couple times if there is anything you want to add or it just doesn’t work for you, please comment.

i use this laser to spawn objects place the code: {"paste"}} at the end of the onlaserhit in the red laser
Rating: rated 5
Filesize: 11.15 kB
Comments: 5
Ratings: 1
download
fox11trot
 
Posts: 62
Joined: Tue Sep 01, 2009 7:25 am

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 8 guests

cron