• 🏆 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] unit upgrade trigger

Status
Not open for further replies.
Level 1
Joined
Dec 4, 2007
Messages
1
I am messing with a Tower Wars type of map, and I have a problem with the spawns (the buildings which summon units on the other players). When you upgrade the spawn, the units previously available stick, thus the newer units aren't able to be summoned. I've tried to fix this by destroying the tower once it has finished upgrading, and having it be replaced with the same building. This works for the first upgrade, but for the third tier the building just disappears.

This is the first upgrade, and works fine:
  • War Spawn
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to War Spawn
    • Actions
      • Unit - Replace (Triggering unit) with a War Spawn using The old unit's relative life and mana
This is the third tier upgrade, and only deletes the unit:
  • Dark Portal
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dark Portal
    • Actions
      • Unit - Replace (Triggering unit) with a Dark Portal using The old unit's relative life and mana
Is there maybe an easier way to solve this problem, or am I just missing something very obvious in the trigger?

::EDIT::

Alright, so I found out that if you make the units "trained" instead of "sold" they stick when upgrading. The only problem I have now is that the rally point icon covers up the icon to upgrade to the next tier...

::EDIT AGAIN::

Haha, fixed my problems. Thank god for google, I made a trigger that removes the ability "rally" every second. I don't think it has any leaks, but if someone sees something I don't please let me know. I'll leave all of this up because I want to know why the other triggers wouldn't work, and so people can see the solution to my problems. :)

  • Rally Points
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set tempGroup = (Units in (Entire map))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove Rally from (Picked unit)
      • Custom script: call DestroyGroup( udg_tempGroup )
 
Last edited:
Status
Not open for further replies.
Top