Jump to content

Scripting Usage


Recommended Posts

As the developer of Skynet I would very much like an up to date API documentation of the scripting engine published and maintained by ED.

 

Right now the best resource is:

https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation

 

Oftentimes the information there is not up to date and it feels strange having to visit a community site for documentation of the DCS scripting engine.

 

I think it would also be beneficial if script developers that work on a project that is used by the community get access to ED developers to learn where the engine is heading and what API changes may be on the horizon so they can adapt their scripts ahead of a new release.

 

This could be a public forum which everyone could read but only certain people would be allowed to post. On the other hand script developers would need to meet certain standards to be added to this forum (clean architecture, version control, good documentation, continued development, (unit tests? ;-) ). So ED would know they are not wasting time answering basic questions on this subforum. Regular Q&A calls would also be great.

 

On the other hand this would allow ED to feature well made scripts in a documentation guideline for people getting in to the mission editor. I guess that would reflect well on DCS as product. Right now it's the wild west if you want to get started with mission building. I opened the mission editor for the fist time in January and spent a lot of time scraping the forum and the hoggit page for info on the scripting engine that would allow me to build Skynet.

 

oh and a debugger with breakpoints would be great!


Edited by tigair
  • Like 4
Link to comment
Share on other sites

Script Function: ATIS - ATIS for div Airports

Script Tool: MOOSE

Notes: not included in DCS

 

Script Function: RAT - Random Airtraffic

Script Tool: MOOSE

Notes: not included in DCS

 

Script Function: Airboss - for recovery tanker and rescue helo

Script Tool: MOOSE

Notes: not included in DCS

 

Script Function: ATC_Ground - speed control on taxiways

Script Tool: MOOSE

Notes: not included in DCS

 

Script Function: FAC - you can call Airstrikes with an A-10 on a position you mark with Smoke rockets

Script Tool: MIST

Notes: not included in DCS

Link to comment
Share on other sites

Script Function: Spawning air and ground targets in sandbox MP

 

Script Tool: MOOSE

 

Notes: allows me to respawn the same late activated template repeatedly. Vanilla ME would require many late activated groups to be built and spawned only once each, leading to a limited number of spawns and complicated ME triggers and flags.

 

 

 

Script Function: allow statics to act as placeholders in airbase parking slots to be replaced when player spawns in (SWAPR script)

 

Script Tool: MOOSE

 

Notes: Functionality doesn’t exist in vanilla ME.


Edited by Sandman1330

Ryzen 7 5800X3D / Asus Crosshair VI Hero X370 / Corsair H110i / Sapphire Nitro+ 6800XT / 32Gb G.Skill TridentZ 3200 / Samsung 980 Pro M.2 / Virpil Warbrd base + VFX and TM grips / Virpil CM3 Throttle / Saitek Pro Combat pedals / Reverb G2

Link to comment
Share on other sites

Script Tool: Skynet IADS

It makes SEAD to be actual SEAD and not DEAD. Dramatically improves gameplay and complexity. It makes the SAMs to hide their positions, shut down their radar when being shot at with HARMs, create a much more realistic AIDS systems with nodes, power plants etc. A SUPERB script and a MAJOR MUST HAVE add-on for DCS

Link to comment
Share on other sites

Script Function: Dynamic (re)spawning and tasking of groups taking various parameters into account (like player count, groups in polygone-zones, state of other groups, ...); Communication with external APIs (to e.g. persist statistics); persist mission state between mission runs; Simulating groups/units that are not actually on the map (until certain criteria are met - example: anti-submarine warfare scenarios).

Script Tool: I mostly write Lua modules (in Rust) that communicate with the mission environment via RPC calls (either via TCP or by directly polling the Lua module for RPC requests)

Notes: Having a compiled program improves my change-feedback loop since I have to restart DCS / the mission less often and the compiler saves me from a lot of simple mistakes that would otherwise require a time consuming try-and-error loop. It also allows me to easily spawn other threads and move some tasks out of the scripting thread.

 

Since this approach is probably not a common one, I still see an intersection with a lot of other tools out there: an RPC interface to the mission environment

Author of Scratchpad, DATIS, and maintainer of DCS-gRPC.

Link to comment
Share on other sites

Script Function: Dynamic (re)spawning and tasking of groups taking various parameters into account (like player count, groups in polygone-zones, state of other groups, ...); Communication with external APIs (to e.g. persist statistics); persist mission state between mission runs; Simulating groups/units that are not actually on the map (until certain criteria are met - example: anti-submarine warfare scenarios).

Script Tool: I mostly write Lua modules (in Rust) that communicate with the mission environment via RPC calls (either via TCP or by directly polling the Lua module for RPC requests)

Notes: Having a compiled program improves my change-feedback loop since I have to restart DCS / the mission less often and the compiler saves me from a lot of simple mistakes that would otherwise require a time consuming try-and-error loop. It also allows me to easily spawn other threads and move some tasks out of the scripting thread.

 

Since this approach is probably not a common one, I still see an intersection with a lot of other tools out there: an RPC interface to the mission environment

 

 

I would love to know how you write your lua modules in rust :)

Link to comment
Share on other sites

I have used some MIST, MOOSE but would like to see some additional API functions added. Unfortunately I can only remember one as it has been something I've talked to others about recently which is:

- get coordinates from TGP location.

 

 

Will come back and add more if I can remember other things I wished there was API functions for.

Link to comment
Share on other sites

Script Function: Check presence of certain number of units of several types or groups within a zone. Check is done in varying intervals (20 seconds for ground units, less for airborne units).

Script Tool: MIST

Notes: not included in DCS

Link to comment
Share on other sites

Script Function: Template Spawning, tracking, client scoring, tasking && zone management

Script Tool: Exclusively MOOSE

 

Notes: MOOSE is extremely well documented and provides far more options than the ME for designing missions. I solely use the ME for placing unit templates and zones, everything else is done via MOOSE. The missions we run on our community server will go for 13hrs, if there was a working garbage/wreckage collection, i'd be using that as well !!


Edited by Tonmeister
Link to comment
Share on other sites

  • 1 month later...

There are already many option/filter tools relative to terrain/surface, helping to spawn surface units on acceptable spots (land, road, water etc... used for exemple with MIST functions like isTerrainValid, terrainHeightDiff for topography,...). It would also be helpfull to be able to filter areas with Forests, and Cities.

  • Like 1
Link to comment
Share on other sites

Hello folks of ED. Second post, this is the data from MOOSE's Github on what people are looking at specifically when they look for scripts to copy https://github.com/FlightControl-Master/MOOSE_MISSIONS/graphs/traffic . I can only get last months data, but it broadly fits with how I see the traffic and questions incoming:

 

Views/unique visitors Class Description

 

39/14 AI_A2A_Dispatcher: This class provides an automated AI CAP and GCI combined response (on one or both coalitions). Just like legacy GCICAP scripts

 

36/16 RAT: Random Air Traffic (does what you would expect)

 

27/15 Airboss: Airboss does ATC for carriers, manages carrier movement, scoring etc.

 

23/15 Spawn: This class manages spawning and repeat spawning and randomisaiton of AI objects entering the game

 

23/8 Event: Events are just the Games Event Handlers, not very different.

 

I would have guessed the top one, it seems to occupy peoples constant requests. Having Aircraft spawning automatically and heading for a CAP station or a scrambled fighter based on a radar detection is one of the scripting staples for many years.

 

RAT, slightly surprised me. It's always been popular and is fairly mature now. People use it for filling the skies, especially with CAM and MAM modifications which are very popular. It really only serves to decorate empty skies, but has been more popular than I expected.

 

Airboss is slightly newer but still over a year old. It's quite an immense project that manages a multiplayer carrier, turns it into the wind during specified recovery windows, handles a pseudo-ATC with voice acting from LSO and Marshall, gives both coaching and scoring and saves to disk. People have even got this running right into their Discord to announce their traps using community features (Hypeman)

 

Both SPAWN and EVENT classes are staples of scripting and SPAWN is an interesting class, unlike the MIST methods and direct SSE methods, all you need is one short line and a late activated group in the mission. This did away with long complex tables and is probably the single most needed element of most scripting - making something 'appear'. The bread and butter example would be: Tank 'dead' event --> spawn tank again. Respawn and scheduled spawning are also popular.

 

If I had to pick other popular classes we have seen a lot of usage from the fairly new "ATIS" class which provides tunable talking weather reports (in various different accents!), RANGE which counts bullets on a target and scores bombing and strafing and from then on it gets more complex.

 

Hope that helps. If anyone wants a more detailed list of functionality without reaidng the MOOSE online documentation https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/index.html I'd be delighted to talk abotu what we see people use it for. Again, I also use Mist for CTLD and Ciribobs slot blocker, absolutely cannot live without those, but I know more about Moose.

hitperclass.png.4f91bf82a3a83944bab4f60799d328c7.png

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

I think, the thing to remember here are the different levels of script usage. You have the mission maker (like moi), who use systems/frameworks as everybody previously has mentioned, to make life easier and accomplish relatively complex tasks with ease.

The other side are the more advanced mission makers, framework designers and people who have a good concept of .lua or whatever. They can produce advanced missions and frameworks for others to use.

 

As much as i would like a "module" type system in the editor, for controlling carriers, IADs, Tankers etc. At this point i think i would like to echo a couple of others in here.

 

1. Please focus on SP/MP compatibility and getting a solid base to work from, where you dont have use workarounds for stuff that doesnt function in MP.

 

2. Rather than putting effort into new systems to replicate what we already have with MOOSE/MIST etc. Work with these guys, find out what limitations in the engine are being highlighted by using these frameworks and collaberate on deeper issues or new api's etc to help.

 

3. This is tricky i suppose because who do you invite, but potentially a monthly or every couple of months have a meeting/chat whatever. Where community members/framework designers with a good understanding of what is currently lacking, can discuss what is needed directly with ED coders. Rather than through the forum process, often being ignored or plain just not seen, because of the amount of threads there are already.

 

 

(I guess this could be achieved, like has been mentioned, rather than a meeting, having a forum section that can be used for this purpose, only allowing "verified" contributors and ed staff to post, but allow everyone to read.

 

 

 

Again as a lowly mission maker with no real talent other than copy pasting. I would love in built editor options for complex tasks. But at this point, i would lean towards a more stable base and features which have been highlighted as needed by these framework designers / scripting freaks tongue.gif. By all means in the future, lets get all this stuff added to the editor, but for now lets get everyone on the same page.

 

 

Help them help us.


Edited by Shadow.D.
Link to comment
Share on other sites

Script Function: Spawn - Respawn air-ground units

Script Tool: MOOSE Spawn

Notes: better, simpler and straightforward to implement than what is in DCS

 

Script Function: Looping Air Trafic

Script Tool: MOOSE RAT

Notes: better, simpler and straightforward to implement than what is in DCS

 

Script Function: Range function: count rounds on target, gives bomb impact point distance from target

Script Tool: MOOSE Range

Notes: not available in DCS

 

Script Function: Have a recovery tanker flying a pattern over a moving carrier

Script Tool: MOOSE RecoveryTanker

Notes: better, simpler and straightforward to implement than what is in DCS

 

Script Function: Have a rescue helo flying next to a moving carrier

Script Tool: MOOSE RescueHelo

Notes: better, simpler and straightforward to implement than what is in DCS

 

Script Function: Event handler to monitor/detect different events and trigger functions

Script Tool: MOOSE Event

Notes: better, simple and more extensive than what is in DCS

 

Script Function: Respawn air-ground units

Script Tool: MIST Respawn

Notes: better, simpler and straightforward to implement than what is in DCS

 

Script Function: Cargo/troops transport for helos, ability to build/deploy units to the field

Script Tool: CTLD (Requires MIST)

Notes: better, simpler and straightforward to implement than what is in DCS, some features not available in DCS

 

Script Function: JTAC autolase

Script Tool: CTLD (Requires MIST)

Notes: Simpler and straightforward to use (less real though) than what is in DCS

 

Script Function: Have static planes placed in defined slots while client slot are not used (populates airfields with cold planes)

Script Tool: SWAPR (Requires MIST)

Notes: not available in DCS

 

Script Function: Give helos Search&Rescue missions

Script Tool: CSAR (Requires MIST)

Notes: not available in DCS

 

Script Function: Give players easy to read Early Warning Radar readings of enemy planes

Script Tool: EWRS (Requires MIST)

Notes: not available in DCS (simple text output)

 

Script Function: Way to block client slots during missions (using flag settings)

Script Tool: SSB (Simple Slot Block)

Notes: not available in DCS

 

Script Function: Auto-kick auto-ban feature for teamkillers, many server administrative tools

Script Tool: SLmod

Notes: not available in DCS

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

@NineLine I prefer to use the DCS API directly but the documentation is absolutely awful. I think it would go a long way to helping people use the scripting engine if the documentation was better.

Also, a way to provide feedback on API gaps would also be handy. I know there is a bunch of stuff I would like to add in to help streamline a bunch of clucky methods MIST, MOOSE etc have to use to get particular pieces of information out of the game engine.

  • Like 1

CPU: i9-12900K @ 4.9Ghz

M/B: MSI MEG z690 Ace

RAM: 128GB

Video Card: MSI RTX 4090 Suprim Liquid X

VR: Varjo Aero

Link to comment
Share on other sites

On 6/30/2020 at 9:55 PM, NineLine said:

So the Mission Editor polls have done well, some fixes and such are coming through, some are still to come.

 

In the same sense, I would like to ask people that use outside scripting to post here what they are using, what tool they are using MIST, MOOSE, CTLD, etc. And why they are using it.

 

Just a brief description, so as an example:

 

Script Function: What you are adding to the mission

Script Tool: MIST, MOOSE, CTLD, etc

Notes: Why you use it, not included in DCS, better than what is in DCS, etc

 

The purpose of this is to gauge what people are needing to support their missions outside of DCS, and what we can do to better support Mission Builders, MP servers, Scripting Tool creators, etc

 

Thanks all!

 

As always, please keep on topic, and skip any rants or complaints, just stick to the above, if needed, someone can add a discussion thread to support this.

I'm learning scripting but just using the DCS Scripting Engine and not any 3rd party framework, however the documentation and list of functions is no where near complete and we're missing things that are there. 

I'm using it to make more dynamic and realistic missions but continually coming up against roadblocks either with the documentation missing known functions or gaps in features, functionality or information.

I use Visual Studio Code to write the scripts. 

  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

many great scripts here and i'm on many as great adds to mission design. i use mist as root script for simplicity and speed, besides grimes available as great tutor all the time, and did split rest on modular level for testing purposes.

making efficient script backend with graphical frontend is really big endeavor in DCS with lack of so many helpful tools/scripts that have to be searched for hard on net all dating back one decade in creation. luckily DCS evolves well but still not as fast as I expected.

what i'm most concerned is the map overload and performance optimization since DCS is stuck on 2/1 cores. populating map is easy but placing things when are needed and were are needed is on another level besides effective intel feedback on player.

DCS needs all this extra coding to make it alive and truly satisfying experience as benchmark standard of (MP) mission dynamics in sim arena is already set high back in days of FL4. I'd like to see DCS beyond that level in next years.

Tnx to all script creators and contributors as without your support and passion DCS would lack in many key features that you provided. god bless you.


Edited by jackmckay
  • Like 1
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
  • Recently Browsing   0 members

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