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:
::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.
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
-
Events
-
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
-
Events
::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)
-
Loop - Actions
- Custom script: call DestroyGroup( udg_tempGroup )
-
Events
Last edited: