Jump to content
Sign in to follow this  
ministuff

Setting the rotor speed AI-controlled helicopters

Recommended Posts

Hello guys, I'm experimenting with creating a simple driveable helicopter carrier that also works with AI-controlled helicopters. The carriers is a simple ship with a large cargoBayDimension specified in the carrier class, and the AI helicopters don't have any problem loading itself into the carrier, but once it's loaded, it will never turn off its engine as engineOn command doesn't seem to work on attached vehicles nor vehicles loaded on transport vehicle.


What I had in mind was to create a script that instantaneously turns off the engine and sets the rotor speed to zero right before the helicopter is loaded into the carrier. I have tried using setWantedRPMRTD

AI_chopper setWantedRPMRTD [0, 0, -1]

and setEngineRPMRTD

AI_chopper setEngineRPMRTD [0, -1]

to no avail. It seems that most engine-related RTD commands only work on player vehicles and only when the advanced flight model is enabled, and some are only available to take-on helicopters. Any ideas what command or possible workarounds I could use?

 

I did try putting the exit points of the cargo bay just barely above the carrier deck,  and since I do have the WMO mod loaded, the AI choppers can be unloaded onto the deck and somewhat safely spool up before flying off, but this doesn't work for spooling down after landing, and since WMO is a bit wonky, I'd like to not rely on it as well if possible.

 

Share this post


Link to post
Share on other sites

Workaround, not tested. Both animate commands should instantaneously stop the rotors, tho (in theory at least).

AI_chopper setFuel 0;
AI_chopper animate ["HRotor",0];
AI_chopper animate ["VRotor",0];

 

Share this post


Link to post
Share on other sites

 

On 5/13/2019 at 10:11 AM, NightIntruder said:

Workaround, not tested. Both animate commands should instantaneously stop the rotors, tho (in theory at least).


AI_chopper setFuel 0;
AI_chopper animate ["HRotor",0];
AI_chopper animate ["VRotor",0];

 

 

tried it, unfortunately it doesn't seem to work, even when it's not attached, the helicopter RTD mechanics is quite a bit beyond me it seems. So now instead I'm just simply using createVehicle command to create a duplicate of the helo, and transfer the crew to the new one using moveInAny command. As createVehicle spawns a landed chopper by default, but can also spawn a fully spooled-up chopper using "FLY" parameter.

 

Regardless, thanks for the suggestion anyway.

Share this post


Link to post
Share on other sites

RTD mechanics are aplicable on player-driven helo with AFM on only, as you've already noticed. I'm glad you found workaround.

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  

×