Jump to content

DCS Mods structure : How to create your plugin from scratch


Alex Okean
 Share

Recommended Posts

  • Replies 487
  • Created
  • Last Reply

Top Posters In This Topic

Thanks!

Out of curiosity, do you know in which files is it located?

Speaking about the su-27, it has the ability to head tracking and slave to the missiles, can be setup also for other aircraft? Is it a setting in the plane object?

 

 

Sent from my Nexus 4 using Tapatalk

IAF.101_Phantom, 101 squadron XO, Preflight Community Manager

[sIGPIC][/sIGPIC]

watch your six, i'm behind you

-----

Mods: IAF_Weapons: Python 3 and 4

https://www.digitalcombatsimulator.com/en/files/2835842/

Link to comment
Share on other sites

Thanks!

Out of curiosity, do you know in which files is it located?

If you're talking about the name of the missile that you want appearing on the HUD, then it's in your userName attribute.

Speaking about the su-27, it has the ability to head tracking and slave to the missiles, can be setup also for other aircraft? Is it a setting in the plane object?

As far as I know, it's linked to the SU-27, meaning it's in the SU-27 code.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Alright, I'm back with another issue. I'm creating a gun like this :

 

function m60c(tbl)

tbl.category = CAT_GUN_MOUNT 
tbl.name 	 = "m60c"
tbl.supply 	 = 
{
	shells = {"7_62x51"},
	--shells = {"M61_20_HE"},
	--shells = {"M2_50_aero_AP","M20_50_aero_APIT"},
	--mixes  = {{1,2,2,1,2,2}}, --  
	count  = 500,
}
if tbl.mixes then 
   tbl.supply.mixes =  tbl.mixes
   tbl.mixes	    = nil
end
tbl.gun = 
{
	max_burst_length = 500,
	rates 			 = {600},
	recoil_coeff 	 = 0.01,
	barrels_count 	 = 1,
}
if tbl.rates then 
   tbl.gun.rates    =  tbl.rates
   tbl.rates	    = nil
end	
tbl.ejector_pos 			= tbl.ejector_pos or {0, 0, 0}
tbl.ejector_pos_connector	= tbl.ejector_pos_connector 		 or  "Gun_point"
tbl.ejector_dir 			= {-6, -2, 0}
tbl.supply_position  		= tbl.supply_position   or {0.121,  -0.48, 0}
tbl.aft_gun_mount 			= false
tbl.effective_fire_distance = 1500
tbl.drop_cartridge 			= 205	
tbl.muzzle_pos				= tbl.muzzle_pos 		 or  {0,0,0} -- all position from connector
tbl.muzzle_pos_connector	= tbl.muzzle_pos_connector 		 or  "Gun_point" -- all position from connector
tbl.azimuth_initial 		= tbl.azimuth_initial    or 0   
tbl.elevation_initial 		= tbl.elevation_initial  or 0   
if  tbl.effects == nil then
	tbl.effects = {{ name = "FireEffect"     , arg 		 = tbl.effect_arg_number or 436 },
				   { name = "HeatEffectExt"  , shot_heat = 7.823, barrel_k = 0.462 * 2.7, body_k = 0.462 * 14.3 },
				   { name = "SmokeEffect"}}
end
return declare_weapon(tbl)
end

 

It all works just fine, except for the recoil_coeff. Any time I fire, the recoil is so huge that it causes my aircraft to stall in a few rounds!

 

I tried changing the value to something big, to something small, to something in between, it's always way too much recoil for the caliber.

 

Do you guys have any ideas on how to fix that ?

Link to comment
Share on other sites

  • 1 month later...

anyone know the command or option in pod/loadout declaration to enable spinner animation based on speed?

 

i have 3 pods, that have spinners on them, I'd like to animate them to spin above a certain speed if possible, or simply when AC is moving.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

Hello gentlemen ...

I present my problem.

I inserted a new plane ... I do not care that it is controllable for now.

The thing that interests me is that it carries out its task.

It is a tanker, but I have not found anywhere lua dedicated.

 

below will place the code that I'm using... In red specific for tanker ... the problem is that the AI in flight, and clients do not perform refueling.

 

-mounting 3d model paths and texture paths 
mount_vfs_model_path (current_mod_path.."/Shapes")
mount_vfs_liveries_path (current_mod_path.."/Liveries")
mount_vfs_texture_path  (current_mod_path.."/Textures/Avionics")
mount_vfs_texture_path  (current_mod_path.."/Textures/KC-767A.zip")
mount_vfs_texture_path  (current_mod_path.."/Textures")

KC767A =  {
       
Name     =   'KC-767A',
DisplayName   = _('KC-767A'),

HumanCockpit   = true,
HumanCockpitPath    = current_mod_path..'/Cockpit/',

Picture    = current_mod_path..'/Textures/KC-767A.png',
Rate     = 40, -- RewardPoint in Multiplayer
Shape     = "KC-767A",

shape_table_data  = 
{
 {
  file    = 'KC-767A';
  life    = 18; -- lifebar
  vis     = 3; -- visibility gain.
  desrt    = 'KC-767A'; -- Name of destroyed object file name
  fire    = { 300, 2}; -- Fire on the ground after destoyed: 300sec 2m
  username = 'KC-767A';
  index    =  WSTYPE_PLACEHOLDER;
 },
 {
  name  = "KC-767A";
  file  = "KC-767A";
  fire  = { 240, 2};
 },
[color=red] },
mapclasskey   = "P0091000064",
attribute     = {wsType_Air, wsType_Airplane, wsType_Cruiser, KC_767A,"Tankers",},
Categories    = {"{8A302789-A55D-4897-B647-66493FA6826F}", "Tanker",},[/color]
ViewSettings = {
Cockpit = {
[1] = {-- player slot 1
 CockpitLocalPoint      = {16.2,1.0,0.000000},
 CameraViewAngleLimits  = {20.000000,120.000000},
 CameraAngleRestriction = {true,50.000000,0.400000},
 CameraAngleLimits      = {80.000000,-75.000000,90.000000},
 EyePoint               = {0.000000,2.000000,0.000000},
 limits_6DOF            = {x = {-0.050000,0.450000},y ={-0.200000,0.200000},z = {-0.220000,0.220000},roll = 90.000000},
},
}, -- Cockpit 
Chase = {
 LocalPoint      = {4.259000,3.819000,0.000000},
 AnglesDefault   = {180.000000,-8.000000},
}, -- Chase 
Arcade = {
 LocalPoint      = {-12.041000,6.419000,0.000000},
 AnglesDefault   = {0.000000,-8.000000},
}, -- Arcade 
}, 
-------------------------
 M_empty = 25000,
 M_nominal = 30000,
 M_max = 55000,
 M_fuel_max = 30000,
 H_max = 12200,
 average_fuel_consumption = 0.2,
 CAS_min = 42,
 V_opt = 236,
 V_take_off = 77,
 V_land = 70,
 has_afteburner = false,
 has_speedbrake = false,
 main_gear_pos =  {-0.724, -2.55, 2.157},
 radar_can_see_ground = false,
 nose_gear_pos =  {6.546, -2.55, 0},
 AOA_take_off = 0.15,
 stores_number = 0,
 bank_angle_max = 54,
 Ny_min = 0.5,
 Ny_max = 2.5,
 tand_gear_max = 0.577,
 V_max_sea_level = 180,
 V_max_h = 250,
[color=red]tanker_type = 1, 2,
 is_tanker   =   true,
 air_refuel_receptacle_pos = {0, 0, 0},
[/color]wing_area = 283,
 wing_span = 47.5,
 thrust_sum_max = 300000,
 thrust_sum_ab = 300000,
 Vy_max = 9,
 length = 48.51,
 height = 15.85,
 flaps_maneuver = 0.5,
 Mach_max = 0.86,
 range = 12200,
 crew_size = 3,
 RCS = 50,
 Ny_max_e = 3.4,
 detection_range_max = 60,
 IR_emission_coeff = 0.5,
 IR_emission_coeff_ab = 0,
 engines_count = 2,
 --wing_tip_pos =  {-0.295, 0.765, 17.521},
 wing_tip_pos =  {-11.295, 1.987, 20.8},
 nose_gear_wheel_diameter = 0.72,
 main_gear_wheel_diameter = 1.1,
 engines_nozzles = 
 {
  [1] = 
  {
   pos =  {-2.039, -1.113, 8.55},
   elevation = 0,
   diameter = 1.523,
   exhaust_length_ab = 11.794,
   exhaust_length_ab_K = 0.76,
   smokiness_level     =  0.05,
  }, -- end of [1]
  [2] = 
  {
   pos =  {-2.039, -1.113, -8.55},
   elevation = 0,
   diameter = 1.523,
   exhaust_length_ab = 11.794,
   exhaust_length_ab_K = 0.76,
   smokiness_level     =  0.05,
  }, -- end of [2]
  [3] = 
  {
   pos =  {-5.039, -0.613, -15.2},
   elevation = 0,
   diameter = 1.523,
   exhaust_length_ab = 11.794,
   exhaust_length_ab_K = 0.76,
   smokiness_level     =  0.05,
  }, -- end of [3]
  [4] = 
  {
   pos =  {-5.039, -0.613, 15.2},
   elevation = 0,
   diameter = 1.523,
   exhaust_length_ab = 11.794,
   exhaust_length_ab_K = 0.76,
   smokiness_level     =  0.05,
  }, -- end of [4]
 }, -- end of engines_nozzles
crew_size  = 2,
crew_members = 
{
 [1] = 
 {
  ejection_seat_name = 9,
  drop_canopy_name = 20,
  pos =  {3, 0.5, 0},
  canopy_pos = {3, 0.5, 0},
 }, -- end of [1]
  [2] = 
  {
  ejection_seat_name = 9,
  drop_canopy_name = 0,
  pos =  {1.5, 0.75, 0},
  canopy_pos = {3, 0.5, 0},
 }, -- end of [2]
}, -- end of crew_members
  fires_pos = 
 {
  [1] =  {-0.589, 0.7, 0},
  [2] =  {-0.295, 0.7, 8},
  [3] =  {-0.295, 0.7, -8},
  [4] =  {-0.295, 0.7, 4},
  [5] =  {-0.295, 0.7, -4},
  [6] =  {-0.295, 0.7, 6},
  [7] =  {-0.295, 0.7, -6},
  [8] =  {-3.887, 0.801, 1.921},
  [9] =  {-3.887, 0.801, -1.921},
  [10] =  {-6.476, 1.261, 0},
  [11] =  {-6.476, 1.261, 0},
 }, -- end of fires_pos


-- Countermeasures
SingleChargeTotal   = 0,
CMDS_Incrementation  = 0,
ChaffDefault    = 0, 
ChaffChargeSize   = 0,
FlareDefault    = 0, 
FlareChargeSize   = 0,
CMDS_Edit     = false,
chaff_flare_dispenser  = {
 [1] = 
 {
  dir =  {0, 1, 0},
  pos =  {-3.677, 1.012, -0.859},
 }, -- end of [1]
 [2] = 
 {
  dir =  {0, 1, 0},
  pos =  {-3.677, 1.012, 0.859},
 }, -- end of [2]
}, -- end of chaff_flare_dispenser
 --sensors

detection_range_max   = 60,
radar_can_see_ground   = true, -- this should be examined (what is this exactly?)
CanopyGeometry = {
 azimuth   = {-160.0, 160.0}, -- pilot view horizontal (AI)
 elevation = {-50.0, 90.0} -- pilot view vertical (AI)
},
-- Sensors = {
--  RWR = "Abstract RWR", -- RWR type
--  RADAR = "N-019", -- Radar type
-- 
-- },
HumanRadio = {
 frequency = 127.5,  -- Radio Freq
 editable = true,
 minFrequency = 100.000,
 maxFrequency = 156.000,
 modulation = MODULATION_AM
},


 
[color=red]Tasks = {
       aircraft_task(Refueling),
   }, 
DefaultTask = aircraft_task(Refueling),[/color]

 Countries = {"Italy"},
}
add_aircraft(KC767A)

Can anyone help me?

 

THX in advice!

 

 

Not to bring up old topics,

 

But I've hit the same issue,

 

The AI Simply reaches Waypoints and RTBs, and when Player approaches new Tanker,

The tanker is NOT listed in the Radio Menu.

 

So it's likely something with Radios/Comms Missing somewhere.

 

As the new tanker sits in it's orbit pattern. and the waypoint options/settings for the enw tanker vs S-3B Tanker are Identical,

 

Just no radio or interaction is occurring.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

anyone know the command or option in pod/loadout declaration to enable spinner animation based on speed?

 

i have 3 pods, that have spinners on them, I'd like to animate them to spin above a certain speed if possible, or simply when AC is moving.

 

 

Do you want all can see spin anim or just the player who takes the control of that AC?

 

 

Sent from my iPhone using Tapatalk

[sIGPIC][/sIGPIC]

My DCS Mods, Skins, Utilities and Scripts

 

| Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD |

| TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |

Link to comment
Share on other sites

ALL.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

Well, i dont really wanna jury rig, but if I have too...

 

One of the Pods I actually integrated into the base Model of my Aircraft to make use of Tanker Arguments (Hose Deploy/Retract/Slew), and set it up to appear w/ pylon attachment argument, then changed the POD Loadout info to load invisible dummy shape in place of the POD.

 

Since I'm re-doing pylon attachment arguments again w/ more LAUs, I might as well integrate the Other PODs into the base model as well.

 

So I'll prolly just integrate the other 2 models into the base model and toggle them with Pylon Visibility Arg, and then Define Invisible Dummy Shape in the Pod Declaration.

 

That way I can just use engine Spinner to make the them spin.

 

Outside of that, Maybe somehow use Ram Air Turbine properties/animation (I doubt it's a global animation though, and likely linked to a Cockpit system)

 

No other Pod has the Aux Ram Air Generators, so it's up in the air at the moment.

 

Edit: using RATs animation didnt work either, guess its link tonthe engines time.


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

I believe I have a Pretty Good Work around for the spinners animation.

 

Now I just need to figure out why in the new tanker module doesnt show under radios and AI ignores it.

 

My Main Block/Issue right now, is setting up DECAL and DAMAGE Texture Layers.... there's no info on that anywhere.


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

I had the same problem with a tanker I was working on. First problem is that the ai is not reacting on the connectors. So I had to define the coordinates of the refuelling receptacle in code, which really took a while. Then the ai just did not react on the tanker. I tried many options. Nothing worked. In the end I gave up and used the russian tanker as a base and made a mod which transformed it to the victor tanker.

 

Not the best solution, but I guess the tanker functionality is deep coded and won´t work for another plane.

System: Intel Core i5 3570K | GTX 980 OC | 16 GB DDR3 1600 | 500 GB SSD

Link to comment
Share on other sites

I had the same problem with a tanker I was working on. First problem is that the ai is not reacting on the connectors. So I had to define the coordinates of the refuelling receptacle in code, which really took a while. Then the ai just did not react on the tanker. I tried many options. Nothing worked. In the end I gave up and used the russian tanker as a base and made a mod which transformed it to the victor tanker.

 

Not the best solution, but I guess the tanker functionality is deep coded and won´t work for another plane.

 

The one I Scripted shows in Mission Editor and does what it's told to do (orbit and wait. etc)

 

AI Aircraft hit Refuel Waypoint, and peel off to RTB

Human Aircraft get to waypoint, however, every jet I've tried, the Tanker Does not show in the Radio List, of either FC3 of DCS Aircraft.

 

If I Swap My Aircraft w/ Any other tanker (S3, IL, or KC), AI Approach and hook up, Human AC have Tanker In Radio Menu.

 

So Something to do with Radios is missing, the AI are prolly peeling off because they cant contact the tanker.

 

Or there's a Separate LUA that you have to Define Aircraft as Tankers.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

  • 2 weeks later...
The one I Scripted shows in Mission Editor and does what it's told to do (orbit and wait. etc)

 

AI Aircraft hit Refuel Waypoint, and peel off to RTB

Human Aircraft get to waypoint, however, every jet I've tried, the Tanker Does not show in the Radio List, of either FC3 of DCS Aircraft.

 

If I Swap My Aircraft w/ Any other tanker (S3, IL, or KC), AI Approach and hook up, Human AC have Tanker In Radio Menu.

 

So Something to do with Radios is missing, the AI are prolly peeling off because they cant contact the tanker.

 

Or there's a Separate LUA that you have to Define Aircraft as Tankers.

 

If you figure this out, I would love to know. We want to enable buddy refueling for our A-4 mod when the D-704 is equipped.

Link to comment
Share on other sites

Well, i dont really wanna jury rig, but if I have too...

 

One of the Pods I actually integrated into the base Model of my Aircraft to make use of Tanker Arguments (Hose Deploy/Retract/Slew), and set it up to appear w/ pylon attachment argument, then changed the POD Loadout info to load invisible dummy shape in place of the POD.

 

Since I'm re-doing pylon attachment arguments again w/ more LAUs, I might as well integrate the Other PODs into the base model as well.

 

So I'll prolly just integrate the other 2 models into the base model and toggle them with Pylon Visibility Arg, and then Define Invisible Dummy Shape in the Pod Declaration.

 

That way I can just use engine Spinner to make the them spin.

 

Outside of that, Maybe somehow use Ram Air Turbine properties/animation (I doubt it's a global animation though, and likely linked to a Cockpit system)

 

No other Pod has the Aux Ram Air Generators, so it's up in the air at the moment.

 

Edit: using RATs animation didnt work either, guess its link tonthe engines time.

 

I did the same last year...

 

d8eae63b7386.jpg

 

 

Spinner animation works:

 

40

Угол поворота винта

0

1

отображается на [0;360])

Угол поворота винта

 

    net_animation = {
40,
   },

    mapclasskey         = "P0091000064",
   sounderName = "Aircraft/Planes/A-10A",
   attribute = {wsType_Air, wsType_Airplane, wsType_Cruiser, WSTYPE_PLACEHOLDER, "Aux", "Tankers", "Refuelable"},
   Categories= {"{8A302789-A55D-4897-B647-66493FA6826F}", "Tankers",},

But I could not make IFR work.

I would be grateful for any information conducive to the solution of this problem.


Edited by Morkva_55

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I did the same last year...

 

d8eae63b7386.jpg

 

 

Spinner animation works:

 

40

Угол поворота винта

0

1

отображается на [0;360])

Угол поворота винта

 

    net_animation = {
40,
   },

    mapclasskey         = "P0091000064",
   sounderName = "Aircraft/Planes/A-10A",
   attribute = {wsType_Air, wsType_Airplane, wsType_Cruiser, WSTYPE_PLACEHOLDER, "Aux", "Tankers", "Refuelable"},
   Categories= {"{8A302789-A55D-4897-B647-66493FA6826F}", "Tankers",},

But I could not make IFR work.

I would be grateful for any information conducive to the solution of this problem.

 

 

So you're sayin even w/ Engine Types set to jet engines Using Argument 40 will still have a Ram Air Propeller?

 

I havent been able to work on anything since last Thursday due to hardware problem.

 

Including Tanker Troubleshooting, 3D Art, etc.


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

  • 3 weeks later...

Draw Cockpit arguments with lua

 

Hello pilots,

 

i want to modify some cockpit lights of the F-15 cockpit by using lua. With "set_aircraft_draw_argument(x,y)" i can modify already the 3d model of the aircraft, but how to modify cockpit instruments?

 

Is it possible to go via FM_Params?

local fmparams = get_param_handle("FM_Params")

 

I had no success right now. If somebody have an idea, that would be nice! Thanks...

Link to comment
Share on other sites

As far as I am aware, there is no direct LUA function to set cockpit arguments.

 

For just setting a cockpit arg that is not a clickable element, you have to use one of the following:

 

1) EFM function: ed_fm_set_fc3_cockpit_draw_args

2) exported dll function: ed_cockpit_set_draw_argument

3) mainpanel_init.lua gauge definition as parameter type: CreateGauge("parameter")

 

Option 3 is probably the best for your scenario.

 

Example:

 

TEST_PARAM_GAUGE                      = CreateGauge("parameter")
TEST_PARAM_GAUGE.parameter_name       = "TEST"
TEST_PARAM_GAUGE.arg_number           = 113
TEST_PARAM_GAUGE.input                = {0,100} 
TEST_PARAM_GAUGE.output               = {0,1}

Link to comment
Share on other sites

Thanks for your hints, but no success so far.

 

What i did:

 

I created a mainpanel_init.lua

shape_name   	   = "Cockpit_F-15C"

TEST_PARAM_GAUGE      			  = CreateGauge("parameter")
TEST_PARAM_GAUGE.parameter_name   = "TEST_PARAM"
TEST_PARAM_GAUGE.arg_number    	  = 200 --Speedbrake LED in F15
TEST_PARAM_GAUGE.input    		  = {0,100} 
TEST_PARAM_GAUGE.output    		  = {0,1} 

print_message_to_user("Mainpanel init")

need_to_be_closed = true

 

added this line to device_init.lua

MainPanel = {"ccMainPanel",LockOn_Options.script_path.."mainpanel_init.lua"}

 

added a testdevice

local dev 	    = GetSelf()
local my_param  = get_param_handle("TEST_PARAM")
local update_time_step = 1
make_default_activity(update_time_step)

function post_initialize()
print_message_to_user("Test device initalized")
end

function update()
local v = my_param:get()
print_message_to_user(v)
end

 

All the Debug "print_message..." are working, but the value of my_param is always "0" even when the speedbrake LED ist on.

 

Is there something wrong?

Link to comment
Share on other sites

All the Debug "print_message..." are working, but the value of my_param is always "0" even when the speedbrake LED ist on.

 

Is there something wrong?

 

Yes, you can't use parameters to get argument information like you are trying to do. My example was assuming you were trying to SET the argument value. If you want to set the LED:

 

local dev 	    = GetSelf()
local my_param  = get_param_handle("TEST_PARAM")
local update_time_step = 1
make_default_activity(update_time_step)

function post_initialize()
print_message_to_user("Test device initalized")
end

function update()
my_param:set(1) -- Turn the indicator on or off (0) depending on your logic
end

 

Also, you should probably use input = {0,1} for indicator lights for mainpanel, because it is doing an interpolation and if you send a value of 1 for a range 0-100, the output to the indicator would be 0.01.

 

shape_name   	   = "Cockpit_F-15C"

TEST_PARAM_GAUGE      			  = CreateGauge("parameter")
TEST_PARAM_GAUGE.parameter_name   = "TEST_PARAM"
TEST_PARAM_GAUGE.arg_number    	  = 200 --Speedbrake LED in F15
TEST_PARAM_GAUGE.input    		  = {0,1} 
TEST_PARAM_GAUGE.output    		  = {0,1} 

print_message_to_user("Mainpanel init")

need_to_be_closed = true

 

The real problem you are going to have is that ED's code in dll is already setting that indicator argument value, so you won't be able to use it for your own needs, since you will be fighting for control of the argument value with ED's code. If you are just wanting to read the argument value, I'm not sure how to do that in LUA.


Edited by SilentEagle
Link to comment
Share on other sites

load the F-15C Pit EDM attached to a separate module of your own so DLL Systems dont override your scripted ones.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

@SilentEagle, thank you for the hint "input = {0,1}"!

 

Ok, it was already working, but like you guys told me, i can just control Arguments, where are not used. For example, i can toggle the "camera record on" switch, by lua.

 

@SkateZilla, i already use a mod with no F15.dll flight model attached (SFM) based on a existing mod (just for testing) where is using the f15 pit. What exactly do you mean with "seperate module"? I want to take control over all unused but attached Arguments to use LEDs for my own.

For example, the F15 "hook" LED is not used (never switched on), but i want to toggle the led, but cant override the value, because it is attached somewhere else.

 

Thank you for your help so far! If someone have ideas how to do this is very welcome. I'am familiar with c/c++, but never did a dll for DCS, maybe this is possibility?

 

Thank you... :book::joystick:

Link to comment
Share on other sites

Are you using Old = 6 in teh make Flyable Declaration to load the F-15 Systems though?

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

That will load the old F15 Systems, including Cockpit Argument Settings.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill,

X470 Taichi Ultimate, 2x R7970 Lightnings Crossfired @ 1.1/6.0GHz,

3x ASUS VS248HP + Hanns·G HZ201HPB + Oculus HMD,

Thrustmaster Warthog HOTAS + MFDs, CH Fighterstick+Pro Throttle+Pro Pedals

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...