Jump to content

Recommended Posts

Posted

So in ME you can choose to set up an aircraft to start form the air instead of ramp. But I'm curious as to how or where the code is so you can tell the aircraft what systems should be on or off. Is there a best practice of checking in initial LUA's to see if aircraft is airborne or not?

 

Along with this, is it possible to move a switch, level from one setting to another. For instance, if the plane is staring from the air I would need to make sure the battery, fuel, etc switches are in the on position. Knowing their cockpit arg number is there a command I can use to set them up correctly?

Coder - Oculus Rift Guy - Court Jester

Posted

Yes that part I know. But if you have a custom cockpit for your aircraft that switches will be set in their default position. Just because you start in the air doesn't mean the switches are activated (how would it know which ones to activate).

Coder - Oculus Rift Guy - Court Jester

Posted (edited)

There exists no known location in Lua that I know of that sets what systems are on when the plane is air-started. However, in the export Lua environment, you can get and set aircraft switches/gauges. But that's a lot of work for very little gain- I can't see how it would be worth it just for setting initial switch settings for an air start aircraft.

 

Anyway, I believe the function you would need to use in the export Lua environment is the GetDevice function, but I can't confirm that because I do not have access to my flying computer at this time. I haven't done a lot of work in the export Lua environment, I did just enough to learn its capabilities and limitations and utilize a handful of functions.

Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted
Yes that part I know. But if you have a custom cockpit for your aircraft that switches will be set in their default position. Just because you start in the air doesn't mean the switches are activated (how would it know which ones to activate).

 

fair point.:doh:

 

Come pay us a visit on YouTube - search for HELI SHED

Main Banner.PNG

Posted

You can insert the following into any of your AC system lua side.

 

birth = LockOn_Options.init_conditions.birth_place 

function post_initialize()

   local dev  = GetSelf()

   if birth == "GROUND_HOT" or birth == "AIR_HOT" then
       DC_BUS_V_needle:set(28)
       DC_BUS_battery:set(1)
       dev:performClickableAction(device_commands.Button_1, 1.0); -- battery heat
       dev:performClickableAction(device_commands.Button_2, 1.0); -- battery
       dev:performClickableAction(device_commands.Button_3, 1.0); -- dc gen
   else    
       DC_BUS_V_needle:set(0)
       DC_BUS_battery:set(0)
       dev:performClickableAction(device_commands.Button_1, 0.0); -- battery heat
       dev:performClickableAction(device_commands.Button_2, 0.0); -- battery
       dev:performClickableAction(device_commands.Button_3, 0.0); -- dc gen
   end
end

  • Like 1
Posted

Beczl,

 

Quick question as a follow up. Is there a way to set the throttle level via code? I wan to set it so if you start from AIR_HOT it sets the throttle at 80%

Coder - Oculus Rift Guy - Court Jester

Posted

I think thats where my problem is. I don't have the throttle set up as a clickable device. Just have the cockpit arg tied to the throttle in the mainpanel currently and that's it.

 

I did add the throttle in the clickable devices as a movable axis, but it seems that thrust input and it's input are different. Even though the same arg is being called from the mainpanel and clickable devices. So I might be missing another place to tell it the throttle.

 

Currently if I move the throttle on my joystick I see it move in the cockpit, but it doesn't seem to call up the button in the devices. If I click on it, and drag it - it then activates the button in the device. So something defintly is not in sync here.

 

Will keep looking into it. Thanks for all the help Beczl!

Coder - Oculus Rift Guy - Court Jester

  • Recently Browsing   0 members

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