Jump to content

Recommended Posts

Posted (edited)
5 hours ago, =Katze= said:

Hi I'm trying to integrate this into my mod but I'm unsure of the basic files needed to get it up and running? In the readme it says create the Basic_EFM_template.dll in the bin file and then it should be fine this leads to an error with missing cfg file.  I'm also unsure if any other files are missing (the file which says Basic_EFM_Template with cpp files) or how to install them inside the mod folder.  Is anyone able to list the files or post a screen shot of the correct file structure. Thanks! 

(I found the previous version and have the same issue as people reported where the aircraft only works as an Ai aircraft)

 

Using Microsoft Visual Studio, you need to build the solution as an x64 DLL like this:

image.png

The .h and .cpp files are only for building the DLL.

There is a zip file I added in the first post of this thread that's basically a demo, it should show you the structure of what it should look like in the mod.

Edited by Sérvalpilot
  • Like 2
Posted
On 5/8/2024 at 9:00 PM, Sérvalpilot said:

Maybe it's something fixed with the latest update or it's something on your end, but I don't get any problems with this on the MT version.

Make sure you're building it as x64 and check dcs.log for errors.

Thanks for providing the sample in the first post! I compared to my entry.lua config and saw that I did not have FM.old = <number> in it:

local cfg_path = current_mod_path .."/FM/config.lua"
dofile(cfg_path)
FM[1] 		= self_ID
FM[2] 		= 'F-8_efm.dll'
FM.old      = 6
FM.config_path 	= cfg_path

With this line in entry.lua, DCS in MT does no longer crash.

Thanks,
TeTeT

  • Like 1
Posted (edited)
16 hours ago, Sérvalpilot said:

Using Microsoft Visual Studio, you need to build the solution as an x64 DLL like this:

image.png

The .h and .cpp files are only for building the DLL.

There is a zip file I added in the first post of this thread that's basically a demo, it should show you the structure of what it should look like in the mod.

 

Thanks, I'm wondering if its DCS side because I tried the older Dll files provided and the lua files with the Mig-31 and had the same problem with DCS not wanting to read the dlls so i'm not sure its a Visual studio issue.   Still trying to hunt down the issue. 

(Ok I found the issue! I'd missed afew lines in the entry.lua which the comment above mentions after following the readme file.  Plus it works in MT!)

Edited by =Katze=
  • Like 1
  • 2 months later...
Posted

Update 1.1 is now out on GitHub!

This new version adds support for aircraft carrier catapult launching, better roll stability, and other minor stuff.

As always, feedback is much appreciated!

  • Like 2
  • Thanks 3
Posted
On 8/9/2024 at 1:31 PM, Sérvalpilot said:

Update 1.1 is now out on GitHub!

This new version adds support for aircraft carrier catapult launching, better roll stability, and other minor stuff.

As always, feedback is much appreciated!

Hey there Servalpilot!  I downloaded your file, updated visual studio and managed to build a dll file that works when swapped out in the entry lua.  I want to update a few aircraft and i have permission from the authors to try and fix these dead mods!  I built a dll and updated the F-117A by Jinxx, it flies but for some reason it rolls to starboard very hard and i cant seem to figure out which variable controls that function.   Can you help me out with a few things friend?  I saw in the template this build was based from the Su25 frogfoot which is perfect for the Nighthawk seeing that it has no afterburners, but what can i do for an aircraft with afterburners?  May i share the F-117 folder and edited EFM template i am working on with you?

  • 3 weeks later...
Posted

@DCSjunked That seems like a problem with the aircraft's center of mass. Maybe the weapons are loaded on one side? Check the aircraft definition file, so something like F117.lua, and see if the pylons Z coordinates are not symmetrical. Also, if you modified the center of mass in the config.lua file in the FM folder, make sure the Z coordinate is 0. Lastly, on the C++ side, check the wing positions near the top of ed_fm_template.cpp (which I'll probably move to fm_data.h later).

About afterburners,  there's a couple ways you can do that. First, you can get a second max thrust table for "wet" mode and when the throttle is above a certain value, switch the thrust calculations to draw from that table instead of the "dry" mode table. Second, you could simply multiply the thrust value; in my own research it seems like most fighter engines generate around 1.7 times more thrust in wet mode. Also, I left in some comments in the draw_args function about afterburner visual effects.

Posted

Thanks!  I have been checking out your project and the only issue i am having with the F-117 is that it is generating too much lift - I modified the pitch trim value to -.0275 and the aircraft is level at max throttle, but when i reset the mission the trim resets and the jet generates too much lift again!  

other than that issue i'm having the file is mint! i really enjoy learning with it and would like to help fix a few more birds

i would like to be able to use this template on twin engine afterburning jets but im not sure how to set up the arguments - i saw in the hints area about the burners being hooked up to 28 and 29 but im just not familiar like you 😅

Posted

@DCSjunked You can change the default trim value so it doesn't reset to 0 on mission reset.
About afterburners, here's a simple thing you can do:

if (throttle > 0.9)
afterburner = true;

if (afterburner = true)
thrust *= 1.75

For the afterburner effects, you can use the actuator function in a similar way to the gear and flaps, but tie it to throttle.

Posted

I've noticed general issues with cog when i tweak afew values, I'm trying to remove afew of the stabilization features in the code to see if it can be corrected. Finding it hard though because i'm not too familiar with the code 

  • 4 weeks later...
  • 1 month later...
Posted (edited)
On 3/26/2024 at 2:57 PM, Sérvalpilot said:

After over a year of refinement, trial and error and learning from other flight model projects, I present to you the successor to my previous FM project.

Basic External Flight Model (EFM) template!

This is an enhanced version of the EFM template provided by Eagle Dynamics, with emphasis on simplicity and editability while also feeling smooth and believable.

This FM template was designed to work "out of the box", designed like a two-engine subsonic trainer/fighter.

What is included:

  • Lift, drag, side, and thrust forces.
  • Axis and discrete (keyboard) pitch, roll, and yaw controls with trim.
  • Landing gear, flaps, slats, and air brakes.
  • Engine startup/shutdown.
  • Basic fuel draining system.
  • Basic damage mechanics.
  • Semi-realistic stalling, Dutch-rolling, and other oscillations.
  • Infinite fuel and easy flight options.
  • Example parameter to interface with the Lua environment.
  • Lots of comments explaining how things work.

The template itself and a pre-built .DLL file can be found on GitHub!
https://github.com/IGServal/DCS-Basic-EFM-Template

Here is a pre-built .DLL with instructions on getting it integrated in a mod:
 BasicEFM mod.zip

Requirements:
Microsoft Visual Studio (2019 was used to create this, but other versions might work as well).
Basic understanding of C++, Lua, and flight physics.

Feedback, bug reports, and suggestions are always appreciated!

 

I wanted to thank you personally, thanks to you i was able to better understand EFM and made the SU57 EFM well lot of work still need to be advanced but it's a start, you and that other f-16 demo efm have worked wonders to better understand EFM, I even went as far as adding thrust vectoring and Vtol to the efm template, anyway just wanted to thank you for your work.

On 10/5/2024 at 10:59 AM, Thunder Chicken22 said:

Hey just tried this.  Having a weird issue where the cockpit model doesn't load whereas before it would using the SFM.  Any ideas?

If the file structure and entry lua calls are correct, then it should work, check that in entry you have, binaries    = { 'yourefm', },      -- The DLL of the external flight model 

Edited by cubanace
  • Like 1
Posted

A little explanation for those that don't know the difference between Debug and release builds/compiling....

Debug: for testing on your machine or your teams, compiles in a way that the project works on those that have visual studio installed, but won't work if visual studio is missing.

Release: This is the correct build compiling for the public, works for everyone.

This is as simple as i can explain it, good luck.

  • Like 2
Posted
On 11/14/2024 at 10:25 PM, cubanace said:

If the file structure and entry lua calls are correct, then it should work, check that in entry you have, binaries    = { 'yourefm', },      -- The DLL of the external flight model 

I am pretty sure I caught it, it was a syntax error in the entry.lua.  Now, however, I am getting another error.  In the log I get the following error:

ERROR   APP (Main): Invalid Unit Module: "F-23A" CWS initialization failed

Oddly the mission will load and I can even select the correct client but when you select "fly" I do not spawn in as a player but watch 3rd person on some random static asset.  Even more odd, the flight that I selected now loads in and starts as a AI asset.  I haven't had much time to mess with it in the past week but that's were I am currently stuck.

Posted
13 hours ago, Thunder Chicken22 said:

I am pretty sure I caught it, it was a syntax error in the entry.lua.  Now, however, I am getting another error.  In the log I get the following error:

ERROR   APP (Main): Invalid Unit Module: "F-23A" CWS initialization failed

Oddly the mission will load and I can even select the correct client but when you select "fly" I do not spawn in as a player but watch 3rd person on some random static asset.  Even more odd, the flight that I selected now loads in and starts as a AI asset.  I haven't had much time to mess with it in the past week but that's were I am currently stuck.

CWS is your problem, its not loading avionics, your mod feeds of fc3 ? 

Posted (edited)
On 11/19/2024 at 12:06 PM, cubanace said:

CWS is your problem, its not loading avionics, your mod feeds of fc3 ? 

Yeah FC3.  I figured that the CWS is the issue but I am not certain why it isn't loading.  I am guessing I have something wrong with my entry.lau.

Here is my entry.lua.  I think I have it properly setup hence my confusion.

--------------------------------------------
--F-23A mod by ThunderStruck Simulations
--------------------------------------------



self_ID = "F-23A by ThunderStruck Simulations"
declare_plugin(self_ID,
{
image     	  = "FC3.bmp",
installed 	  = true, -- if false that will be place holder , or advertising
dirName	  	  = current_mod_path,
developerName = _("ThunderStruck Simulations"),
fileMenuName  = _("F-23A Blk 20"),
displayName   = _("F-23A Blk 20"),
shortName  	  = _(""),
version		  = _("Block 20"),
state		  = "installed",
update_id     = "F-23A Blk 20",
info		  = _("F-23A DP231"),
binaries = { 'BasicEFM_template', },                                                                    --EFM test
encyclopedia_path = current_mod_path..'/Encyclopedia',
--rules 		 = { ["F-15C"] = {required = true},},


Skins	=
	{
		{
		    name		= _("F-23A"),
			dir			= "Theme"
		},
	},
Missions =
	{
		{
			name		= _("F-23A Blk 20"),
			dir			= "Missions",
  		},
	},
LogBook =
	{
		{
			name		= _("F-23A Blk 20"),
			type		= "F-23A",
		},
	},	
		
InputProfiles =
	{
		["F-23A"] = current_mod_path .. '/Input/F-23A',
	},
	
})


----------------------------------------------------------------------------------------

mount_vfs_model_path	(current_mod_path.."/Shapes")
mount_vfs_model_path    (current_mod_path.."/Cockpit/Shape") 
mount_vfs_liveries_path (current_mod_path.."/Liveries")
mount_vfs_texture_path  (current_mod_path.."/Textures")
--mount_vfs_texture_path  (current_mod_path.."/Textures/AIM_120C5")-
mount_vfs_texture_path  (current_mod_path.."/Textures/F-23A")
mount_vfs_texture_path  (current_mod_path.."/Textures/F-23A_Cockpit")
mount_vfs_texture_path  (current_mod_path.."/Textures/Clipboards")
--mount_vfs_texture_path  (current_mod_path.."/Textures/Cockpit Photo")

-------------------------------------------------------------------------------------



local cfg_path = current_mod_path .."/FM/config.lua"                                                            --EFM test
dofile(cfg_path)
FM[1] 		= self_ID
FM[2] 		= 'BasicEFM_template'
FM.old 		= 6 -- 3 = Su-27 avionics, 6 = F-15C
FM.config_path 	= cfg_path

dofile(current_mod_path.."/Weapons.lua")
dofile(current_mod_path.."/Views.lua")
make_view_settings('F-23A', ViewSettings, SnapViews)

-------------------------------------------------------------------------------------
make_flyable('F-23A',current_mod_path..'/Cockpit/Scripts/',FM, current_mod_path..'/comm.lua')
--make_flyable('F-23A',current_mod_path..'/Cockpit/Scripts/',{nil, old = 6}, current_mod_path..'/Comm.lua')
--make_flyable('F-23A', current_mod_path..'/Cockpit/Scripts/', F23FM , current_mod_path..'/comm.lua')

-------------------------------------------------------------------------------------
dofile(current_mod_path..'/F-23A.lua')

plugin_done()

 

Edited by Thunder Chicken22
  • 2 weeks later...
Posted
В 19.11.2024 в 04:08, Thunder Chicken22 сказал:

I am pretty sure I caught it, it was a syntax error in the entry.lua.  Now, however, I am getting another error.  In the log I get the following error:

ERROR   APP (Main): Invalid Unit Module: "F-23A" CWS initialization failed

Oddly the mission will load and I can even select the correct client but when you select "fly" I do not spawn in as a player but watch 3rd person on some random static asset.  Even more odd, the flight that I selected now loads in and starts as a AI asset.  I haven't had much time to mess with it in the past week but that's were I am currently stuck.

I'm having the same problem of cockpit not loading with EFM template, while working well with SFM, but I can't find the issue. What did you fix in the entry.lua, if I may know?

  • 2 weeks later...
  • 2 months later...
Posted
On 3/30/2024 at 2:14 PM, Copprhead said:

Try single thread version. Last time i checked the display doesn't work in MT version.

To display force component vectors in MT version, see solution:

 

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

  • Recently Browsing   0 members

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