1. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  2. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  3. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  4. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  5. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  6. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How Do You Create A Trigger That Turns Over Control After A Building Is Taken

Discussion in 'World Editor Help Zone' started by AngryRedMidget, Nov 28, 2009.

  1. AngryRedMidget

    AngryRedMidget

    Joined:
    Nov 28, 2009
    Messages:
    28
    Resources:
    0
    Resources:
    0
    I need a hand wth the trigger that would allow me to do this. Ive checked the Tutorials but i could not find one that was relavent to this. What i mean by it is that after the building has gotten to under 1000 health it will become the attackers WITH full health. Ive figured out how to do individual buildings but I do not want to have to do this for every building.
     
  2. Absent

    Absent

    Joined:
    Oct 5, 2009
    Messages:
    77
    Resources:
    0
    Resources:
    0
    Well... let me think.
    If the buildings are owned by a single player (Player 12, say) and Player 12 will never have any other units, then;
    EVENTS
    A unit owned by Player 12 is attacked
    CONDITIONS
    Life of attacked unit is less than 1000
    ACTIONS
    Set life of attacked unit to max health of attacked unit
    Set ownership of attacked unit to owner of attacking unit

    If you want players to be able to capture other player's buildings, then;

    EVENTS
    A unit is attacked
    CONDITIONS
    Life of attacked unit is less than 1000
    Any of the following conditions are true:
    Type of attacked unit equal to BuildingA
    Type of attacked unit equal to BuildingB
    etc.
    ACTIONS
    Set life of attacked unit to max life of attacked unit
    Set ownership of attacked unit to owner of attacking unit

    I'm pretty sure that will work. I don't have World Editor available right now, so I don't know if those are the exact Events/Conditions/Actions. But anyway, good luck.
     
    Last edited: Nov 30, 2009
  3. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    659
    Resources:
    7
    Maps:
    5
    Spells:
    2
    Resources:
    7
    As simple as
    • Events
      • Unit - A unit is attacked
    • Conditions
      • Unit Type of (Triggering Unit) = <Your Building>
      • Life of (Attacked Unit) Less than or equal to 1000.00
    • Actions
      • Unit - Change Ownership of (Triggering Unit) to (Owner of (Attacking Unit))
      • Unit - Set life of (Triggering Unit) to (Max Life of (Triggering Unit))
     
  4. AngryRedMidget

    AngryRedMidget

    Joined:
    Nov 28, 2009
    Messages:
    28
    Resources:
    0
    Resources:
    0
    wow now i feel retarded. thanks a bunch for the help.