Jump to content
Sign in to follow this  
madmedic

Disable AI ability to eject from aircraft

Recommended Posts

Is there a way to keep the AI pilot, gunner, and cargo from ejecting from a damaged aircraft?

I tried locking the plane...didnt work.

Share this post


Link to post
Share on other sites

try

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane eventHandler ["hit", {(_this select 0) lock true}]

since a plane automatically unlocks when hit.

Share this post


Link to post
Share on other sites

You could force them back in with a script called from the GetOut event handler, but what effect it might have I don't know, as it will loop continously. Once they are dead they will stay in, unless the addon is setup to eject dead bodies to.

Why do you want them to stay in?

Share this post


Link to post
Share on other sites

or you could setdammage the pilot to death as soon as the plane gets a certain damage level. I don't think dead pilots open their parachutes

Share this post


Link to post
Share on other sites
You could force them back in with a script called from the GetOut event handler, but what effect it might have I don't know, as it will loop continously. Once they are dead they will stay in, unless the addon is setup to eject dead bodies to.

Ejecting doesn't trigger the getout EH AFAIK.

Share this post


Link to post
Share on other sites
You could force them back in with a script called from the GetOut event handler, but what effect it might have I don't know, as it will loop continously. Once they are dead they will stay in, unless the addon is setup to eject dead bodies to.

Why do you want them to stay in?

I need it to work for the units in cargo as well.

I am using it on C47 transport planes in a D DAY scenario.

I have some pretty heavy german AA on the ground, and some of the planes will not make it through. (Very random...if the plane you are in gets shot down, you are dead, start the mission over until you get through)

The problem is: when one of the planes is shot down, the pilot, co pilot, and cargo all magically eject instantaneously.

In real life, maybe one or two of the cargo would be able to make it out of the plane if lucky...and the pilots would almost certainly go down.

This would also pertain to helicopters in OFP...nobody should be ejecting from a damaged helicopter.

Share this post


Link to post
Share on other sites
or you could setdammage the pilot to death as soon as the plane gets a certain damage level. I don't think dead pilots open their parachutes

how would you write the array for the command to kill all of the crew, and all of the cargo using the setdammage 1.0 line?

(arrays are my kryptonite, they kill me)

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

"_x setdammage 1" foreach crew plane1"

That should kill all the men inside of plane1, also the cargo.

Share this post


Link to post
Share on other sites

I'm kind of stupid at this but could one of you guys post a example on how to get this to work?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x setdammage 1" foreach crew plane1"

I get that but how would I tie that to the plane's dammage level?

Share this post


Link to post
Share on other sites

Well I tested the GetOut event just in case, works a treat.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This AddEventHandler ["GetOut",{_This Select "Eject.sqs"}]

Eject.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Unit=_This Select 2

DeleteVehicle (Vehicle _Unit)

DeleteVehicle _Unit

That just deletes everyone who tries to eject

Quote[/b] ]I get that but how would I tie that to the plane's dammage level?

You could rigg it up to the GetOut event, that would allow at least one bloke to eject alive. Not sure what would happen to the dead guys though.

Share this post


Link to post
Share on other sites
Well I tested the GetOut event just in case, works a treat.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This AddEventHandler ["GetOut",{_This Select "Eject.sqs"}]

Eject.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Unit=_This Select 2

DeleteVehicle (Vehicle _Unit)

DeleteVehicle _Unit

That just deletes everyone who tries to eject

Quote[/b] ]I get that but how would I tie that to the plane's dammage level?

You could rigg it up to the GetOut event, that would allow at least one bloke to eject alive. Not sure what would happen to the dead guys though.

Ahh...but, Is that ALSO going to delete them if they make it past the air defenses, and begin their paradrop over the landing zone.

I want things to be as random as possible.(if they get shot down, they are dead...but if not...they will parachute in with the rest of the invasion force.

Share this post


Link to post
Share on other sites
Quote[/b] ]Ahh...but, Is that ALSO going to delete them if they make it past the air defenses, and begin their paradrop over the landing zone.

We can only reply to the question you ask, perhaps the command removeEventHandler might come in handy before you instigate your jump smile_o.gif

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  

×