Jump to content

Problem with WIP mod after updating dcs to 2.5..


Recommended Posts

Hoping someone might be able to help shed a little light on this, WIP Meteor was working fine until i updated to dcs 2.55 and even though i installed the latest edm tools and re exported the .EDM's dcs fails to load at all now?

I was wondering if there were any other known issues with mods as a result of updating to 2.55.

 

Thanks :joystick:


Edited by J900
Link to comment
Share on other sites

Other things i have noticed so far are model is rotated wrong way with no option to set it as before in export options so scenes will need rotating and landing gear is now up when should be down so that will also have to be changed..hopefully future sim updates wont affect things so much...:cry:

Link to comment
Share on other sites

Try this

 

local gear_state = 1
local gear_weight = sensor_data:getWOW_LeftMainLandingGear()

if gear_weight ~= 0 then
  gear_state = 1
else
  gear_state = 0
end

 

Should incorporate a simple check of if you are on the ground or not and will set it to the correct position by default.

Link to comment
Share on other sites

This code seemed to work well before updating, will give that a try..

 

dofile(LockOn_Options.script_path.."command_defs.lua")
dofile(LockOn_Options.script_path.."devices.lua")

local gear_system = GetSelf()
local dev = GetSelf()

local update_time_step = 0.01
local sensor_data = get_base_data()

make_default_activity(update_time_step)

local GEAR_COMMAND = 0
local GEAR_STATE = 0
local Gear = 68 --internal DCS ID
local GearElem = 3001 -- clickable pointer element ID

local GEAR_TIME_IN = update_time_step / 5 -- 5 reps sec.
local GEAR_TIME_OUT = update_time_step / 3 -- 3 reps sec.
local GEAR_TIME_PARAM = update_time_step / 2 -- 2 reps sec.
local GEAR_WEIGHT = sensor_data:getWOW_LeftMainLandingGear() -- checks if gear suspension is in place, needed for ground check

dev:listen_command(Gear)

function SetCommand(command,value)
local wowml = sensor_data.getWOW_LeftMainLandingGear()
  if wowml > 0 then
     if command == Gear or GearElem then
if (GEAR_COMMAND == 0) then
  GEAR_COMMAND = 1
else
  GEAR_COMMAND = 0
end
 end   
	
end
 if command == Gear or GearElem then
if (GEAR_COMMAND == 0) then
  GEAR_COMMAND = 1
else
  GEAR_COMMAND = 0
end
 end
end

function update()
 if (GEAR_COMMAND == 1 and GEAR_STATE > 0) then	
   GEAR_STATE = GEAR_STATE - GEAR_TIME_IN
 end
 
 if (GEAR_COMMAND == 0 and GEAR_STATE < 1) then 
   GEAR_STATE = GEAR_STATE + GEAR_TIME_OUT
 end
 
 set_aircraft_draw_argument_value(0, GEAR_STATE)
 set_aircraft_draw_argument_value(3, GEAR_STATE)
 set_aircraft_draw_argument_value(5, GEAR_STATE)
end

need_to_be_closed = false 

Link to comment
Share on other sites

Try using this code:

 

dofile(LockOn_Options.script_path.."command_defs.lua")
dofile(LockOn_Options.script_path.."devices.lua")

local gear_system = GetSelf()
local dev = GetSelf()

local update_time_step = 0.01
local sensor_data = get_base_data()

make_default_activity(update_time_step)

local GEAR_COMMAND = 0
local GEAR_STATE = 0
local Gear = 68 --internal DCS ID
local GearElem = 3001 -- clickable pointer element ID

local GEAR_TIME_IN = update_time_step / 5 -- 5 reps sec.
local GEAR_TIME_OUT = update_time_step / 3 -- 3 reps sec.
local GEAR_TIME_PARAM = update_time_step / 2 -- 2 reps sec.
local GEAR_WEIGHT = sensor_data:getWOW_LeftMainLandingGear() -- checks if gear suspension is in place, needed for ground check

dev:listen_command(Gear)

function post_initialize()
 if GEAR_WEIGHT > 0 then
   GEAR_STATE = 1
 else
   GEAR_STATE = 0
 end

 set_aircraft_draw_argument_value(0, GEAR_STATE)
 set_aircraft_draw_argument_value(3, GEAR_STATE)
 set_aircraft_draw_argument_value(5, GEAR_STATE)
end

function SetCommand(command,value)
 if GEAR_WEIGHT == 0 then
   if command == Gear or GearElem then
     if GEAR_COMMAND == 0 then
       GEAR_COMMAND = 1
     else
       GEAR_COMMAND = 0
     end
   end
 end
end

function update()
 if GEAR_WEIGHT == 0 then
   if (GEAR_COMMAND == 1 and GEAR_STATE > 0) then	
     GEAR_STATE = GEAR_STATE - GEAR_TIME_IN
   end
   
   if (GEAR_COMMAND == 0 and GEAR_STATE < 1) then 
     GEAR_STATE = GEAR_STATE + GEAR_TIME_OUT
   end
 end
 
 set_aircraft_draw_argument_value(0, GEAR_STATE)
 set_aircraft_draw_argument_value(3, GEAR_STATE)
 set_aircraft_draw_argument_value(5, GEAR_STATE)
end

need_to_be_closed = false

 

This code will utilize the post_initialize() function more to determine before the mission starts where the gear is supposed to start. In your SetCommand() function, your code had indention block issues and I believe you forgot to close the function. (that or one of the IF statements) You were also checking in your SetCommand() for the gears to be able to move as long as gear weight was on, meaning only if you were on the ground. Hope this helps! :)

Link to comment
Share on other sites

Ahh that makes more sense, strange as still has issue with gear where gear is actually up but extends straight away without input. Tried changing the GEAR_STATE values around for post initialize function and even removed the GEAR_STATE = 1 value altogether but seems unaffected..

One thing i did notice was that when the gear state values were swapped around the gear was already in down position when air starting as opposed to lowering, can't seem to get the gear to stay in although once it has initially lowered it does function perfectly up and down afterwards ...:helpsmilie:

 

Regards


Edited by J900
Link to comment
Share on other sites

  • Recently Browsing   0 members

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