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.
Objectives; make the Allies win when they touch a trigger?
Moderator: Moderators
-
omniscient
- Major General
- Posts: 694
- Joined: Tue Sep 16, 2003 12:02 am
put a trigger use around the objective. give it this key/value waitthread allies_win. in your script put
viola.
Code: Select all
allies_win {
teamwin_allies
}

Code: Select all
allies_win {
teamwin_allies
}
Code: Select all
allies_win:
if(parm.other.dmteam == allies)
teamwin allies
end
Thanks
Alright, Thanks so far.
Here's what I've come up with.
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
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
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
Problem solved
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
I needed "local.player = parm.other" before everything else:
for it to work properly.
Thanks for the help.
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
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
Thanks for the help.
