| 10-01-2003, 03:04 AM | #1 |
Got a couple questions dealing with the same trigger and I am new at this, so be patient with me. 1) I am attempting to create an AoS map that allows for players to respawn destroyed buildings. I say respawn instead of rebuild because the regions that the triggers are dependent on are not visible in game and it would be frustrating to guess at. I was able to accomplish the "respawn" with the create unit function, but the spawn cycle was still broken. I think the problem is that the trigger is slaved to a unit on the map and not a unit-type. So when Goldmine 0114 is destroyed and Goldmine 0115 is respawned the the gold mine is still dead to the trigger. Is there a way I can set the variable the attached condition to a unit - type rather than a specific unit. 2) The ideal result here is to have a peasant stand on a circle of power for a specific amount of time and not just step on the circle and have the buildings pop up. How can I create a condition for this. |
| 10-01-2003, 03:33 AM | #2 |
I think this would work. Make a Unit variable, and at map Init store the unit in the variable, then when you respawn the unit, in the respawn trigger (at the end of it) do a "Set variable "***" to last created unit" where *** is the variable you use.. EDIT: Let me clarify. Code:
Event: Unit Dies Condition: Unit is "[color=red]***[/color]" Action: Create unit (@@@) at region Set Varaible "[color=red]***[/color]" to last created unit I hope you understand what I mean... As for your second problem: 3 triggers: Code:
Trig1 Event: Unit enters region (CoP) Condition: Unit type = Peasent Action: Set variable "EnteredUnit" to unit (entering unit) Create timer named respawn with 60 second countdown Turn off trigger (this trigger) [color=green]this is to prevent the variable from being reset if another peasent enters the CoP[/color] Trig2 Event: Unit leaves region (CoP) Condition: Unit is equal to "EnteredUnit" Action: Destroy timer "Respawn" Turn on trigger (trig1) Trig3 Event: Timer Expired Condition: Timer equal to "respawn" Action: Create units(blah) at region (blahblah) Turn on trigger (trig1) ALSO NOTE: I AM IN NO WAY A TRIGGER EXPERT, SO ONE OR MORE OF THOSE TRIGGERS MAY BE A LITTLE OFF, but you should get the idea. |
| 10-02-2003, 08:32 AM | #3 |
Your solution to the second problem is right on the money for me. Your first option didn't work on its own, but it taught me how to make it work... if that makes sense ;). The Set Variable action is one of my favs now. |
