Page 1 of 1
Objectives; make the Allies win when they touch a trigger?
Posted: Mon Jan 12, 2004 3:50 am
by Stevo
I'm having some trouble writing a script for an objective map I am making. The Axis defend; the Allies attack. There are no bombs or documents, though; I want the Allies to win by touching a trigger (I'm using a trigger multiple).
This can be done, right?
I could throw my script up here if it would help, but since I don't know what I'm doing I thought it would be best if perhaps someone could just write a quick trigger_multiple objective script for me. (A tested one, preferably).
The way my objective is basically set up is:
1)trigger starts thread
2)thread checks for Allies team
3)thread uses teamwin allies
Could someone throw together a working version for me?
Thanks for any consideration.
Posted: Mon Jan 12, 2004 4:04 am
by omniscient
put a trigger use around the objective. give it this key/value waitthread allies_win. in your script put
viola.
Posted: Mon Jan 12, 2004 8:13 am
by jv_map
Should be:
Code: Select all
allies_win:
if(parm.other.dmteam == allies)
teamwin allies
end
Thanks
Posted: Mon Jan 12, 2004 5:51 pm
by Stevo
Alright, Thanks so far.
Here's what I've come up with.
Code: Select all
heist:
if ( (local.player.dmteam != "allies") || (level.heist == 1) )
end
iprintlnbold "The Allies have taken the train!"
level.heist = 1
teamwin allies
end
Would this work?
Also, what I want to know now is if there is any other code I need to put in to set up an objective map with only that one objective. More specifically, do I need to set up any kind of code along the lines of level.targets_to_destroy = 1 or anything else? Can I just leave it out of the script?
In short:
What exactly is the entire code needed for the allies touch-to-win and axis clockside?
(Preferably using the DM/OBJ technique found in breakthrough maps: if (level.gametype == 4) etc).
Thanks
Posted: Mon Jan 12, 2004 8:55 pm
by nuggets
that's really all you need
just add
level waittill spawn
level.clockside = axis
level.dmrespawning = 1
level.dmroundlimit = 10
Problem solved
Posted: Tue Jan 13, 2004 1:35 am
by Stevo
Okay, awesome. Here are my results.
It turns out that the problem was just the placement of the dmclockside stuff, so the touch trigger was working fine all along.
Except that, for
Code: Select all
heist:
if ( (local.player.dmteam != "allies") || (level.heist == 1) )
end
iprintlnbold "The Allies have taken the train!"
level.heist = 1
wait 2.0
teamwin allies
end
I needed "local.player = parm.other" before everything else:
Code: Select all
heist:
local.player = parm.other
if ( (local.player.dmteam != "allies") || (level.heist == 1) )
end
iprintlnbold "The Allies have taken the train!"
level.heist = 1
wait 2.0
teamwin allies
end
for it to work properly.
Thanks for the help.