Jump to content
thermicgravy

Need help with respawning inside a static airplane

Recommended Posts

Hi there,

I'm currently making a WW2 airborne style mission for me and a couple of friends, but I've run into a problem. After struggling with the respawning inside of a vehicle for a while I've finally managed to do it with the help of a trigger, but now I've run into a new problem: the vehicle they're spawning in is a C-47, but because the AI can't keep them in the air for long I've had to disable the simulation so that they don't spawn inside a crashed airplane.
The problem with that is that when simulation is disabled, they are unable to move around inside it, and can't jump out. So I'm stuck with a respawn that is either a crashed plane, or a static plane they can't jump out of. Does anyone know of a way of making the plane stay static in the air but still being able to get out/getting kicked out as soon as they spawn inside it?
Or is there a way to make the AI fly around the AO for a undetermined amount of time without it crashing?
Any help would be appreciated!

Share this post


Link to post
Share on other sites

I should add that I currently have a plane attached to a static object in the air, which works as far as having people respawn inside it, but then they are still unable to move around and eject.

Share this post


Link to post
Share on other sites

What about "plane allowDamage false;" instead of disabling the simulation? (just guessing...)

Share this post


Link to post
Share on other sites

I can set it to not take damage, but the AI will still fly it straight into the ground. So I basically need a way to attach it to an object in the sky so that it is static, but then still allows people to jump out or have them kicked out of it as soon as they get in.

Share this post


Link to post
Share on other sites
1 hour ago, thermicgravy said:

but because the AI can't keep them in the air for long

 

I think this is the reason for ur problem and this is the point which should get solved.

 

An ugly, dirty but easy way would be to just set the position of ur plane by using a mission event handler like this:

addMissionEventHandler ["EachFrame",{YourPlaneName setPosASL YourPlaneInitialPosition;}];

 

But I think u should try to get the AI flying the plane as needed.

 

What are u actually doing to get the plane on course? Do you use a loiter wapoint? And what is happening?

 

Share this post


Link to post
Share on other sites

Yes. when I try it with the plane moving around the map I set a loiter waypoint near the AO. The ai starts wiggling the wings around and pretty much does a nose dive straight into the ground. I've tried different speed and combat settings for the waypoint but it keeps happening. I'm using the C-47's from the Faces of War mod.

 

Is there a way to just kick out any player that spawns in the vehicle?

Share this post


Link to post
Share on other sites

Idk what exactly the problem is. Therefore I can just tell what I would test in that situation. I would set the AI's groups behaviour to careless and it's combat mode to blue and tweak it's AI with disableAI:

 

// create array with skills which will be disabled
_disable_array = ["TARGET", "AUTOTARGET", "MOVE", "ANIM", "TEAMSWITCH", "FSM", "AIMINGERROR", 
	"SUPPRESSION", "CHECKVISIBLE", "COVER", "AUTOCOMBAT", "PATH"];

// tweak behaviour and combat mode
group driver YourPlanesName setBehaviour "CARELESS";
group driver YourPlanesName setCombatMode "BLUE";

// disable all unwanted skills for all members of the pilots group
{
 _unit = _x;
 {
  _unit disableAI _x;
  true
 } count _disable_array;
 true
} count units group driver YourPlanesName;

In the above code I created an array with ALL skills which can be disabled. You should test which u need to be disabled...

Share this post


Link to post
Share on other sites
18 hours ago, engima said:

Attach the plane to something on the ground (an invisible H-pad or to something you bury in the ground), and with a z-offset for the height.

 

https://community.bistudio.com/wiki/attachTo

 

Use leaveVehicle to kick them out.

 

https://community.bistudio.com/wiki/leaveVehicle

 

19 hours ago, sarogahtyp said:

Idk what exactly the problem is. Therefore I can just tell what I would test in that situation. I would set the AI's groups behaviour to careless and it's combat mode to blue and tweak it's AI with disableAI:

 


// create array with skills which will be disabled
_disable_array = ["TARGET", "AUTOTARGET", "MOVE", "ANIM", "TEAMSWITCH", "FSM", "AIMINGERROR", 
	"SUPPRESSION", "CHECKVISIBLE", "COVER", "AUTOCOMBAT", "PATH"];

// tweak behaviour and combat mode
group driver YourPlanesName setBehaviour "CARELESS";
group driver YourPlanesName setCombatMode "BLUE";

// disable all unwanted skills for all members of the pilots group
{
 _unit = _x;
 {
  _unit disableAI _x;
  true
 } count _disable_array;
 true
} count units group driver YourPlanesName;

In the above code I created an array with ALL skills which can be disabled. You should test which u need to be disabled...

 

Thanks to you both, but this still results in either the players being stuck in the back, or after trying to disable differents skills the AI still crashing after a while.

Share this post


Link to post
Share on other sites
addMissionEventHandler ["EachFrame",
{
 YourPlaneName setPosASL ((getPosASL YourPlaneName) set [2, YourPreferedHeight]);
}]; 

Time to try the dirty one ;-)

 

YourPlaneName - is the variable name of ur plane

YourPreferedHeight - is the height ASL u want the plane to be at

 

EDIT: There is a big mistake in above code. I need some minutes to get rid of it!

EDIT2: corrected it and maybe it works now. But is untested.

Edited by sarogahtyp

Share this post


Link to post
Share on other sites

That one had some effect, but still results in a plane you cannot get out of. Right now I'm considering just changing the respawn to where they would be parachuting as soon as they spawn. Is there an "easy" way to do this?

Share this post


Link to post
Share on other sites

This event handler should not have the effect that nobody can get out of the plane. It just correct the planes position and nothing else.

What is that issue about? Is there no action menue or why cant u leave the plane?

Share this post


Link to post
Share on other sites

There is an action menu, however none of the actions work resulting in everyone getting stuck in the plane. I'm starting to suspect the fact that the plane does not have an "eject" command, but a "static line jump" command.

 

Either way I've now resorted to using a flagpole with a halo jump script. If there's a way to just respawn players in the air near a certain marker I would prefer that but I'm not sure if there's a way to do it.

Share this post


Link to post
Share on other sites

The problem is definetly not in plane positioning scripts but in the plane itself.

 

If the players which are on the cargo seats have not the "Eject" option, something else is happening.

 

Try to test with the plane just fying with a simple move waypoint.

 

Try to test with the plane landed and stopped.

 

Try to test with another type of plane if you can.

 

An automatic dive and crash is not normal too.

Share this post


Link to post
Share on other sites

Yeah I've resigned to the fact that the plane is the problem, so I'm sticking with the HALO jump method. Thanks all for the help!

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

×