Help - Delete Timer

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

Help - Delete Timer

Postby EMKshadow » Wed Nov 24, 2010 4:33 pm

I know this has been asked many times and theres multiple topics on how to have things deleted after a certain amount of time but...Im trying to make a bomb/cannon thing that is a bunch of circles on one point that, when the fixations are deleted, starts a timer to delete the circles 20 seconds later. The timer needs to initialize once the fixations are broken. Ive looked into the other topics of it but i still dont get it. Help would be appreciated :thumbup:
User avatar
EMKshadow
 
Posts: 29
Joined: Tue Aug 10, 2010 1:47 am

Re: Help - Delete Timer

Postby davidz40 » Mon Dec 06, 2010 7:38 pm

In Phun or Algodoo?
In algodoo You can make circles very slightly opaque, and put small invisible laserpens on them. Then change their onlaserhit to something like (e)=>{controlleracc=controlleracc+1; controllerAcc>200 ? {density=0}:{} }.
Phundamentalist
User avatar
davidz40
 
Posts: 438
Joined: Sun Sep 06, 2009 10:30 am

Re: Help - Delete Timer

Postby EMKshadow » Sat Dec 11, 2010 3:26 pm

Yeah I'm using algodoo. I need of a way to have each "timer" (laser) to start for that particular shell only when I press fire and do the same for the next shell when its in the firing chamber. Is there anyway thats possible or does anyone have any ideas?
User avatar
EMKshadow
 
Posts: 29
Joined: Tue Aug 10, 2010 1:47 am

Re: Help - Delete Timer

Postby ducky21 » Sat Dec 11, 2010 5:20 pm

I am just guessing, but if you had a laser from the barrel of the gun, spawning a timer laser on the place where the cartridge is, then it could work. I have no clue what that scripting is.
User avatar
ducky21
 
Posts: 301
Joined: Tue Aug 03, 2010 8:58 pm

Re: Help - Delete Timer

Postby EMKshadow » Sun Dec 12, 2010 4:03 am

i don't think so because i have about 128-256 circles on each shell and i'm not sure if the laser would hit all of them or just one. Plus if it did spawn a laser for each circle, would it attach the laser to the circle it's supposed to attach to or all attach to a random circle. Boggles my mind :o
User avatar
EMKshadow
 
Posts: 29
Joined: Tue Aug 10, 2010 1:47 am

Re: Help - Delete Timer

Postby davidz40 » Sun Dec 12, 2010 10:10 pm

I meant one laser for each circle spawned. Spawning a laser attaches it to whatever was spawned immediately before, there shouldn't be any problems.
Just make
(e)=>{scene.addcircle({pos:=e.pos; radius:=1; color:=[1,1,1,0.99]; onlaserhit=(e)=>{controllerAcc=controllerAcc-0.1; controllerAcc<0 ? {density=0}:{};}}); scene.addlaserpen({pos=e.pos+[0.1,0.1];fadedist:=1;});}
Phundamentalist
User avatar
davidz40
 
Posts: 438
Joined: Sun Sep 06, 2009 10:30 am

Re: Help - Delete Timer

Postby EMKshadow » Mon Dec 13, 2010 2:44 am

Since I didnt completely understand what you tried to explain i'll assume you think i'm making something that spawns a bunch of circles on impacts so i'll give you more details and whatever.

Anyways, the circles aren't spawned. If they were, this project would've been done weeks ago. Each shell consists of a box that collides with b and i make a circle with a fixate to it and just clone the circle over and over again until i feel i have enough(they collide with a). When i press enter, a laser that collides with b destroys the box and the circles essentially explode(i have them explode in barrel so its like a flak cannon) And ill make a reload system to load the next shell. Hope i assume right!


PS the code is either faulty or im not implementing it right
User avatar
EMKshadow
 
Posts: 29
Joined: Tue Aug 10, 2010 1:47 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests