Jump to content
The simFlight Network Forums

Lua


Recommended Posts

Hi

Well i am back working a bit whit Airbus X,

and want to know if it would be posible to create a lua that can read a xml or C++ variable. and how to as i try to install ISG gauges so it is posible to use sid and stars

as the Airbus X is made in MDL files i dont think it is posible to get working that way. as in dokumentation only a xml or C++ variable is provided.

best regards LN

Link to comment
Share on other sites

The Aerosoft AirbusX gauges were encoded using XML, so it should work the same as anything else, regarding LUA variables.

Unfortunately, every time I load it right now, it crashes FSX to desktop, so I can't confirm this at the moment.

Ian P.

Link to comment
Share on other sites

... and want to know if it would be posible to create a lua that can read a xml or C++ variable.

Variables in any program, whether written in C, C++, C#, XML, ASM or whatever can only be seen outside that program if the programmer allows them to be seen, by exporting them in some manner. Within FS, XML gauges can use local named variables which are registered centrally in FS and which can be then accessed by name. These are known as "L:Vars", and FSUIPC provides macro facilities to be able to set them, whilst Lua has both read and write access to them. Please do look up the details of these, in indeed, the gauges are written this way.

The User Contributions subforum also has lots of examples for different aircraft. And I see there is one called

AirbusX - Lua file - GF-MCP Displays

Oh, hold on! That's by you! Now I'm confused. What is the point of your question when you appear to have the answers?

As far as other languages are concerned, there are mechanisms implemented in FSX for any part of it to supply any other part of it with data. For instance, the main sim engine defines variables, also accessible in XML, which are readable and sometimes writable via SimConnect. Those are all defined in the SimConnect SDK. These did mostly exist before SimConnect too, and accessible by name or index to gauges. BUT, and it is a big BUT, add-on gauges do their own thing, and often simply do not use the FS values.

and how to as i try to install ISG gauges so it is posible to use sid and stars

Sorry, I don't know anything about that.

Regards

Pete

Link to comment
Share on other sites

arr think it is mee there is ZzZz now of cause the file for AP is XML then it is just a quistion of where to place it as i dont know but thanks so far

Sorry, I'm completely lost I think.

AP = Autopilot? Part of the aircraft? If it's a gauge then is needs to be loaded via the PANEL.CFG, and that can load it from the panel folder or the gauges folder, or, I think, elsewhere if you put a pathname in. But I wouldn't swear to that last one.

Check the FSX SDK. There are chapters in the guides there about these files.

Pete

Link to comment
Share on other sites

sorry pete what i am tryeing to do is to add another gauge to the the vc and 2d panel and that is done. where the xml file comes in is that it need a server file which hopefuly is placed right, and thise 3 lines to work that is how it was done to the airbus 300 from aerosoft it seems. whit the latest updates of both ISG and airbus 300 (isg_lnav_hdg_set, isg_lnav, isg_server_active) then it is posible to give info to the airbus. it was therefor after i was done whit the Airbus 300 panel i started to se if it was posible to do the same to the airbus X. but only if i could find out of it.

Link to comment
Share on other sites

sorry pete what i am tryeing to do is to add another gauge to the the vc and 2d panel and that is done. where the xml file comes in is that it need a server file which hopefuly is placed right, and thise 3 lines to work that is how it was done to the airbus 300 from aerosoft it seems. whit the latest updates of both ISG and airbus 300 (isg_lnav_hdg_set, isg_lnav, isg_server_active) then it is posible to give info to the airbus. it was therefor after i was done whit the Airbus 300 panel i started to se if it was posible to do the same to the airbus X. but only if i could find out of it.

Ah, sorry, but I'm still none the wiser really. I think there's an aircraft builder or panel beater forum someplace, maybe on AVSIM. Maybe asking there would elicit answers?

Regards

Pete

Link to comment
Share on other sites

Ah, sorry, but I'm still none the wiser really. I think there's an aircraft builder or panel beater forum someplace, maybe on AVSIM. Maybe asking there would elicit answers?

Regards

Pete

Yep was also just to get things right. :-) thx for your grate support and sorry the confusing.

Link to comment
Share on other sites

Hi LN,

When it comes to Lua programming I am always very interested and I recently bought ISG Gauges from Ernie Alston. So I invested some time to integrate these two, probably doing very similar things that you did as well. ISG modifies the A/P HDG which seems to work for all standard aircraft (and that is what the gauges are there fore since you do not need them for proper commercial add ons with FMCs).

AirbusX as usual does everything differently and therefore these heading bug changes do not get through. I tried everything short of reprogramming components.

As it looks to me now there are little options left, either I find the place in the XML gauges where these myriads of HDG Bug controls are fired by the AirbusX AFGS and change it so that external programs get a chance. Or I write some C++ code that uses the server gauge functionality of ISG Gauges to read out the new heading and write it directly into the L: variables of AirbusX XML gauges.

Both options are time-consuming and if I ever find the time it will not be soon. Should I succeed eventually then I will post it here.

Kosta

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.