- Joined
- Feb 22, 2009
- Messages
- 260
I seriously need some one to check my triggers. They seem to have some problem
1st Trigger
This is my attempt to create a building with unobstructed sight. I plan to create a flying dummy above the location of the building to provide the said sight. That trigger is fine for now. However, i can't remove/kill the dummy after the building is destroyed. It seems to me any unit with the Locust ability can not be selected by using unit within range.
[trigger=Dummy Create]Eye in the Sky
Events
Unit - A unit Finished construction
Conditions
(Unit-Type of (Constructed Structure)) Equal to Tower of Wisdom
Actions
Set Caster=(Constructed structure)
Set CasterPoint=(Position of Caster)
Unit - Create 1 Eye for (Owner of Caster) at CasterPoint facing Default building facing degrees
Custom script: set udg_Caster = null
Custom script: call RemoveLocation(udg_CasterPoint)[/trigger]
[TRIGGER=Dummy Destroy]Destroy
Events
A unit dies
Conditions
(Unit-type of (Dying unit)) Equal to Tower of Wisdom
Actions
Set Target = (Dying unit)
Set TargetPoint = (Position of Target)
Set UnitGroup = (Units within 300.00 of TargetPoint matching ((Unit-type of Matching unit) Equal to Eye)
Unit Group - Pick Every unit in UnitGroup and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Custom script: set udg_Target = null
Custom script: call RemoveLocation(udg_TargetPoint)
Custom script: call DestroyGroup (udg_UnitGroup)
[/TRIGGER]
2nd Trigger
This trigger is to create a building that every 20 seconds will provide unobstructed sight for 10 seconds using the similar dummy. However, even if the building is destroyed. The sight is still provided.
[trigger=Eye in the Sky 2]Eye in the Sky 2
Events
Time - Every 20 seconds of game time
Conditions
Actions
Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of Matching unit) Equal to Arcane City))
Unit Group - Pick Every unit in UnitGroup and do (Actions)
Loop - Actions
Unit - Create 1 Eye for (Owner of Picked unit) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add a 10.00 seconds Generic expiration timer to (Last created unit)
Custom script: call DestroyGroup (udg_UnitGroup)[/trigger]
1st Trigger
This is my attempt to create a building with unobstructed sight. I plan to create a flying dummy above the location of the building to provide the said sight. That trigger is fine for now. However, i can't remove/kill the dummy after the building is destroyed. It seems to me any unit with the Locust ability can not be selected by using unit within range.
[trigger=Dummy Create]Eye in the Sky
Events
Unit - A unit Finished construction
Conditions
(Unit-Type of (Constructed Structure)) Equal to Tower of Wisdom
Actions
Set Caster=(Constructed structure)
Set CasterPoint=(Position of Caster)
Unit - Create 1 Eye for (Owner of Caster) at CasterPoint facing Default building facing degrees
Custom script: set udg_Caster = null
Custom script: call RemoveLocation(udg_CasterPoint)[/trigger]
[TRIGGER=Dummy Destroy]Destroy
Events
A unit dies
Conditions
(Unit-type of (Dying unit)) Equal to Tower of Wisdom
Actions
Set Target = (Dying unit)
Set TargetPoint = (Position of Target)
Set UnitGroup = (Units within 300.00 of TargetPoint matching ((Unit-type of Matching unit) Equal to Eye)
Unit Group - Pick Every unit in UnitGroup and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Custom script: set udg_Target = null
Custom script: call RemoveLocation(udg_TargetPoint)
Custom script: call DestroyGroup (udg_UnitGroup)
[/TRIGGER]
2nd Trigger
This trigger is to create a building that every 20 seconds will provide unobstructed sight for 10 seconds using the similar dummy. However, even if the building is destroyed. The sight is still provided.
[trigger=Eye in the Sky 2]Eye in the Sky 2
Events
Time - Every 20 seconds of game time
Conditions
Actions
Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of Matching unit) Equal to Arcane City))
Unit Group - Pick Every unit in UnitGroup and do (Actions)
Loop - Actions
Unit - Create 1 Eye for (Owner of Picked unit) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add a 10.00 seconds Generic expiration timer to (Last created unit)
Custom script: call DestroyGroup (udg_UnitGroup)[/trigger]