Page 1 of 1

restarting script

Posted: October 26th, 2009, 10:14 pm
by Rukariox
Hi,
just a small question
i want to let a script restart if its not done in 20 seconds.
so what function do i need to use?

Re: restarting script

Posted: October 26th, 2009, 11:11 pm
by waywaaaard
o.O so you have already a script that will be thread and works?

with notify and endon it could be possible but not sure

Re: restarting script

Posted: October 27th, 2009, 9:41 am
by Drofder2004

Code: Select all

mainFunction()
{
   level endon ("restart_function");
   thread count (20);

   //Do stuff here

   level notify ("restart_function");
}

count(time)
{
   level endon ("restart_function");
   wait time;
   level notify ("restart_function");
}

loopFunctions()
{
   while(1)
   {
      thread mainFunction();
      level waittill ("restart_function");
   }
}
Simply thread "loopFunctions()" to start it working.

Re: restarting script

Posted: October 27th, 2009, 5:47 pm
by Rukariox
can you make a small script with it because i don't understand it.
im not really good in scripting :oops:

Re: restarting script

Posted: October 27th, 2009, 8:02 pm
by Drofder2004
Well, I can't think of a good reason to use the script personally, so maybe its best you just simply say what you are trying to do exactly.

Re: restarting script

Posted: October 28th, 2009, 5:28 pm
by Rukariox
i want to create a shooting game but if you don't finish you will have to start over.

Re: restarting script

Posted: October 28th, 2009, 9:35 pm
by Drofder2004
Do you mean, like a shooting gallery/target practice?
Have you scripted this shooting game yet?

My advice would be to do the following, in this order:
- Create Map detail (ignore any scripted objects)
- Plan (and write down) exactly how you want the game to work (i.e moving objects, etc)
- Create each object in the map (scripted objects).
- Create a working code for the objects (without a timer)
- Implement a reset timer