Building respawning

daaim0

New Member
Joined
Dec 23, 2005
Messages
1
Reaction score
0
Hello

i am trying to make a tigger where when a arcane tower dies it creates another one in its place and so on for infinity.

so far i have this simple code

Tower die1
Events
Unit - Arcane Tower 0024 <gen> Dies
Conditions
Actions
Unit - Create 1 (Unit-type of Arcane Tower 0024 <gen>) for Player 3 (Teal) at (Center of tower1 <gen>) facing Default building facing degrees
Special Effect - Create a special effect at (Center of tower1 <gen>) using Doodads\Cinematic\TownBurningFireEmitterBlue\TownBurningFireEmitterBlue.mdl
Wait 1.00 seconds

but it only rebuilds the tower once.

thank you for anyone that can help mehttp://battleforums.com/images/smilies/banghead.gif
:hbut
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
The problem is, the event only fires when the specific tower "Unit - Arcane Tower 0024 <gen>" dies. To replace only this specific unit, create a unit variable like "TowerVar", and at map initialization set "Arcane Tower 0024 <gen>" in the variable.

Then do an event like:
Code:
[I]Events[/I]
Unit - [COLOR="Red"]TowerVar[/COLOR] Dies
[I]Conditions[/I]
[I]Actions[/I]
Unit - Create 1 (Unit-type of [COLOR="Red"]TowerVar[/COLOR]) for Player 3 (Teal) at (Center of tower1 <gen>) facing Default building facing degrees
[COLOR="Red"]Set TowerVar = Last created unit[/COLOR]
Special Effect - Create a special effect at (Center of tower1 <gen>) using Doodads\Cinematic\TownBurningFireEmitterBlue\TownB urningFireEmitterBlue.mdl
Wait 1.00 seconds
This way, the "TowerVar" variable will always hold the newest tower, and when it will die the event will fire.

I did it without the editor, it may not work, so tell me if it doesn't :).
 

Aaron7772

BattleForums Junior Member
Joined
Aug 9, 2005
Messages
139
Reaction score
0
Location
At My Location
Events
Unit - TowerVar Dies
Conditions
Actions
Unit - Create 1 (Unit-type of TowerVar) for Player 3 (Teal) at (Center of tower1 <gen>) facing Default building facing degrees
Set TowerVar = Last created unit
Special Effect - Create a special effect at (Center of tower1 <gen>) using Doodads\Cinematic\TownBurningFireEmitterBlue\TownB urningFireEmitterBlue.mdl
Wait .05 seconds

This code should work, i havnt tested it though.
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
It is exactly what I said...
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
However, you need to take into consideration that after the building is destroyed - there should be 0 units within that region at the time the building ressurects!
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
Hellwolf_36 said:
However, you need to take into consideration that after the building is destroyed - there should be 0 units within that region at the time the building ressurects!
Well, the event is "Unit Dies", so a unit could probably not enter the respawn zone fast enough before the tower reappears ;).
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Umm there is a way. If the unit moves fast enough, it can run through the tower spawn and possibly interrupt it, in an attempt for that unit to attack another.
 

NewPosts

New threads

Top