Jump to content

[ANN] Web-based Lua debug console for DCS: World missions


FSFIan

Recommended Posts

  • 2 months later...

Hi Ian!

 

I watched your tutorial video and did everything step by step. Everything is OK until loading mission from DCS. In Command Prompt I have status DCS Connected but when I click or double-click Load Mission from DCS in the Witchcraft interface, nothing happens.

 

:helpsmilie:

Link to comment
Share on other sites

I am using it, and I have set the trigger like you said. In which folder on my HD should I put Mistv3_3.lua (does it matter)? In Mist guide I read about some rare bug when using DO SCRIPT FILE trigger action (Page 7, Note #1).


Edited by Mrgud
Link to comment
Share on other sites

Are we able to test trigger logic with this? For example move a unit into a trigger or zone and see if the trigger fires/code runs? I see that you are respawning the unit again, but I dont know if this effects the way trigger conditions behave.

 

Are we able to see if radio transmission, message to all/group/etc are working? For example can I move the ai closer to their route wp and see if the actions are triggered?

 

Being able to support and view the logic in real time would make it extremely easy to sort out any code and logic issues in game, which usually requires playing the mission from start to finish.

 

Any news about this?

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

Link to comment
Share on other sites

Are we able to test trigger logic with this? For example move a unit into a trigger or zone and see if the trigger fires/code runs? I see that you are respawning the unit again, but I dont know if this effects the way trigger conditions behave.

 

Are we able to see if radio transmission, message to all/group/etc are working? For example can I move the ai closer to their route wp and see if the actions are triggered?

I see no reason why moving a unit (which respawns it with the same name) would affect trigger logic. I didn't test this though, because I am not a mission designer myself.

 

Unfortunately the "live unit view" stuff is broken after the witchcraft rewrite, so you won't be able to use the web-based map to track the unit positions; you will have to use the in-game map for that.

 

Being able to support and view the logic in real time would make it extremely easy to sort out any code and logic issues in game, which usually requires playing the mission from start to finish.

 

Any news about this?

 

In the Lua Console, you can use trigger.action.getUserFlag and trigger.action.setUserFlag (see ED docs) to look at and change flag values.

 

If you want to test code snippets that require e.g. a position value, play around with the "Lua Interaction" mode in the "Mission Editor" view (have it open in a separate tab).

 

You can use the Lua Console to attach event handlers written in Lua to mouse events on the Mission Editor map. These event handlers will have access to the position that was clicked on the map.

Link to comment
Share on other sites

Ian;2276908']Anything in dcs.log?

Also, can you use the Lua Console? Try to enter something like "return 42", press Ctrl+Enter and see if you get a result back.

 

Also try "return mist.majorVersion" and "return mist.minorVersion". If those don't work, we know that MiST is not set up correctly.

 

Hi Ian!

 

Last few days I didn't have any time for DCS. Lua scripting is beyond my skills so if you can explain basically what I need to do to test if everything is set up correctly.

 

For beginning: how can I open Lua Console?

 

If it is to much work to explain to programming rookie, don't bother. I have found some on-line tutorials about Lua scripting but I really have no time and interest in mastering programming languages.

Link to comment
Share on other sites

When I enter return 42 in Lua Console, nothing happens as long as the mission in DCS is running. When I exit the mission, I get result : number 42

 

I attached my dcs.log if it is of any use to you.

 

I'm using Chrome but I can try with different browser.

 

dcs.rar

Link to comment
Share on other sites

I have tried using Internet Explorer but when I typed localhost:3000 I got message:

 

The webpage cannot be displayed

 

Most likely cause:

•Some content or files on this webpage require a program that you don't have installed.

 

Do you have any idea what should be installed because I don't use Internet Explorer at all?

 

If the answer is negative, the only thing left is to reinstall DCS some day and try to setup the whole thing again.

 

Thanks for help anyway! ;)

Link to comment
Share on other sites

Ian:

 

great stuff, thank you. Installation worked flawlessly based on your instructions.

 

I know nothing of Lua as yet nor of the mysterious world of objects and functions that DCS exports (but Witchcraft has definitely whetted my appetite!)

 

In your tutorial video, you show an object dumping method from the Lua Wiki. I wonder whether building that right into the Witchcraft Lua console could be quite useful:

 

For example, you could have a (witchcraft) function wdir() which not only dumps back out text to the console, but could include inline buttons for subobjects/array elements/functions, which when pressed would dump sub-objects (perhaps in a new snippet or "in place").

I don't know whether Lua provides you back enough introspection meta information to tell whether a given symbol is a function, an object, an array etc. since obviously the output would be formatted differently for each.

 

That would allow exported object exploration even for people with zero Lua experience.

One could just start with return wdir(_G) and drill down as desired

 

-----

 

My personal interest is to see whether I could export some things at runtime to a kneeboard app running in a browser on an iPad while the mission is proceeding. (Via your witchcraft nodejs server naturally, but with a custom polling javascript client)

 

For example:

- player aircraft location (lat/lon/alt/hdg/speed)

- mission briefing text/images (ha!)

- any scripted mission prompts as they come up

- any kills, or other DCS notifications ("Player X landed at Anapa" etc.)

 

I have no idea whether the mission runtime allows this type of info to be sucked out at runtime. Do you ? But if it does, this should be technically feasible and I'd give it a go.

 

 

In any case, intriguing work, thank you !

Working on an open source "kneeboard" app (browser based, so runs everywhere) for DCS world: maps, checklists, reference, glossary, calculators.

Link to comment
Share on other sites

In your tutorial video, you show an object dumping method from the Lua Wiki. I wonder whether building that right into the Witchcraft Lua console could be quite useful:

 

For example, you could have a (witchcraft) function wdir() which not only dumps back out text to the console, but could include inline buttons for subobjects/array elements/functions, which when pressed would dump sub-objects (perhaps in a new snippet or "in place").

I don't know whether Lua provides you back enough introspection meta information to tell whether a given symbol is a function, an object, an array etc. since obviously the output would be formatted differently for each.

 

That would allow exported object exploration even for people with zero Lua experience.

One could just start with return wdir(_G) and drill down as desired

 

That could be built, but I won't spend the time to do it (pull requests are of course welcome).

 

Using mist.utils.tableShow() is good enough IMO (although it's not interactive -- if you want to dump _G, prepare to wait half a minute for the answer).

 

My personal interest is to see whether I could export some things at runtime to a kneeboard app running in a browser on an iPad while the mission is proceeding. (Via your witchcraft nodejs server naturally, but with a custom polling javascript client)

 

For example:

- player aircraft location (lat/lon/alt/hdg/speed)

- mission briefing text/images (ha!)

- any scripted mission prompts as they come up

- any kills, or other DCS notifications ("Player X landed at Anapa" etc.)

 

I have no idea whether the mission runtime allows this type of info to be sucked out at runtime. Do you ? But if it does, this should be technically feasible and I'd give it a go.

 

Location of units: available from mission script (you may need to figure out which one is the player aircraft)

Briefing text: available from mission script

Briefing images: assuming the node.js server has access to the .miz file, it can get them from there (if it knows which mission is running)

Prompts and notifications: possibly available from server.lua (you'd have to modify server.lua and the node.js script to add another communication channel)

 

If you want to focus on the current player aircraft, DCS-BIOS can be another source of information (think interactive checklists). Your web app either needs the ability to open a TCP or UDP socket (running as a Chrome extension, using node-webkit, etc) or you need another application in between to bridge from raw TCP to Websockets or HTTP long polling.

 

We should talk on TeamSpeak.

 

After writing the web-based mission planner, dcs-httpd, DCS Witchcraft and now DCS-BIOS I think I have gained a good overview of what information is available within the different Lua environments (Mission Scripting, Export.lua, server.lua) and how to make them talk to each other and to external applications.

 

Unfortunately, many of my experiments never made it past the proof-of-concept stage -- one reason was lack of time, the other was that I have zero experience with writing more complex web applications.

 

My timezone is GMT+1, but I am a student with a relatively flexible schedule. Just PM me a time that would suit you and I can probably meet you then.

Link to comment
Share on other sites

Ian -

 

thanks for the detailed reply. I am just starting to scratch the surface, so I did not know about DCS-BIOS yet. Wow, you are a prolific coder ! It looks very useful indeed. As you mentioned the CommonData section of DCS-BIOS (Alt/Heading/Position) will likely answer my first point.

 

Let me read up a bit more and experiment with DCS-BIOS then I can be a more informed Gesprächspartner on TeamSpeak :) !

Working on an open source "kneeboard" app (browser based, so runs everywhere) for DCS world: maps, checklists, reference, glossary, calculators.

Link to comment
Share on other sites

Ian --

Thank you for making Witchcraft!

 

It installed easily this past weekend. I have a new mission to work out and your tool has really helped to lay down the various objects onto the terrain. I thought this was going to save me some time, but instead I ended up making more elaborate scenes than intended. :)

 

Blue Aircraft Assembly Plant --

attachment.php?attachmentid=111703&stc=1&d=1421725350

 

Red Rocket Factory --

attachment.php?attachmentid=111704&stc=1&d=1421725350

 

---

 

I'll offer an improvement to make -- when Saving a mission the program asks for a mission name to extract from -- make that mission name available for the save name instead of 'mission.miz'. I'd like to have that original mission name in a 'Save' dialog box so I can change the revision of the mission name before I save it.

 

WC

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

An observation -- some of the units that I have moved and rotated will show up ok in the mission.miz file, but they are missing the Heading value in the Mission Editor.

 

WC

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • 4 weeks later...

The units that show Heading = zero can be units within a group where the other units do show the proper heading that they were rotated to.

 

I will prolly do some Witchcraft placements tonight on a new mission. Next time I see this, I'll post the miz.

 

 

FYI, Ian, I got the LUA Console to work. Great stuff.

 

WC

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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