• 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] Improve trigger

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
Improve triggers

I need help to change 2 trigger, below you see what i got at the moment but it needs to be changed. The first triggers problem is that you might be upgrading a tech or upgrading a house, and if the unit is the replaced which is making the upgrade you lose the progress but get your money back.
So do anyone have any ides to make this work better?

  • Asorian kingdom low food
    • Events
      • Player - Player 1 (Red)'s Food cap becomes Equal to 0.00
    • Conditions
    • Actions
      • Player - Make Peasant (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Elite Corps (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Archer (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Siege Engineer (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Footman (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Knight (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Apprentice Mage (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make High Priest (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Player - Make Asorian Royal Guard (KINGDOM) Unavailable for training/construction by Player 1 (Red)
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Keep (KINGDOM)) and do (Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's relative life and mana)
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Castle (KINGDOM)) and do (Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's relative life and mana)
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Barracks (KINGDOM)) and do (Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's relative life and mana)
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Arcane Sanctum (KINGDOM)) and do (Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's relative life and mana)
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Fort (KINGDOM)) and do (Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's relative life and mana)
Second triggers problem is that once a unit comes within range it dosen't matter what player it belongs to, so the regional capitol might be some other players but the player that owns the unit that is withing range still get the gold/wood/food. But can you put more values on the variable so it both gotta be a certain unit and owned by a certain player?

  • Gold
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set regional_capitol[0] = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to (==) Region capitol))
      • Unit Group - Pick every unit in regional_capitol[0] and do (Actions)
        • Loop - Actions
          • Set gold[0] = (Units within 100.00 of (Position of (Picked unit)) matching ((Unit-type of (Matching unit)) Equal to (==) Gold Horse))
          • Unit Group - Pick every unit in gold[0] and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
              • Unit Group - Remove all units of gold[0] from gold[0]
              • Custom script: call DestroyGroup (udg_gold[0])
              • Player - Add 20 to (Owner of (Picked unit)) Current gold
          • Unit Group - Remove all units of regional_capitol[0] from regional_capitol[0]
          • Custom script: call DestroyGroup (udg_regional_capitol[0])
 
Level 2
Joined
Apr 28, 2009
Messages
22
The 1st trigger, sounds almost as if it's just for a custom tech tree? You can do all of that with the object editor? I don't follow if you mean something else.

The second trigger, just add an If/Then/Else, and add the condition (picked unit) is owned by (Player 1 Red) or whatever.
 
Status
Not open for further replies.
Top