I am trying to make a map involving buildings which use the Pheonix Morphing ability to revive. I also want these buildings to be capable of upgrading to other buildings which share this power. However, while a building is in the process of upgrading, if it is killed it dies instead of becoming an egg.
I am searching for some sort of trigger or ability, using the GUI or JASS, which would allow a building to become an egg instead of dying permanently, or reviving as a building.
It is perfectly acceptable to instantly complete the building's construction time in the process of keeping it alive, as I am planning to minimize the construction time anyways. I merely wish to prevent the strange condition that an upgrading building, especially a building that was wounded prior to beginning the upgrade, would be capable of "surviving" death somehow.
If anyone needs clarification, just ask.|||use the object editor, I think I saw a "upgrade to" thing|||That's not the problem. I can make the tower upgrade.
The problem is, while the tower is upgrading, it does not have any abilities or skills, and if it is killed it will not revive. I am attempting to make the tower revive even if it is killed during an upgrade.|||Solution:
Trigger name: Immortal Buildings
Conditions: ((Triggering Unit) is Equal to (A structure))
Actions:
-Replace (Triggering Unit) with a unit of type (Type of (Triggering Unit)) with (the new unit's max life and mana)
-Set the life of (Last Replaced Unit) to 0
Looks like i figured it out myself. Thanks anyways for trying Natchoguy.
EDIT: This trigger will only work if there are absolutely no buildings in your map which ever need to die. Inventive uses of conditions may be necessary if some buildings need to be capable of death while others do not. Otherwise, this sends the game into an infinite loop and Warcraft forcequits itself in a stack overload error any time when a building lacking an active self-resurrecting power dies.|||You could always give all the buildings to which the trigger should be applied an invisible dummy ability and then test for the presence of that ability in the conditions.|||So just give all these buildings the ability "Revivable" which has absolutely no effects and then put that in as a test case?
Interesting. That certainly patches the infinite loop leak. Thanks Tiranasta!
No comments:
Post a Comment