• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

trigger help

Status
Not open for further replies.
Level 5
Joined
Mar 21, 2007
Messages
155
hi, i'm making a map with many small+big bases which can be taken over by opposing players by thier special leaders. each base has 2 unit trainers, 1 tec centre (just a town hall but renamed), 1 big building saying the name of the base, and a special unit trainer.
i have mad a trigger so that when the opposing leader walks into the region, the 2 unit trainers are REPLACED by diffrent ones, the tec centre canges owner, the building changes owner and the special unit trainer changes owner
this is the trigger, i cna test it once but i can't test it again and again to make sure that it will work, do you think it will work??


  • takeover ozai
    • Events
      • Unit - A unit enters hostile takeover ozai <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Fire Lord
          • (Unit-type of (Triggering unit)) Equal to King of Ba Sing Se
          • (Unit-type of (Triggering unit)) Equal to King of Omashu
          • (Unit-type of (Triggering unit)) Equal to Monk Geyatzu
          • (Unit-type of (Triggering unit)) Equal to Water Chief
      • (Owner of (Triggering unit)) Not equal to (Owner of Fire Nation 0045 <gen>)
    • Actions
      • Set takingover = (Owner of (Triggering unit))
      • Game - Display to (All players) the text: The Fire Nation has...
      • Unit - Change ownership of Ozai 0040 <gen> to takingover and Change color
      • Unit - Change ownership of Tech 1 0039 <gen> to takingover and Change color
      • Unit - Change ownership of Fire Nation Unit Trainer 0036 <gen> to takingover and Change color
      • Unit - Change ownership of Fire Nation Unit Trainer 0041 <gen> to takingover and Change color
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Water Chief
        • Then - Actions
          • Unit - Replace Fire Nation Unit Trainer 0041 <gen> with a Water Tribe Unit Trainer using The new unit's max life and mana
          • Unit - Replace Fire Nation Unit Trainer 0036 <gen> with a Water Tribe Unit Trainer using The new unit's max life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to King of Ba Sing Se
        • Then - Actions
          • Unit - Replace Fire Nation Unit Trainer 0041 <gen> with a Earth Kingdom Unit Trainer using The new unit's max life and mana
          • Unit - Replace Fire Nation Unit Trainer 0036 <gen> with a Earth Kingdom Unit Trainer using The new unit's max life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to King of Omashu
        • Then - Actions
          • Unit - Replace Fire Nation Unit Trainer 0041 <gen> with a Earth Kingdom Unit Trainer using The new unit's max life and mana
          • Unit - Replace Fire Nation Unit Trainer 0036 <gen> with a Earth Kingdom Unit Trainer using The new unit's max life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Monk Geyatzu
        • Then - Actions
          • Unit - Replace Fire Nation Unit Trainer 0041 <gen> with a Air Nomad Unit Trainer using The new unit's max life and mana
          • Unit - Replace Fire Nation Unit Trainer 0036 <gen> with a Air Nomad Unit Trainer using The new unit's max life and mana
        • Else - Actions
      • Unit - Change ownership of Hostile Takeover (medium) 0021 <gen> to takingover and Change color
      • Unit - Change ownership of Re-Crown (medium) 0022 <gen> to takingover and Change color
      • Unit - Change ownership of Fire Nation 0045 <gen> to takingover and Change color
      • Unit - Change ownership of Gate Commander 0111 <gen> to takingover and Change color


with ozai being the name of the base.

p.s sorry for making it so complicated but i have tried to describe it as much as possible :smile:
 
Last edited by a moderator:
Level 6
Joined
Feb 2, 2005
Messages
205
hmm i think it wont work if you take over that stuff with water, and later on fire takes it back, since the created static Structure Variables are gone. You Should Use an Unit-Type Array instead. Here is an example on how to implement.

Map Ini Trigger
  • Events
    • Map Ini
  • Actions
    • set Building[1] = Fire Nation Unit Trainer 0036
    • set Building[2] = Fire Nation Unit Trainer 0041
In your Trigger (only the Ifs Change since those are the only Units replaced)
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Triggering unit)) Equal to Water Chief
      • Then - Actions
        • Unit - Replace Building[2] with a Water Tribe Unit Trainer using The new unit's max life and mana
        • set Building[2] = Last replaced Unit
        • Unit - Replace Building[1] with a Water Tribe Unit Trainer using The new unit's max life and mana
        • set Building[1] = Last replaced Unit
      • Else - Actions
 
Level 5
Joined
Mar 21, 2007
Messages
155
ahhhhhhhhhhhhhhhhhhhhhhhhhhh i see what u mean, tyvm, it will take a while, and a lot more work when i finally thought i had done that part (since it took me ages to do this for all the bases)

but then again, nothing beats a map that took ages to make ty =D
 
Status
Not open for further replies.
Top