• 🏆 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] 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