Jump to content
Sign in to follow this  
santafee

Allow Damage not Working

Recommended Posts

I want to have an UAV coming down, as i set the fuel to 0 with a trigger.

If i give the Init of the UAV "UAV allowDamage false" it still getting destoyed.

Is allowDamage not working at all-how do i make it undestroyeble?

Share this post


Link to post
Share on other sites

It should work unless the unit's name isn't UAV. Since you're doing it in the unit's init box, use this allowDamage false instead.

Edit: now that I tested it, it indeed explodes. It seems that aircraft aren't protected from crashing.

Edited by Celery

Share this post


Link to post
Share on other sites

If you don't mind a stupid-looking crash, here's a workaround:

Trigger

Condition: getPos UAV select 2>0.1 and getPos UAV select 2<0.5

On act: UAV setVelocity [0,0,0]

It should halt the UAV so it lands softly on the ground. If it still crashes, raise the 0.5 to some bigger number so the trigger has time to react.

Edit: dammit, it still explodes. :confused:

Edited by Celery

Share this post


Link to post
Share on other sites

Hi all!

Let's try this:

write in the initfield of the uav this line:

nul = this execVM "scripts.sqf"

then write an .sqf file and name it 'scripts.sqf' and write in it this code:

waitUntil{ ((getPos _this) select 2)<9 };  //try to raise or fall the number '9' (the height of the uav before it touches the ground)
_this setVelocity [0,0,0];
_this setPos [(getPos _this) select 0, (getPos _this) select 1, 0];
_this allowDamage false;

It work for me, I've tested it for a few. It don't allow the UAV to get damage when it touches the ground. Maybe you have to raise or fall the number '9' in the waitUntil command but I've seen that 9 seems to be the perfect height.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×