Coder Social home page Coder Social logo

spencershepard / dcs-witchcraft Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jboecker/dcs-witchcraft

0.0 0.0 0.0 14.83 MB

A debug console for Lua scripts in DCS: World missions and related experiments

License: GNU General Public License v3.0

Shell 0.06% JavaScript 85.44% CSS 0.40% TypeScript 4.02% CoffeeScript 0.52% Python 5.92% C 1.27% Lua 2.39%

dcs-witchcraft's Introduction

dcs-witchcraft

"DCS Witchcraft" is:

  • a node.js server application
  • a Lua script that runs in the DCS: World mission scripting environment and talks to the node.js server via a TCP connection
  • some web applications, including a debug console that allows you to execute Lua snippets inside the running mission and look at the return values

Here's what works so far:

  • Lua debug console for interactive development and debugging of mission scripts
  • Mission Editor to adjust the positions of existing units (mirrored to the running mission so you can watch the final position in the 3D environment)

Watch the video walkthrough to learn more.

Initial Setup

  • Copy witchcraft.lua to %USERPROFILE%\Saved Games\DCS\Scripts\ (e.g. C:\Users\<Your Username>\Saved Games\DCS\Scripts\).
  • Go to your DCS: World installation directory (most likely C:\Program Files\Eagle Dynamics\DCS World), open the Scripts subfolder and edit the file MissionScripting.lua. Add the following code somewhere before the function sanitizeModule is defined:
witchcraft = {}
witchcraft.host = "localhost"
witchcraft.port = 3001
dofile(lfs.writedir()..[[Scripts\witchcraft.lua]])

Preparing the Mission

To start trying to connect to the node.js server, your mission will have to call witchcraft.start(_G).

Create a new trigger set to fire ONCE, create a new condition TIME IS MORE (1 second) and add two actions:

  1. a DO SCRIPT FILE action that loads MIST. Make sure you are using MIST 3.3 or later!
  2. a DO SCRIPT action with the text witchcraft.start(_G)

Using the Debug Console and the Map

  • Start the node.js server. If you are using windows, simply double-click witchcraft.cmd in the windows subfolder of this repository.
  • Start your DCS: World mission and enter a slot (singleplayer) or unpause the server (multiplayer).
  • Point a web browser at http://localhost:3000 (if you used witchcraft.cmd, it automatically did that for you in the first step).

The Lua debug console is mostly self-explanatory. Just play around with it and avoid infinite loops (those will understandably cause DCS to hang).

If you want the map to display the live positions of ground units, you have to tell witchcraft that it should send regular unit updates (select the "enable unit updates" template in the Lua Console and press Ctrl+Enter to execute it). The map is in an early stage and is currently hard-coded to only show units of the blue coalition.

License

The project itself is licensed under the GPLv3 or later. For third-party components (node.js and npm modules, the map icons, anything under src/bower_components and src/vendor_js), the licensing information can be found in the respective subdirectories or in the source file itself.

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.