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

Upgrading a building

Status
Not open for further replies.
Level 3
Joined
Jul 25, 2007
Messages
37
Hopefully the answers to my last question solve that problem. Thanks to everybody who replied!

Second question: I have a custom building that sells items; it also has the "Return Gold and Lumber" ability. This upgrades to a different custom building, focused on unit production; it's not supposed to have items or "Return". I used Techtree -- Upgrades To in the Unit Editor.

When I place either Custom #1 or Custom #2 on the map directly, they work just as intended. When I upgrade Custom #1 to Custom #2, fail ensues. For lo and behold, it retains the items and "Return" ability...and shoves off a few of Custom #2's trained units to fit them into its menu.

What am I doing wrong? Is there an upgrade ability that I need to include too?
 
Level 3
Joined
Feb 23, 2010
Messages
73
do this:
  • Events
    • Unit - A unit finishes construction
  • Conditions
    • Unit Type - Unit-Type of (Constructed Structure) is Equal to Custom unit 2
  • Actions
    • Unit - Remove (Constructed Structure) from the game
    • Unit - Create 1 (Unit-Type of (Constructed Structure)) at (Position of (Constructed Structure)) for (Owner of (Constructed Structure)) Facing Default Building Degrees
 
Level 3
Joined
Jul 25, 2007
Messages
37
I'll keep it in mind, but I'd really prefer using triggers as a last resort. I'm not very experienced with them, and they tend to make my maps lag. Incidentally, I tried using a tweaked version of "Berserker Upgrade"...that didn't help either.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Triggers may cause lag due to leaks,remember to remove the point leak here if you're going to use triggers

  • Upgrading a building
    • Events
      • Unit - A unit finishes construction
    • Conditions
      • Unit Type - Unit-Type of (Constructed Structure) is Equal to Custom unit 2
    • Actions
      • Unit - Remove (Constructed Structure) from the game
      • Set TempPoint = (Position of (Constructed structure))
      • Unit - Create 1 (Unit-Type of (Constructed Structure)) at (TempPoint) for (Owner of (Constructed Structure)) (Facing of (Constructed structure)) degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
 
Status
Not open for further replies.
Top