flag raising

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
brendank310
Corporal
Posts: 27
Joined: Mon Apr 07, 2003 11:02 am
Contact:

flag raising

Post by brendank310 »

ive made a map, where a flag will be raised by allies to complete the objective. i made a brush for the flag, which acts as an elevator. i want the allies to win the obj match when the flag is raised. im not to sure on the syntax of scripting, but it would be like wait until $flag is at $flagup. could someone tell me how i would actually write this. or tell me how an obj match could be ended just by a trigger being "used" ? any help will be much appreciated.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I think a trigger_multiple with the monsters flag set will work . In the stuka gag script for spearhead the plane is a script model and when it hits a trigger it drops a bomb or starts a strifeing run . I think a script object might do the same I don't know . You could put a trigger at the top of the flag pole and if the flag reaches it , it will trigger the win .
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

u can try:

main:

level waittill prespawn

level waittill spawn

thread axis_win_clock

$flag_trigger waitthread flag_raise // leave at the end of main
thread allies_win_flag
end

flag_raise:

while(1)
{
self waittill trigger
local.triggerer = parm.other
if(local.triggerer.dmteam == "allies")
break
wait 0.1
}

end

allies_win_flag:

$flag moveup 128 // height of flag
teamwin allies

end

axis_win_clock:

level waittill axiswin

end
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

correction

Post by tltrude »

You left out the command that makes it move:

//---------------------------
allies_win_flag:

$flag moveup 128 // height of flag pole
$flag waitmove

teamwin allies

end
//---------------------------

Also, shouldn't the line "thread allies_win_flag" be inside the while brackets? The way you have it now, the game will end right after spawn.

//---------------------------
flag_raise:

while(1)
{
self waittill trigger
local.triggerer = parm.other
if(local.triggerer.dmteam == "allies")
{
thread allies_win_flag

break
}
wait 0.1
}

//---------------------------
Tom Trude,

Image
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 »

and u both missed TIME!!!

some people really go over the top when scripting

create trigger->use
key: targetname
value: flag_trigger
key: setthread
value: flag_move

main:
end

flag_move:
if ( parm.other.dmteam == allies )
{
$flag_trigger
$flag time 5 // the time it takes to get there
$flag moveUp 128 // the extra height it will move
$flag waitmove
teamwin allies
}
end
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

thanks for the corrections, i did that this morning at 6:30 am on the way to school
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 »

lol, np's

we'll just have 2 wait and c if any of them work :P
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Don't forget to use a script object (is this mentioned already?) or it will not work.
Live to map, not map to live.
-mohaa_rox, .map
moderator
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 »

and with the flag

script->object

key: targetname
value: flag

that also seems to of been missed out somehow... even though i'm sure i typed that :oops:
hope this helps, prob not cos it's all foreign 2 me :-/
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

And do you need to use 'hide'/'show' so that the flag pops in when triggered???? and goes away if the other team captures that point.??
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

u can use it to move up or down.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Post Reply