• 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] Force building

Status
Not open for further replies.
Level 19
Joined
Sep 4, 2007
Messages
2,826
These building(Town and City) contains items and I would like to know how I can force the replacing building to stay at the same spot regardless whatever units stand in the way.
How can I do it?
  • Villages
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |Cffffff00Town
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Replace (Triggering unit) with a |Cffffff00Town using The old unit's relative life and mana
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to |Cff00ff00City
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Replace (Triggering unit) with a |Cff00ff00City using The old unit's relative life and mana
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
 
Level 4
Joined
Dec 16, 2007
Messages
134
Try This :

  • Untitled Trigger 012
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lumber Mill
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Blacksmith using The old unit's relative life and mana
        • Else - Actions
          • Do nothing
  • Untitled Trigger 013
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Blacksmith
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Workshop using The old unit's relative life and mana
        • Else - Actions
          • Do nothing
Just change the unit.
 
Level 5
Joined
May 21, 2006
Messages
174
There's no Triggering Unit, change Triggering Unit to Researching Unit, works fine.
  • Barrack
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Researching unit)) Equal to |Cffffff00Barracks
        • Then - Actions
          • Set TempPoint = (Position of (Researching unit))
          • Unit - Replace (Researching unit) with a (Unit-type of (Researching unit)) using The old unit's relative life and mana
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
 
Status
Not open for further replies.
Top