I am working on a tower defense map where the creeps actually attack, so I want built towers to respawn at the start of every round. The best way I have figured out how to do this is to have 3 "towers" per type of tower. One is a "plan", that the builder builds. When the round starts, the "plan" is replaced with the real building. When the real building is destroyed, it is replaced by an invisible copy (hopefully with no footprint to prevent weird pathing issues, havent figured out how to do that yet). At the end of the round, the invisible copy is replaced by the plan again, so it will respawn for the next round.
I added a "Replace" action on a trigger, and while it lets me choose what X will be replaced with, I can find no way of specifying X as "All bunker plan towers", for example. Every option seems to rely on "triggering unit", of which there wont be any, since the trigger is the start of the round.
This would work, except for the fact that I cannot specify the original tower selection. I cant find any way of specifying "Select X tower" without player input.
There are function to force unit selection for player. Its added in retail (add campaign dependencies if you still cant find them). And picks unit matching condition would work. Triggereing unit should only be referred when unit dies ( to replace it) At the start of the round, just pick every "bunker invisible" and replace "picked unit" with bunker plan
- Pick every unit of a certain player and put them in a unit group
- Pick every unit from that group and hide it
- For every unit from that group you now create a new unit on it's position.
- When the round is over, you remove all units and un-hide the unit group.
Might work that way.
otherwise you could keep track of all units that die by saving their position and unit type in variables.
I don't know about the way you have it set up... but you might try this...
Make a behavior (or ability) that hides the unit, and repalces it's footprint with a pathable, but not buildable one.
Then your rebuild phase would simply remove this behavior from all units.
-Events: yourRebuildPhaseEvent
-Unit Group - For each unit "Unit" in (Any units in (Entire map) owned by player 1 matching Excluded: , with at most Any Amount) do (Actions)
-Actions:
-Unit - Remove 1 hideBuildingBehavior from "Unit"
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Gentlemen and/or ladies:
I am working on a tower defense map where the creeps actually attack, so I want built towers to respawn at the start of every round. The best way I have figured out how to do this is to have 3 "towers" per type of tower. One is a "plan", that the builder builds. When the round starts, the "plan" is replaced with the real building. When the real building is destroyed, it is replaced by an invisible copy (hopefully with no footprint to prevent weird pathing issues, havent figured out how to do that yet). At the end of the round, the invisible copy is replaced by the plan again, so it will respawn for the next round.
I added a "Replace" action on a trigger, and while it lets me choose what X will be replaced with, I can find no way of specifying X as "All bunker plan towers", for example. Every option seems to rely on "triggering unit", of which there wont be any, since the trigger is the start of the round.
Thanks in advance.
@CottcCid: Go
Pick all units Matching Condition, then use Picked Unit. I'm not quite sure if that will work, but it is worth a try.
@HandLMaps: Go
This would work, except for the fact that I cannot specify the original tower selection. I cant find any way of specifying "Select X tower" without player input.
@CottcCid: Go
There are function to force unit selection for player. Its added in retail (add campaign dependencies if you still cant find them). And picks unit matching condition would work. Triggereing unit should only be referred when unit dies ( to replace it) At the start of the round, just pick every "bunker invisible" and replace "picked unit" with bunker plan
So basically like Legion TD in Wc3?
I'd say...
- Pick every unit of a certain player and put them in a unit group
- Pick every unit from that group and hide it
- For every unit from that group you now create a new unit on it's position.
- When the round is over, you remove all units and un-hide the unit group.
Might work that way.
otherwise you could keep track of all units that die by saving their position and unit type in variables.
I don't know about the way you have it set up... but you might try this... Make a behavior (or ability) that hides the unit, and repalces it's footprint with a pathable, but not buildable one. Then your rebuild phase would simply remove this behavior from all units.
-Events: yourRebuildPhaseEvent
-Unit Group - For each unit "Unit" in (Any units in (Entire map) owned by player 1 matching Excluded: , with at most Any Amount) do (Actions)
-Actions:
-Unit - Remove 1 hideBuildingBehavior from "Unit"