PDA

View Full Version : [Support] How to make one entity not attackable until another is destroyed?



krs
03-29-2011, 09:16 AM
I have a ward in place and I do not want it to be destroyed until a tower is.

Schm0ftie
03-29-2011, 09:26 AM
I would do it like this:



The Ward
<onspawn>
...<applystate .... invulnerable state>
</onspawn>

The Tower
<ondeath>
...<expirestate invulnerable state tower>
</ondeath>


Guess there are other ways too

dandylion
03-29-2011, 11:13 AM
In the editor itself, you could look at Caldavar. If it's a pre-placed entity, you can make it dependent on another entity. Look at the scripts for the towers on either side. Tower 2 is invulnerable until Tower 1 dies, and it goes back like that along the way. Using something similar on your pre-placed entities should work with something like that. If it's something you're spawning later, then you'll have to script it how Schmoftie has it.

krs
03-29-2011, 02:10 PM
Yes I want to make it just like towers in caldavar.... the thing is I do not understand how it is done. What I see is only some parameters passed to Target #1...

dandylion
03-29-2011, 04:36 PM
That's how you do it. The Target #1 and whatnot indicates the tower that determines whether or not the tower is immune or not.
It reads somewhat like this:
If tower X is alive, then tower Y (this tower) is immune.
Just put the name of the tower you want dependency on in the "target" area on the tower you want to be immune.

krs
03-30-2011, 05:18 AM
Does not work.

I have a ward that has to be imune as long as tower is alive.

At ward I put at target#1 the towers name and it does not work. Maybe the behaviour for target#1 is scripted only for towers somwhere?

dandylion
03-30-2011, 07:36 AM
It may only be scripted for buildings. I know the barracks and main base also inherit immunity by the Target #1. I would then try to do it the way Schmoftie has it. What he has should work just fine.

TPXL
04-08-2011, 10:32 AM
Make a minuature tower structure with ward vision and no attack?

Its a building so it should behave like a tower, no?