Page 1 of 1

sequence scripting help

PostPosted: Sat Feb 27, 2010 1:01 am
by Rideg
Code: Select all
(e)=>{
    (sim.time - e.geom.controllerAcc) >= scene.my.simtime ? { scene.my.whatever = 1};         e.geom.controllerAcc = sim.time     } : {} }


Well I want to update the variable every {scene.my.simtime} and do it 10 times then have a break concept so this would repeat after 60 seconds.

Any Ideas?? :?:

Re: sequence scripting help

PostPosted: Sun Feb 28, 2010 11:13 pm
by Rideg
is this even possible? I just need an answer.

Re: sequence scripting help

PostPosted: Sun Feb 28, 2010 11:55 pm
by KarateBrot
Code: Select all
sim.time % scene.my.simtime == 0 ? { for(10, (i)=>{ scene.my.whatever = 1 }) } : {  }

Theoretically it's possible like above but sometimes it doesn't detect if sim.time % scene.my.simtime is true. Maybe that's because the laser updates at another frequency than sim.time changes. (laser 60 times per second and sim.time 100 times per second)

Code: Select all
sim.time % scene.my.simtime <= 0.01 ? { for(10, (i)=>{ scene.my.whatever = 1 }) } : {  }

is a bit better but it's not perfect, too.

But Kilinich once made some functions for events and triggers and stuff.
Rating: rated 6.7
Filesize: 1.94 kB
Comments: 7
Ratings: 5
download




x % y is the "modulo" btw. if you don't know. It's the remainder of the division x / y