Jump to content

(WIP) Custom flight model mod version 7 + source code


Recommended Posts

Hi Sérvalpilot,

I've figured out what's wrong with the flaps handling. The enum assignment for flapsup/flapsdown is wrong. They have to be exchanged.

flapsdown is to be = 145

flapsup is to be  = 146

this is conventional DCS command enumeration.

 

in the void ed_fm_set_command (int command, float value)

the the flapcommand logic seems to be ok.

but in the void ed_fm_set_draw_args(EdDrawArgument* drawargs, size_t size) 

drawargs[9].f = (float)limit(ACTUATORS::flapPosition_DEG, 0.0, 1.0); 

if ACTUATORS::flapPosition_DEG is indeed in degrees, then I think we have to divide this value by MAX_FLAP_DEFLECTION_DEGREES factor. This can be airplane specific ~20-25 degrees. And then we actually limit the animation value within [0.0, 1.0].

best regards,

Valery

 

 

 

Link to comment
Share on other sites

regarding the PlaneFM::weight_on_wheels logic.

I don't think we need the complex logic to find out whether the plane is on ground or not. The weight_on_wheels could be retrieved by implementing the void ed_fm_suspension_feedback(int idx, const ed_fm_suspension_info* info)

info->acting_force[1] is basically the weight on wheel. So, you don't need any extra logic for it.

idx = 0|1|2 is the wheel index NOSE|RIGHT|LEFT 

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
On 12/11/2021 at 1:08 PM, Sérvalpilot said:

Hey!

Source code has been updated.

I have some problems with the MiG-31 mod. It handles in a very weird way compared to the other mods I've tried; but the biggest problem is that landing gear doesn't work. Trying to land always results in an explosion, even with invincibility on. I can't figure out how to fix that.

Luckily for everyone, Eagle Dynamics seems to be reworking the AI flight model! Hopefully this "general flight model" is good enough to not need my mod any more.

For those of you with installation problems, here's a part of the readme:


Step 1: Go to the directory for the mod you want to integrate this FM with in your /saved games/DCS/mods/aircraft folder.

Step 2: Paste the contents of the .RAR archive in there.

Step 3: Open the "entry.lua" in the mod's folder and add the following line of code below the "info" line: 
binaries = { 'CustomFM', },

Step 4: Further in the file where there's lines written "dofile...", add these lines of code:

local cfg_path = current_mod_path .."/FM/config.lua"
dofile(cfg_path)
FM[1]         = self_ID
FM[2]         = 'CustomFM'
FM.config_path     = cfg_path
FM.old         = 4

Step 5: Go to the line, usually near the end that reads "make_flyable..." and add "FM" instead of {nil, old = 4} to the line like shown below

Before:
make_flyable('[modded aircraft name]',current_mod_path..'[usually /cocpit/scripts]', {nil, old = 4}, current_mod_path..'/comm.lua')

After:
make_flyable('[modded aircraft name]',current_mod_path..'[usually /cocpit/scripts]', FM, current_mod_path..'/comm.lua')

Step 6: Save the .lua file, boot up DCS, and enjoy a smooth flight!

 

If that doesn't work, let me know.

Serval -- It won't let me spawn into the aircraft when I make these changes. Perhaps I am doing something wrong? I am attaching the MiG-31 mod's ORIGINAL "entry.lua" here. Could you fix it for me? I know how to download your .RAR and extract the files into the mod directory, but I think I am doing something wrong in the .lua, cuz it won't work. I can't spawn in as a player.

entry.lua

Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...