• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] CTF PLayer drops flag

Status
Not open for further replies.
Level 4
Joined
Jun 30, 2005
Messages
44
I'm working on a capture the flag based game, and I've come across this problem. I've made it so a unit can capture the flag, but I need to know how to make it if that unit is killed with the flag, the flag will return to its base.

Red Flag
Events
Unit - A unit enters Red Flag <gen>
Conditions
Or - Any (Conditions) are true
Conditions
((Owner of (Triggering unit)) controller) Equal to (Player 8 (Pink) controller)
((Owner of (Triggering unit)) controller) Equal to (Player 9 (Gray) controller)
((Owner of (Triggering unit)) controller) Equal to (Player 10 (Light Blue) controller)
((Owner of (Triggering unit)) controller) Equal to (Player 11 (Dark Green) controller)
((Owner of (Triggering unit)) controller) Equal to (Player 12 (Brown) controller)
Actions
Unit - Hide Red Flag 0001 <gen>
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Doodads\LordaeronSummer\Props\BannerOrc\BannerOrc0.mdl
Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has stolen the |cffff0000Red|r flag!)

Thats what I have for when the unit captures the flag, but now I need to figure out how to make the flag go back to the base, (ie the guy with the special effect on him dies, and the flag unit unhides)

I have it so when the unit enters the region with the flag in it, the actual flag itself becomes hidden, and a dummy flag is created on top of the unit.
 
Level 7
Joined
Oct 24, 2006
Messages
110
Here.. A trigger for returning flag when unit dies. I'm not sure about the exact trigger names but atleast you'll be able to find it..

  • Return Flag upon Death
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Triggering Unit) has Red Flag 0001 <gen>) Equal To True
  • Actions
    • Set TEMP_point = (Center of Red Team Base <gen>)
    • Item - Move Red Flag 0001 <gen> to TEMP_point
    • Custom Script: call RemoveLocation(udg_TEMP_point)
 
Status
Not open for further replies.
Top