Would this work?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Would this work?

Post by Alcoholic »

lets said i had a variable "level.continue = 0" after 20 seconds, it becomes "level.continue = 1". if i had a trigger that calls a thread in a script, would this line work?

self waittill level.continue == 1

???
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

main:
waittill spawn
level.your_count = 0 // this line probably not needed unless it's doing something else while false (0)
wait 20
level.your_count = 1
end
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

better

Post by tltrude »

try this:

self waittill (level.continue == 1)

You need to explain better what you are trying to do.
Tom Trude,

Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

i want to pass thru a trigger. the trigger sets a thread named "blah". when teh trigger is set, it WAITS until a variable is changed to 1 before executing. the variable is changed to 1 when the captain is at a specific trigger. i want to do this so that you cant just run ahead of your captain and screw up all the scripted events.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

trigger

Post by tltrude »

Why not just turn the trigger off untill the captain gets there?

$mytrigger nottriggerable
$mytrigger triggerable

Also, how does your script know the captain is at the right spot? AI can't trip triggers, but you can set an origin as his destination. I'm probably not the right guy to ask about this stuff. Which singleplayer script are you using as a guide?
Tom Trude,

Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

if (level.captain istouching $trigger)
{
iprintln captain is at trigger
end
}
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

im not using a ref script, i just got this idea because alot of people rush thru a map and mess up all the scripted sequences.
i got the istouching thing from m1l1
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The easiest way is the following:

Code: Select all

while(level.continue != 1)
  waitframe
Done 8)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

continue

Post by tltrude »

Use what jv_map has and put the self stuff below it. You can add this to your captain thread:

if (level.captain istouching $trigger)
{
iprintln "captain is at trigger"
level.continue = 1
end
}

That is not a very original targetname for a trigger, ha ha. In most scripts they call the captain "level.friendly1", I think.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I go along with JV , simple does the trick just what you need .
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Re: continue

Post by Alcoholic »

tltrude wrote:Use what jv_map has and put the self stuff below it. You can add this to your captain thread:

if (level.captain istouching $trigger)
{
iprintln "captain is at trigger"
level.continue = 1
end
}

That is not a very original targetname for a trigger, ha ha. In most scripts they call the captain "level.friendly1", I think.
in your script, you can give them an alias. i typed:

level.captain = level.friendly1

its easier for me because later i wont remember which friendly is which.
Post Reply