restarting script

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Rukariox
CJ Wannabe
CJ Wannabe
Posts: 34
Joined: July 30th, 2009, 7:30 pm

restarting script

Post by Rukariox » October 26th, 2009, 10:14 pm

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?

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: restarting script

Post by waywaaaard » October 26th, 2009, 11:11 pm

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
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: restarting script

Post by Drofder2004 » October 27th, 2009, 9:41 am

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Rukariox
CJ Wannabe
CJ Wannabe
Posts: 34
Joined: July 30th, 2009, 7:30 pm

Re: restarting script

Post by Rukariox » October 27th, 2009, 5:47 pm

can you make a small script with it because i don't understand it.
im not really good in scripting :oops:
Last edited by Rukariox on October 28th, 2009, 10:09 pm, edited 1 time in total.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: restarting script

Post by Drofder2004 » October 27th, 2009, 8:02 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Rukariox
CJ Wannabe
CJ Wannabe
Posts: 34
Joined: July 30th, 2009, 7:30 pm

Re: restarting script

Post by Rukariox » October 28th, 2009, 5:28 pm

i want to create a shooting game but if you don't finish you will have to start over.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: restarting script

Post by Drofder2004 » October 28th, 2009, 9:35 pm

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
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests