Jump to content
Sign in to follow this  
Suomileijona

Disabled tanks

Recommended Posts

When tanks are damaged, can't shoot and can't be repaired they still remain in the battlefield doing nothing and the enemies don't try to destroy them. It's annoying especially when the victory is achieved by killing all the enemies.

Is there a script that makes the crew get out of the tank in situation like that? Otherwise I just have to make an empty tank, name it, name the crew, assign the crew as the crew, order them to get in, make a trigger and write "not canfire "tankname"" in the condition field and "["crew"] ordergetin false" in the activation field for every tank.

Edited by Suomileijona

Share this post


Link to post
Share on other sites

Logically thinking about AI behaviour, it is enough just to make a vehicle unmoveable (!(canmove "name")). Crew/any infantry inside will instantly get out, they won't come back, no matter a repair truck is close.

So, IMO, a specific script isn't required, you have to stop armor completely and that would probably solve problem. No enemy resistance left, that's all.

Sorry, if I've misunderstood your requirements.

Share this post


Link to post
Share on other sites
Logically thinking about AI behaviour, it is enough just to make a vehicle unmoveable (!(canmove "name")). Crew/any infantry inside will instantly get out, they won't come back, no matter a repair truck is close.

Canmove is a test to check if a vehicle can move or not, it won't make the tank stop.

Share this post


Link to post
Share on other sites

hi,

When tanks are damaged, can't shoot and can't be repaired they still remain in the battlefield doing nothing and the enemies don't try to destroy them. It's annoying especially when the victory is achieved by killing all the enemies.

Is there a script that makes the crew get out of the tank in situation like that? Otherwise I just have to make an empty tank, name it, name the crew, assign the crew as the crew, order them to get in, make a trigger and write "not canfire "tankname"" in the condition field and "["crew"] ordergetin false" in the activation field for every tank.

Yes it is possible to do that.

Here's a script to make vehicle crews get out if the vehicle is too damaged or can't move or can't fire. It works for air and ground vehicles and also if the vehicle is allready crewed (duno if it's a correct sentence btw :)). SP/MP compatable.

Type [this] exec "emergency_bailout.sqs" in vehicle init field or [vehicleName] exec "emergency_bailout.sqs" in init.sqs.

emergency_bailout.sqs

;****************************************************
;Bail out crew Script by Nikiller v0.9b
;If the vehicle is too damaged then the crew bail out
;contact: nikillerofp@hotmail.fr
;[vehicleName] exec "emergency_bailout.sqs"
;****************************************************

_v = _this select 0

if (local _v) then {} else {goto "ende"}

_c=crew _v
_ac="EJECT"
_i = 0
_j = count _c
_d=0.5

@ damage _v>=0.8 || !(canFire _v) || !(canMove _v)
if (alive _v) then {} else {goto "ende"}
_v setVelocity [0,0,0]
@ (speed _v)<5

#n
(_c select _i) action [_ac,_v]
unassignVehicle (_c select _i)
[(_c select _i)] allowGetin false
_i=_i+1
~_d
?_j>_i: goto "n"

#ende

exit

It is the most uptodate version of this script.

Here's a demo to show how it works.

DEMO LINK

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

Or you can just check if it canmove or canfire, and if not, spawn a sabot to his location to make sure that the tank will explode :P

Share this post


Link to post
Share on other sites

Thanks for your time and help! Especially for the script.

Edited by Suomileijona

Share this post


Link to post
Share on other sites

hi,

Thanks for your time and help! Especially for the script.

I updated the script becasue I wrote it very quickly and IMHO the old version is a bit performance hungry especially if there's a lot of vehicles to check :). Moreover it looks strange when you execute it for air vehicles.

Here's the updated version.

Type [this] exec "emergency_bailout.sqs" in vehicle init field or [vehicleName] exec "emergency_bailout.sqs" in init.sqs.

emergency_bailout.sqs

;****************************************************
;Bail out crew Script by Nikiller v0.9c
;If the vehicle is too damaged then the crew bail out
;contact: nikillerofp@hotmail.fr
;[vehicleName] exec "emergency_bailout.sqs"
;****************************************************

_v = _this select 0

if (local _v) then {} else {goto "ende"}

_c=crew _v
_ac="EJECT"
_i = 0
_j = count _c
_d=1

#check
~_d
if ((damage _v<0.8) && (canFire _v) && (canMove _v)) then {goto "check"}

if (alive _v) then {} else {goto "ende"}

#n
(_c select _i) action [_ac,_v]
unassignVehicle (_c select _i)
[(_c select _i)] allowGetin false
_i=_i+1
~_d
?_j>_i: goto "n"

#ende

exit

cya.

Nikiller.

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  

×