Code Monkey home page Code Monkey logo

Comments (4)

rp- avatar rp- commented on September 2, 2024

Of course this can be done, but I'm absolutly lacking the time to do it for you.
But my best advice would be to copy the lua export script and to change it to export a JSON file.
Another way would be to use python reflection to get the data out of the the python module, but a bit more python knowledge is needed for that.

from dcs.

RobotSpaceBear avatar RobotSpaceBear commented on September 2, 2024

Thank you for taking the time to reply :)
I've been looking into reflection but like you said, some extra python knowledge is required and I'm still at the part where I forget to str() the stuff I try to print and I get errors, so we're not there yet.

I'll try to modify the script then, to make it output JSON instead. What do I have to do to make the script run? Just put the .lua file in DCS's saved games folder and it'll automatically be picked up by dcs and executed on startup or do I have to register it somewhere? How do I trigger the export/execution of the script?

Again, thnk you for taking the time, I really appreciate it.

from dcs.

rp- avatar rp- commented on September 2, 2024

it is somewhat documented in the header of the script:

-- execute(dofile) this script at the end of
-- of 'DCS World\MissionEditor\modules\me_mission.lua'
-- base.dofile("C:\\Users\\peint\\Documents\\dcs\\tools\\pydcs_export.lua")

Then you just start dcs and the script will run, if you have an error in your code DCS will get stuck on startup and
the error can usually be found in the dcs log .txt file (somewhere in the Saved Games/DCS) folder.

It is pretty cumbersome this way, because always restarting DCS takes some time, but I didn't find another way yet.

from dcs.

RobotSpaceBear avatar RobotSpaceBear commented on September 2, 2024

Oh thank you for explaining it how it works, I didn't understand if èxecute(dofile)` was something I had to do or if the comment was telling me it is what it does already. Now i get it. I'll look into it when I can. Thank you.

from dcs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.