Objectives; make the Allies win when they touch a trigger?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Objectives; make the Allies win when they touch a trigger?

Post 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.
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

put a trigger use around the objective. give it this key/value waitthread allies_win. in your script put

Code: Select all

allies_win {
teamwin_allies
}
viola.
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Code: Select all

allies_win {
teamwin_allies
}
Should be:

Code: Select all

allies_win:
  if(parm.other.dmteam == allies)
    teamwin allies
end
Image
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Thanks

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

that's really all you need
just add

level waittill spawn

level.clockside = axis
level.dmrespawning = 1
level.dmroundlimit = 10
hope this helps, prob not cos it's all foreign 2 me :-/
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Problem solved

Post 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.
Post Reply