Jump to content

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


FSFIan

Recommended Posts

If this is intended to increase the rate of players on voice com, I'm afraid that members of the subset of players that takes the extra step to install the mod also belongs to the subset of engaged players who is on teamspeak already anyways... :(

 

Otherwise, I agree, that'd be a nifty feature.

 

 

Also: Cheers Ian!

 

 

Also, a good addition would be to have a voice communication server which gets connected to automatically when you join the server, something like the IVC in Falcon.

But, this is of course, wishful thinking :)

Link to comment
Share on other sites

Just to pass on the news that I've experimented with this and

  • vehicles work fine as per Bushmanni's example mission. Generally because the waypoint route is hand built bridges seem less of an issue than normal but I did notice that there were still issues at rare times. Seems to be a sweet spot on length of the vehicle column at work and less than 9 appears to be a good number for bridges. Mind you I was trying to test with a mixed composition column. So 6-8 tanks with one or two air defence vehicles and a command unit. It may work better if things were done at a team level for something like this so 2 columns of 3-4 tanks and a column of 1-2 Air defence and a Hq vehicle rather than one big one.
  • Ships are a bit tricky but do work. However I found that I needed to attach the script as a triggered action rather than a waypoint action for some reason.
  • Aircraft work as a waypoint action or as a triggered action. If using the waypoint version you need to plot the initial few waypoints (ie take off and waypoint 1 will do) and put the waypoint action on the last plotted waypoint. However it doesn't seem to work if the template planes route began on the ground and you put the waypoint action on the take off waypoint of the actual mission unit - gives an error re accessing a nil global variable or table. Almost like it tries to execute the selectRoute function before Mist and route.lua finish loading on the mission start trigger. Anyway if you change things around and make the template plane take off from the runway and fly a route and land somewhere and then make the mission aircraft uncontrolled on the ramp, with no waypoints plotted other than the zero one to put it on the ramp. Put triggered actions of start and selectRoute. Set up a once trigger for something like time more 10 with two AI set tasks to do the actions of start and then select route. When you run the mission the in game aircraft will start up and then randomly select the flight path from the template ones and fly it. However it does not want to land as per the template which is odd and need more testing. I figure spawned in aircraft after mission start could also use this ok or the waypoint version depending on whether they were airstart or not. Haven't tested helos but can't see why they would be too much different.

Just to note that I checked mist.getGroupRoute (which is used by route.lua) and it should work for helos, ships,planes and vehicles I believe - so I think theoretically route.lua could be used to define sea routes, helo resupply routes, cargo and transport aircraft resupply routes as well as vehicle routes.

 

I think I will try to build an example DCG style mission and see how it goes.

Link to comment
Share on other sites

Ground vehicles is definitely the place to start but the others could be good in the future. Sea routes open up the idea of supply convoys and task forces and air routes could be used to create random cap routes or border patrols or air supply routes. Maybe even B17 missions from off map etc towards the end of the year as I understand a community mod team is going to release their AI B17 to the public. Helicopters could do troop insertions and resupply.

Link to comment
Share on other sites

This is definitely what we are aiming for.

 

Our thought is to have a control vehicle in an area that once a ground commander goes into, he has certain options via the F10 menu, like advance forces, retreat etc...

Otherwise it would be done automatically by the script I'm building.

Link to comment
Share on other sites

Lol just learnt two things, one I'm blind and two I didn't notice that route.lua uses mist.ground.buildWP so it is amazing that it works for aircraft and ships. So really need either a version for each unit type eventually or a smarter route.lua that accepts another parameter of type which controls which version of buildWP is used.

Link to comment
Share on other sites

I just tried this out and I'm calling the experiment a big success. Running the node.js server on an little Intel Atom running Ubuntu worked just fine.

 

After stacking humvees I tried to modify the move-unit snippet so I could change altitude with the scroll wheel and drop a humvee from space. I will have to continue tommorrow because I ran out of time and I did not succeed.

 

I'm not a coder but I found the snippets a very helpful introduction to LUA and the DCS mission data structure.

 

Ian, I just wanted to say thanks for sharing this code. I also wonder where you will take this. I know it is a lot of work to anticipate what people might want to do but I hope the lua console server and the map client can be generalised to be the base for many solutions.

Link to comment
Share on other sites

I just tried this out and I'm calling the experiment a big success. Running the node.js server on an little Intel Atom running Ubuntu worked just fine.

Thanks for giving it a try and reporting back. Now I know of three people who got it to run on their own, which means the setup instructions I wrote are complete enough to work for people other than myself.

 

After stacking humvees I tried to modify the move-unit snippet so I could change altitude with the scroll wheel and drop a humvee from space. I will have to continue tommorrow because I ran out of time and I did not succeed.

When you add a ground unit in DCS, you can only specifiy coordinates in a plane. It will cast a ray downwards and place the unit where that ray meets an object or the terrain.

 

 

I'm not a coder but I found the snippets a very helpful introduction to LUA and the DCS mission data structure.

Awesome :thumbup:

(Side project: make a set of Lua templates designed to teach Lua in the context of DCS missions?)

 

I'd like to solve the problem of relatively static, non-replayable missions that get boring once you know where all the targets are.

 

One part of that is getting more people to write Lua scripts, because custom scripting enables more complex and dynamic missions.

 

Another part is to make mission editing faster and less frustrating in any way I can. The lua console does its part by vastly improving the debugging capabilities. The mission editor will concentrate on improved editing features for the tasks that take the most time (and/or generate the most frustration) during mission development and leave everything else to the DCS Mission Editor.

 

Finally, we can make better missions by enabling people to do things that were not possible before, for example:

  • improve on the "save mission" feature that's in my mission planner (make it easier to use, have units resume their routes correctly)
  • Add an interface for ground commanders (i.e. ability to drop smoke within a certain radius of friendly units)
  • Use an external process to do line-of-sight checks against static objects, so ground units cannot see through buildings
  • Add web-based user interfaces to mission scripts

 

I also wonder where you will take this. I know it is a lot of work to anticipate what people might want to do but I hope the lua console server and the map client can be generalised to be the base for many solutions.

 

I plan to build the following modules on top of DCS Witchcraft, starting with the Mission Editor and Mission Planner:

  • Lua Console
  • Mission Editor
  • Mission Planner
  • Ground Commander interface
  • a web-based HSI useable with any aircraft (so you can navigate to arbitrary coordinates in FC3 aircraft)
  • some API to allow mission scripts to define their own user interfaces or actions

My outline of ideas is already long enough to occupy me for several years :)

Once I am satisfied with the core architecture (probably after a few alpha releases), I will actively start looking for contributors.

Link to comment
Share on other sites

Some feedback on the installation. The instructions were good but I still needed to hit Stackoverflow to get it installed on Ubuntu.

 

Specifically there was a problem with having an old version of npm.

 

Solution was found here -> http://stackoverflow.com/questions/12913141/installing-from-npm-fails

 

sudo apt-get purge nodejs npm
Then install from Chris Lea's repo:

sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

 

After that I ran "node server.js" and it worked perfectly.

 

When you add a ground unit in DCS, you can only specifiy coordinates in a plane. It will cast a ray downwards and place the unit where that ray meets an object or the terrain.

 

So I will have to spawn a humvee on top of a plane and then remove the plane. I will try that at some point.

 

Another part is to make mission editing faster and less frustrating in any way I can.

 

Fine tuning placement of things is a killer feature. Is it possible to include statics? If statics can't be spawned could you create a work-around using dummy models for statics and do a lookup on the mission save function. It would be ideal to be able to position every model that is in the editor.

 

Add an interface for ground commanders

 

I bought CA expecting the commander role to be little more fleshed out. The lack of feedback from units under command is something that is odd to me. Just having a simple feedback mechanism to indicate when units are transitioning from tasks and traversing waypoints or changing their ROE would do a lot to make the role more dynamic. A commander should be able to veto or counter-command a unit or group without interrupting flow. Units should radio in - if it is a realistic to do so. ETA feedback on movements and firing delivered via radio would also be better than wondering.

 

A web-based HSI useable with any aircraft (so you can navigate to arbitrary coordinates in FC3 aircraft)

 

Nice. A navigation aid for ground units would be good too.

 

My outline of ideas is already long enough to occupy me for several years

 

I thought the stack of humvees was genius.


Edited by vicx
idea!
Link to comment
Share on other sites

I have overhauled the code to have a solid foundation to build upon.

To anyone who has cloned the repository: sorry for rebasing the master branch, I won't do it again :) The old code has been moved to the "initial-experiments" branch.

 

The new version is now on GitHub.

To move units around, the new process is:

- Start your mission in DCS (make sure to add the 'witchcraft.start(_G)' call first)

- Open the Witchcraft Mission Editor and click "Load Mission from DCS"

- Select the "move units" tool and drag stuff around

- Go back to the "File" menu and select "Save Mission", select the original mission file in the dialog, click "Save"

 

Once you start moving a unit around, the group is respawned in the game without waypoints and set to invisible, so it shouldn't move away or get killed.

 

EDIT: When moving a unit around, make sure not to have your view tied to something in the same group. A good solution is to use the free-roam camera (F11, look around with the mouse, adjust speed with the mouse wheel).

Update: I have made a short walkthrough video


Edited by [FSF]Ian
Link to comment
Share on other sites

  • 2 weeks later...

Hi Ian - I'm struggling to get this to work.

 

I've followed the installer video, and get as far as launching the mission in DCS. The console window shows that DCS connects, but I'm unable to "Load mission from DCS" (nothing appears to happen). Trying to use the Lua Console also results in timeouts.

 

DCS log has the following entry:

 

00268.284 INFO SCRIPTING: witchcraft read error: timeout

00326.963 WARNING LOG: 169 duplicate message(s) skipped.

 

I've tried using the latest versions of Chrome and Internet Explorer. Windows firewall is disabled.

 

Any ideas?

Link to comment
Share on other sites

Hi Ian - I'm struggling to get this to work.

 

I've followed the installer video, and get as far as launching the mission in DCS. The console window shows that DCS connects, but I'm unable to "Load mission from DCS" (nothing appears to happen). Trying to use the Lua Console also results in timeouts.

 

DCS log has the following entry:

 

00268.284 INFO SCRIPTING: witchcraft read error: timeout

00326.963 WARNING LOG: 169 duplicate message(s) skipped.

 

I've tried using the latest versions of Chrome and Internet Explorer. Windows firewall is disabled.

 

Any ideas?

 

 

"witchcraft read error: timeout" is normal (I will remove that message in one of the next releases).

 

Make sure that you pass the global environment to the witchcraft.start function:

 

witchcraft.start(_G)

 

If that part is missing, the TCP connection will be successfully established, but it will error out when you actually try to use it. Even then, the error should appear in DCS.log.

 

Look for "witchcraft.step() failed" in DCS.log. If that does not appear anywhere, I am out of ideas.

Link to comment
Share on other sites

I've attached the full log, and the test mission I'm using for you to take a look at

 

Your mission is fine, it works on my end.

Your log is identical to what I get except for expected differences (connected flight controllers, path to user directory, random seed) and these lines which seem to have nothing to do with the scripting engine:

 

 

00018.522 ERROR DXRENDERER: DXRenderer::SetRenderTarget(posteffecttarget1, 0), Unknown

00018.522 ERROR DXRENDERER: DXRenderer::SetRenderTarget(posteffecttarget5, 0), Unknown

00018.522 ERROR DXRENDERER: DXRenderer::SetRenderTarget(posteffecttarget12, 0), Unknown

 

 

00236.605 ERROR DXRENDERER: DXRenderer::SetRenderTarget(light.rend, 0), Unknown

00236.868 ERROR DXRENDERER: StretchRect:, D3DERR_INVALIDCALL

00236.868 ERROR DXRENDERER: DXRenderer::SetRenderTarget(posteffecttarget5, 0), Unknown

00236.870 ERROR DXRENDERER: DXRenderer::SetRenderTarget(posteffecttarget12, 0), Unknown

 

 

 

 

Sorry, I can't reproduce it here and I am out of ideas :(

Link to comment
Share on other sites

I have pushed a small update to GitHub that allows you to move static objects around.

Not tested much yet, but it seems to work in general.

 

When moving a FARP, you will not get a live preview in game, but it will appear in its new position if you save the mission and load it in DCS again. This should allow you to move a FARP to places where the mission editor refuses to place it.

  • Like 1
Link to comment
Share on other sites

Thanks for the update Ian. It works well for statics and fortifications.

 

Agreed! I was able to move static objects and fortification without any issues. This is incredible stuff Ian!! Thank you very much for releasing this code, this really will help with mission building and the setting up of complex bases.

 

Btw, setting up and getting started was very simple. Your video made clear sense of what to do and I was up within minutes. :thumbup:

 

Thank you,

~ LA

 

[sIGPIC]sigpic89379_1.gif[/sIGPIC]

 

Intel Core Haswell i5-4670K OC @ 4.2GHz | Asus Z87-Plus mobo | 16GB DDR3 @ 1600 Ram | Nvidia GeForce GTX 1070 OC w/ 8GB memory | Oculus Rift w/ Touch Controllers | 256GB Samsung 840 Pro SSD | Thrustmaster MFD Cougar pack | Thrustmaster HOTAS WARTHOG |Saitek Pro Flight Rudder Pedals | TrackIR 4 C‬lip | Helios

 

Black Knights Squadron Member

Link to comment
Share on other sites

Really good stuff Ian, your video is really helpful and clear.

I have it working however I'm finding my units don't move when in game when I move them on the browser.

I am only using one monitor as I dont have a second one to use and I just window mode DCS.

Any thoughts on what I'm doing wrong?

Link to comment
Share on other sites

Really good stuff Ian, your video is really helpful and clear.

I have it working however I'm finding my units don't move when in game when I move them on the browser.

I am only using one monitor as I dont have a second one to use and I just window mode DCS.

Any thoughts on what I'm doing wrong?

 

Are you sure that your version of MiST is up-to-date? Make sure you use the huge download link for version 3.3 (or later), don't use the file attached to the thread (that is v1.1).

 

A squadmate had the same problem: the outdated MiST version is enough to make the "Load mission from DCS" button work, but lacks the functions used to respawn the group when it is moved.

 

Using one monitor with DCS in windowed mode works fine.

Link to comment
Share on other sites

:wallbash: I got 1.1 not realising they were different and that the Big blue text was a link.

That fixed it thanks. Are you able to move FARPs?

Also a point to make for those who find internet connections a pain....this does work offline after the time opening the witchcraft file. (This wasn't entirely clear to me so I thought it might be worth mentioning.)

Cheers

Link to comment
Share on other sites

That fixed it thanks. Are you able to move FARPs?

Cheers

 

Quoting my previous post here:

 

When moving a FARP, you will not get a live preview in game, but it will appear in its new position if you save the mission and load it in DCS again. This should allow you to move a FARP to places where the mission editor refuses to place it.
Link to comment
Share on other sites

  • 1 month later...

Hi guys, I'm new to DCS and after a couple days, I tried to make randomized missions for it.

 

I played Lowengrin's Il2DCG a lot and years ago I made a dynamic campaign for Operation Flashpoint and later Arma.

 

A search for a similar thing in DCS led me here. It's really good that this tool is in the making. I'm offering my help in the works towards a dynamic campaign.

I have some experience in Java and JS, but I'm not a guru by far. I'd mostly like to help in the area of those highly randomized missions someone mentioned earlier.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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