Jump to content

DCS Mods structure : How to create your plugin from scratch


Recommended Posts

Working on other things,

 

what does it mean when you goto start a mission with a new module,

 

it loads ground objects, then gets to 50% on the next bar, and then re-loads the menu?

 

is it a LUA Problem or a edm issue?

 

edit: must be an EDM issue, swaping with another EDM bypasses the issue, back into 3ds Max i go......

 

edit edit, nevermind, it was because i had two Modules with the same code, lol... duh..


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

is the formatting for the lights in the wunderluft profile correct?

 

I can seem to get them to work on my model or the wunderluft, but if I throw my model in as a sub to say the F-18C my lights work fine....

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

is the formatting for the lights in the wunderluft profile correct?

 

I can seem to get them to work on my model or the wunderluft, but if I throw my model in as a sub to say the F-18C my lights work fine....

 

You'll have to change them accordingly (names and args) to the clickabledata.lua and your 3d shape in 3dsmax.

Link to comment
Share on other sites

ok, I must be missing a line somewhere.

 

made 4 modules with the wunderluft template.

 

but i can only use one aircraft at a time, and I have to move the other 3 out of my Aircraft folder to use one, or DCS Crashes...

 

So... Is there an Aircraft unique ID Number??

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

How to create debug window for dll tests?

I was looking at c++ forums, but basicaly there is working example for console and form apps, not for dll.

 

I added

#include <windows.h>
#include <iostream>
using namespace std;

 

and

 

cout << "thrust = " << throttle * 5000;
cin.get();

in void ed_fm_simulate(double dt) function, but no any debug windows or forms appear.

Link to comment
Share on other sites

Link to comment
Share on other sites

I'm stuck on trying to work on the cockpit and hoping you guys can help.

 

I have a device set up, I have the code for it installed, I followed the procedures as shown in this thread to do a gear up/down switch.

 

But when I get in the cockpit, I don't see my cursor to actually click on the switch. Since it's initially in mouse view mode I hit LALT-C to change it but still no mouse cursor. Is there a setting in a aircraft LUA that makes it non-clickable that I missed?

Coder - Oculus Rift Guy - Court Jester

Link to comment
Share on other sites

Shouldn't be. There are some bugs in the latest version of World that involve a disappearing mouse. First step is to try moving your mouse around a lot and clicking middle mouse button (or all the mouse buttons!) The missing cursor is NOT an issue with your model or code. If you can get the cursor to show up, I can fix the rest of your problems!

Link to comment
Share on other sites

Tried all the mouse button with no luck. If I load up the KA-50 (which I have a installed on my modding laptop) I can click everything fine. If I have then load up the wunderluft that's set up - nothing. Will keep messing with it.

 

 

UPDATE: So I noticed when I first get in the pit I do see the cursor. But if I got from mouse mode and back, I lose it and no clicking will get it back. So I've been setting it on forward view and using zoom to get to the switches I need. So far tests have been good.

 

In reading this thread I noticed that there are standards that DCS uses. Like iPlaneGearDown is 431. Is there a list of all the standards somehwere? I have the gear ones and flap ones thanks to this thread but would love to learn all the other things that are already built in.


Edited by roiegat

Coder - Oculus Rift Guy - Court Jester

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 weeks later...
  • ED Team

Thanks for the plugin tutorial,

 

managed to make a little theme plugin for our squadron :)

 

 

attachment.php?attachmentid=74763&stc=1&d=1355314669

 

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

  • 2 weeks later...

I do not know if any updates just caused this issue but for some reason I have now lost all external animations with my Wunderluft aircraft.

If I kill the "test" line item out of the devices .lua the cockpit now disappears and the animations work.

I add that line item in and then the cockpit returns and the animations do not work.

The only external animation that still works is the canopy draw.

They all do still work in the modelveiwer however which is very strange.

I also just reloaded a fresh Wunderluft with no editing at all and the same issue now exists.

I know when using a fresh copy this issue did not exist before.

Any ideas?

I am updated to the 2.2.2 and it had worked in the past few weeks ago.

Not very happy here....

Link to comment
Share on other sites

  • 2 weeks later...
Link to comment
Share on other sites

  • ED Team

Suspension block for External FM API

 

it is initialization part in your config files

 

suspension = 
{
{
	mass  			  = 200,
	pos   			  = {1,0,0},
	moment_of_inertia = {1000,1000,1000},
	
	
	damage_element	    = 83,
	damage_omega	    = 30.0,
	state_angle_0	    =  6.131341662,
	state_angle_1	    = -2.995164152,
	mount_pivot_x	    = -0.274,
	mount_pivot_y	    = -0.118,
	mount_post_radius   = 0.657,
	mount_length	   	= 0.604555117,
	mount_angle_1	   	= -3.138548523,
	post_length	   		= 1.748,
	wheel_axle_offset 	= 0.05,
	self_attitude	    = false,
	yaw_limit		    = math.rad(89.0),
	damper_coeff	    = 30.0,
	

	amortizer_min_length					= 0.0,
	amortizer_max_length					= 0.397,
	amortizer_basic_length					= 0.397,
	amortizer_spring_force_factor			= 1.6e+13,
	amortizer_spring_force_factor_rate		= 20.0,
	amortizer_static_force					= 80000.0,
	amortizer_reduce_length					= 0.377,
	amortizer_direct_damper_force_factor	= 45000.0,
	amortizer_back_damper_force_factor		= 15000.0,


	wheel_radius				   = 0.308,
	wheel_static_friction_factor  = 0.65 ,
	wheel_side_friction_factor    = 0.65 ,
	wheel_roll_friction_factor    = 0.025,
	wheel_glide_friction_factor   = 0.28 ,
	wheel_damage_force_factor     = 250.0,
	wheel_damage_speed			   = 150.0,


	 wheel_moment_of_inertia   = 3.6, --wheel moi as rotation body

	 wheel_brake_moment_max = 15000.0, -- maximum value of braking moment  , N*m 
	
	--[[
	args_post	  = {0,3,5};
	args_amortizer = {1,4,6};
	args_wheel	  = {76,77,77};
	args_wheel_yaw = {2,-1,-1};
	--]]

	arg_post			  = 0,
	arg_amortizer		  = 1,
	arg_wheel_rotation    = 76,
	arg_wheel_yaw		  = 2,
	collision_shell_name  = "WHEEL_F",
},
{
	mass  			  = 200,
	pos   			  = {0,0,-1},
	moment_of_inertia = {1000,1000,1000},
	
	
	damage_element	    = 83,
	damage_omega	    = 30.0,
	state_angle_0	    =  6.131341662,
	state_angle_1	    = -2.995164152,
	mount_pivot_x	    = -0.274,
	mount_pivot_y	    = -0.118,
	mount_post_radius   = 0.657,
	mount_length	   	= 0.604555117,
	mount_angle_1	   	= -3.138548523,
	post_length	   		= 1.748,
	wheel_axle_offset 	= 0.05,
	self_attitude	    = false,
	yaw_limit		    = math.rad(89.0),
	damper_coeff	    = 30.0,
	

	amortizer_min_length					= 0.0,
	amortizer_max_length					= 0.397,
	amortizer_basic_length					= 0.397,
	amortizer_spring_force_factor			= 1.6e+13,
	amortizer_spring_force_factor_rate		= 20.0,
	amortizer_static_force					= 80000.0,
	amortizer_reduce_length					= 0.377,
	amortizer_direct_damper_force_factor	= 45000.0,
	amortizer_back_damper_force_factor		= 15000.0,


	wheel_radius				   = 0.308,
	wheel_static_friction_factor  = 0.65 ,
	wheel_side_friction_factor    = 0.65 ,
	wheel_roll_friction_factor    = 0.025,
	wheel_glide_friction_factor   = 0.28 ,
	wheel_damage_force_factor     = 250.0,
	wheel_damage_speed			   = 150.0,
	 wheel_moment_of_inertia   = 3.6, --wheel moi as rotation body

	 wheel_brake_moment_max = 15000.0, -- maximum value of braking moment  , N*m 
	
	--[[
	args_post	  = {0,3,5};
	args_amortizer = {1,4,6};
	args_wheel	  = {76,77,77};
	args_wheel_yaw = {2,-1,-1};
	--]]

	arg_post			  = 3,
	arg_amortizer		  = 4,
	arg_wheel_rotation    = 77,
	arg_wheel_yaw		  = -1,
	collision_shell_name  = "WHEEL_L",
},
{
	mass  			  = 200,
	pos   			  = {0,0,1},
	moment_of_inertia = {1000,1000,1000},
	
	
	damage_element	    = 83,
	damage_omega	    = 30.0,
	state_angle_0	    =  6.131341662,
	state_angle_1	    = -2.995164152,
	mount_pivot_x	    = -0.274,
	mount_pivot_y	    = -0.118,
	mount_post_radius   = 0.657,
	mount_length	   	= 0.604555117,
	mount_angle_1	   	= -3.138548523,
	post_length	   		= 1.748,
	wheel_axle_offset 	= 0.05,
	self_attitude	    = false,
	yaw_limit		    = math.rad(89.0),
	damper_coeff	    = 30.0,
	

	amortizer_min_length					= 0.0,
	amortizer_max_length					= 0.397,
	amortizer_basic_length					= 0.397,
	amortizer_spring_force_factor			= 1.6e+13,
	amortizer_spring_force_factor_rate		= 20.0,
	amortizer_static_force					= 80000.0,
	amortizer_reduce_length					= 0.377,
	amortizer_direct_damper_force_factor	= 45000.0,
	amortizer_back_damper_force_factor		= 15000.0,


	wheel_radius				   = 0.308,
	wheel_static_friction_factor  = 0.65 ,
	wheel_side_friction_factor    = 0.65 ,
	wheel_roll_friction_factor    = 0.025,
	wheel_glide_friction_factor   = 0.28 ,
	wheel_damage_force_factor     = 250.0,
	wheel_damage_speed			   = 150.0,
	 wheel_moment_of_inertia   = 3.6, --wheel moi as rotation body

	 wheel_brake_moment_max = 15000.0, -- maximum value of braking moment  , N*m 
	
	--[[
	args_post	  = {0,3,5};
	args_amortizer = {1,4,6};
	args_wheel	  = {76,77,77};
	args_wheel_yaw = {2,-1,-1};
	--]]

	arg_post			  = 5,
	arg_amortizer		  = 6,
	arg_wheel_rotation    = 77,
	arg_wheel_yaw		  = -1,
	collision_shell_name  = "WHEEL_R",
},
}



local FM = {  self_ID, 
            'dll_name' ,
             center_of_mass = {0,0,0}, -- center of mass initial coordinates in coordinates of model 
             moment_of_inertia = {3000,40000,25000} ,-- initial MOI values
                 
             config_path  = current_mod_path..'/Wunderluft.lua', -- "path to file which you will use to configure you FM",
      suspension   = suspension, -- gear posts initialization
}

make_flyable('Wunderluft',current_mod_path..'/Cockpit/',FM,current_mod_path..'/comm.lua') -- AFM


Edited by Alex O'kean
sigpic2354_5.gif
Link to comment
Share on other sites

  • ED Team
Some issues:

-Can be in the future add Brake and Tire temperature? (to degraded friction, fire and tire explosion)

-Can simulate runway condition with affect to the wheel friction over runway?

 

Brake temperatures condition is completely on your side of modeling , i.e. returned brake moment from your model should changes with temperature. , runway conditions , we have them in some way , so it our side

sigpic2354_5.gif
Link to comment
Share on other sites

So I guess I can post this here now:

 

 

Can anyone provide any description or units for any of these items in the suspension? Many of them are understandable, but without seeing the equations behind the suspension code, understanding these inputs is almost impossible.

 

{

mass = 200,

pos = {0,0,1},

moment_of_inertia = {1000,1000,1000},

 

 

damage_element = 83,

damage_omega = 30.0,

state_angle_0 = 6.131341662,

state_angle_1 = -2.995164152,

mount_pivot_x = -0.274,

mount_pivot_y = -0.118,

mount_post_radius = 0.657,

mount_length = 0.604555117,

mount_angle_1 = -3.138548523,

post_length = 1.748,

wheel_axle_offset = 0.05,

self_attitude = false,

yaw_limit = math.rad(89.0),

damper_coeff = 30.0,

 

 

amortizer_min_length = 0.0,

amortizer_max_length = 0.397,

amortizer_basic_length = 0.397,

amortizer_spring_force_factor = 1.6e+13,

amortizer_spring_force_factor_rate = 20.0,

amortizer_static_force = 80000.0,

amortizer_reduce_length = 0.377,

amortizer_direct_damper_force_factor = 45000.0,

amortizer_back_damper_force_factor = 15000.0,

 

 

wheel_radius = 0.308,

wheel_static_friction_factor = 0.65 ,

wheel_side_friction_factor = 0.65 ,

wheel_roll_friction_factor = 0.025,

wheel_glide_friction_factor = 0.28 ,

wheel_damage_force_factor = 250.0,

wheel_damage_speed = 150.0,

 

 

arg_post = 5,

arg_amortizer = 6,

arg_wheel_rotation = 77,

arg_wheel_yaw = -1,

collision_shell_name = "WHEEL_R",

},

 

 

Here is what I understand so far:

 

{

mass = 200, -- (kg) Is this the mass of the wheel and strut?

pos = {0,0,1}, -- (m) Is this the location where the tire impacts the runway or the location of the strut mount point?

moment_of_inertia = {1000,1000,1000}, -- (kg-m^2) Is this the moment of inertia of the strut and wheel in the down position? Not sure what the coordinate system here is.

 

 

damage_element = 83, -- (Damage Cells #) From Aircraft.lua

damage_omega = 30.0, -- (deg?) What is this? RUSSIAN COMMENT: порог скорости заклинивания при ударе об ограничитель вращения

state_angle_0 = 6.131341662, -- (deg?) What is this? RUSSIAN COMMENT: конструктивный угол убранной стойки к горизонтальной плоскости самолета

state_angle_1 = -2.995164152, -- (deg?) What is this? RUSSIAN COMMENT: конструктивный угол выпущенной стойки к вертикальной оси самолета

mount_pivot_x = -0.274, -- (m) Strut mount x location where it pivots in animation? RUSSIAN COMMENT: точка крепления привода к фюзеляжу в СК стойки

mount_pivot_y = -0.118, -- (m) Strut mount y location where it pivots in animation?

mount_post_radius = 0.657, -- (m) What is this? RUSSIAN COMMENT: расстояние от оси стойки до точки крепления привода к стойке

mount_length = 0.604555117, -- (m) What is the difference between this and the post_radius? RUSSIAN COMMENT: длина подкоса (привода в убранном положении)

mount_angle_1 = -3.138548523, -- (deg?) What is this? RUSSIAN COMMENT: модуль радиус-вектора точки крепления

post_length = 1.748, -- (m) Strut length? RUSSIAN COMMENT: расстояние от оси вращения стойки до оси колеса

wheel_axle_offset = 0.05, -- (m) What is this? RUSSIAN COMMENT: вынос оси колеса отн. оси стойки

self_attitude = false, -- Does this determines whether the wheel rotates freely without control? RUSSIAN COMMENT: true - свободноориентирующаяся стойка

yaw_limit = math.rad(89.0), -- (deg->rad) Max yaw rotation angle?

damper_coeff = 30.0, -- (unitless) Suspension total damper coefficient or just tire damper coeff? (higher number results in the suspension taking more punishment before rebounding

 

 

amortizer_min_length = 0.0, -- (m) Not sure why you need to define zero? RUSSIAN COMMENT: Минимальная длина пружины / минимальной длине амортизатора

amortizer_max_length = 0.397, -- (m) Uncompressed suspension length? Distance the gear hangs down on suspension with no weight on wheels. RUSSIAN COMMENT: Максимальная длина пружины / максимальной длине амортизатора

amortizer_basic_length = 0.397, -- (m) Not sure why we are defining length again? RUSSIAN COMMENT: Длина пружины в свободном состоянии / к длине амортизатора в свободном состоянии

amortizer_spring_force_factor = 1.6e+13, -- (??) What is this? RUSSIAN COMMENT: Коэффициент упругости пружины

amortizer_spring_force_factor_rate = 20.0, -- (??) What is this? RUSSIAN COMMENT: Степень

amortizer_static_force = 80000.0, -- (N?) What is this? RUSSIAN COMMENT: Статическая сила реакции амортизатора

amortizer_reduce_length = 0.377, -- (m) I think this is the total suspension compression distance. RUSSIAN COMMENT: Cвободный (ненагруженный) ход штока амортизатора

amortizer_direct_damper_force_factor = 45000.0, -- (??) What is this? RUSSIAN COMMENT: Дэмпфер прямого хода

amortizer_back_damper_force_factor = 15000.0, -- (??) What is this? RUSSIAN COMMENT: Дэмпфер обратного хода

 

 

wheel_radius = 0.308, -- (m) Tire radius

wheel_static_friction_factor = 0.65 , -- (unitless) Static friction factor.. pretty standard number RUSSIAN COMMENT: коэффициент трения колеса в состоянии покоя

wheel_side_friction_factor = 0.65 , -- (unitless) Static friction factor for the side of the tire RUSSIAN COMMENT: коэффициент бокового трения колеса при движении

wheel_roll_friction_factor = 0.025, -- (unitless) Rolling friction factor.. pretty standard number RUSSIAN COMMENT: коэффициент трения качения колеса

wheel_glide_friction_factor = 0.28 , -- (unitless) Wheel sliding friction factor RUSSIAN COMMENT: коэффициент трения скольжения колеса

wheel_damage_force_factor = 250.0, -- (??) What is this? RUSSIAN COMMENT: коэффициент прочности покрышки колеса

wheel_damage_speed = 150.0, -- (m/s) Speed at which the wheel will take damage RUSSIAN COMMENT: скорость разрушения покрышки колеса

wheel_brake_moment_max = 15000, -- (N-m) Braking moment torque RUSSIAN COMMENT: Максимальный тормозной момент

wheel_moment_of_inertia = 3.6, -- (kg-m^2) Is this the moment of inertia of the strut and wheel in the down position? Not sure what the coordinate system here is.

 

 

arg_post = 5, -- (Arg#) for gear down/up animation

arg_amortizer = 6, -- (Arg#) for suspension compression

arg_wheel_rotation = 77, -- (Arg#) for wheel rolling rotation

arg_wheel_yaw = -1, -- (Arg#) for wheel yaw rotation. I'm guessing -1 means the wheel has no yaw rotation

collision_shell_name = "WHEEL_R", -- Name of collision shell in the model

},

Link to comment
Share on other sites

  • Recently Browsing   0 members

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