Jump to content

Enhanced Gamemaster Script: Zeus, but for DCS


CakeSorbus

Recommended Posts

Hi folks,

 

I want to share with you a script that I wrote for my virtual squadron.

 

It enhances the way that players in the gamemaster role, that has been introduced with Combined Arms, can influence a mission while it runs.

My inspiration was the Zeus system that exists in ARMA III and I have managed to carry some of its functions over into DCS.

 

By use of map markers as an input method players can perform the following actions while the mission is already up and running:

  • Spawn any group included in your mission whereever you want, as often as you want
  • Spawn copies of existing static units wherever you want
  • Delete units
  • Assign waypoints/orbits/escort tasks to the AI
  • Turn the AI of units on and off
  • Have planes land on specific airbases (sadly they currently cant be ordered to take off again)
  • Have helos land at a map marker and take off again
  • Load groups into cargo carriers (planes/helos/vehicles) and unload them again
  • Toggle immortality/invisibility of groups
  • Interact with players by shooting flares, placing smoke, sending messages, playing sounds and triggering explosions
  • Set flag values
  • Return coordinates of map markers in a format that can be copied and pasted
  • Call external Lua functions and pass up to five arguments
  • Create and delete markings (textfields, lines, arrows, circles, rectangles and polygons) on the F10 map
  • Toggle TACAN beacons for capable units
  • Create homing beacons (ADF/VHF/FM) and trigger radio transmissions

 

Further features include:

  • Access to commands can be restricted to certain coalitions or by a password system
  • Configurable template file that contains (almost) every unit available in DCS and many pre-made groups for different scenarios
  • Modular script structure that easily allows the addition of your own code

 

There are some additional functions and features that are missing from this list.

For complete documentation and a guide on how to use the script in missons, check out the attached manual.

 

I have uploaded the script to the user files, you can download it here!

 

The script creates it's own global table for all functions and variables. It should work fine in combination with other scripts such as CTLD and CSAR. Note that MOOSE is required as a prerequisite (included in the download).

 

I want to take a moment here and thank everyone over at MOOSE for putting together the awesome framework, upon which more than half of the functions I wrote into my script rely.

 

I have no programming background at all (I'm a forester, actually) so some bugs have to be expected. If you find something that doesn't work at all, or not as described in the documentation, I'd be thankful if you could post it as a reply to this thread.

 

**Changelog**

 

2020/09/11 - Gamemaster_Functions v. 2.0.1

Added an option in the config section of the script, you can now change what symbol or string the script looks for when extracting commands and parameters from the marker text.

 

2020/10/18 - Gamemaster_Functions v. 2.1

  • New Commands:
    • -ctldgr -> allows you to spawn CTLD infantry groups at the location of the map marker (contribution by fargo007)
    • -ctldcr -> allows you to spawn CTLD crates at the location of the map marker (contribution by fargo007)
    • -sta -> spawn a new static at the location of the map marker (needs a static of the same type to be placed somewhere on the map)
    • -? -> returns unit name and group name of the object closest to the map marker
  • Changes to existing commands:
    • -s -> ground units spawned with the -cargo parameter will now be recognized by the CTLD script and can be loaded into cargo carriers through the radio menu options that CTLD provides. The option to load them with the -board command remains unaffected by this change
    • -exp -> a delay before the explosion can now be set.
    • -smoke -> a duration for the smoke to remain active can now be set
  • General changes:
    • Switched to v. 2.5.1 of MOOSE - moose.lua in the download archive has been updated

 

2020/10/18 - Gamemaster_Templates v. 1.0.1

  • Group template for sa11 medium strength was missing its 2nd launcher - fixed
 

2021/03/19 - Gamemaster_Templates v. 2.0

  • Complete refactoring, script now works with global variables
  • Added config section at the top of the script file
  • Rearranged templates into smaller sub-tables that can be flagged for loading individually in new config section of the script
  • Added templates for newly added units since last script update

 

2021/05/02 - Gamemaster_Functions v. 2.2

  • Refactored script from local scale into a global table that contains all variables and functions
  • Switched to v. 2.5.3 of MOOSE
  • New config option GMFunc.PW allows you to set up a password that must be entered before each command
  • New Commands:
    • -fol - Order a group of aircraft to follow another, position in which to follow can be specified
    • -coord - Returns the coordinates of the map marker used to send the command, in a new map marker
    • -func - Calls an external Lua function, whose name is given as a parameter. Up to five arguments (string and numbers) can be passed to the called function.
  • Changes to existing commands:
    • -esc - Position the escort takes, relative to the escorted group, can now be specified

 

2021/06/15 - Gamemaster_Functions v. 2.3

  • Redesigned inner workings a bit, making the implementation of functions with a high parameter count easier
  • Switched to v. 2.7.4 of MOOSE
  • New config options related to the new draw commands
  • New Commands:
    • -drawtext - Draws a textbox on the F10 map. Text, font size, transparency and colors can be specified
    • -drawline - Draws a line on the F10 map, transparency and color can be specified. Line can optionally be labelled with a textbox.
    • -drawarrow - Draws an arrow on the F10 map, same options as for lines can be specified
    • -drawcircle - Draws a circle on the F10 map. Colors and transparency can be specified, a label can optionally be assigned as well.
    • -drawrect - Draws a rectangle on the F10 map. Same options as for circles can be specified.
    • -drawpoly - Draws a polygon on the F10 map. Max. # of possible corners is 11 at this time. Specifiable options are the same as for the other shapes.
    • -drawdel - Deletes all drawings and map markers within a specified radius around the command marker
  • Changes to existing commands:
    • -coord - Leading zeros in MGRS coordinates now get displayed properly

 

2021/06/15 - Gamemaster_Templates v. 2.1

  • Added templates for all units added with the 2.7.1 update

 

2021/07/25 - Gamemaster_Functions v. 2.4

  • New Commands:
    • -actnavbcn - Orders a specified unit to turn on its TACAN beacon (if it has one)
    • -remnavbcn - Orders a specified unit to turn its TACAN off
    • -acthombcn - Allows you to create radio homing beacons (ADF/FM/VHF), either attached to a group or at the marker position
    • -remhombcn - Orders a group to stop its radio transmission
    • -list - Returns a list of all groups that exist in the mission, list can be filtered. Helpful to keep track of spawn templates in large missions
  • Changes to existing commands:
    • -s - ROE at spawn can now be specified (no more passive enemy fighters)
    • -func - The command now passes the coordinates of the command marker on to the called function as an additional, 7th argument. Global variables can now be passed as arguments as well, provided they are not buried more than 3 layers deep in tables and subtables.
  • General changes:
    • The config section has been restructured for better useability

 

**Known Bugs/Issues**

  • None reported at this time.

 

**Planned features/ToDo-List**

  • Feedback system that returns status messages to the player that issued a command (this currently can't be implemented due to a DCS bug)
  • Whitelist system that controls access to the gamemaster functions in multiplayer (currently not possible due to same DCS bug)
  • Extend -actnavbcn to include ICLS as well

 

 

 

 

Manual_Gamemaster_Eng.pdf


Edited by CakeSorbus
Script Update
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

HI, Tried this out and spawning the units from the templets works great. I could not get a unit that was set for late activation to spawn using either -s- or -act- The line I used was -act-T-90 (which was a group of 4 T-90s with a start and stop waypoint). Tried it with the -s- also with no luck. User error or bug? thanks

Asus Prime 390A, Intel I7-8700k@4.8ghz, 32g ram, Nvidia EVGA GeForce RTX 2070, Track IR5, SSD(DCS dedicated), HDD for Win 10. TM Warthog 78051 Track IR5 Thrustmaster pedels

Link to comment
Share on other sites

Hi lahsoldier,

 

 

and thanks for the feedback!

 

My script looks for hyphens in the marker text to separate the commands and different parameters from each other. Thats probably why the -act and -s commands didn't work for your group of T-90 which you named "T-90". The script thinks that the "T" and the "90" are different parameters because they have a hyphen between them. Try changing the group name to "T90" or "T_90" and see if it works then. You can also enable the option DebugMode in the config section of the script. This will give you status messages ingame that return to you how the script interpreted your command input (The messages are in german though, I didn't translate them). Note that these messages are shown to every player in the mission.

 

When developing the script I chose the hyphen as the separator for commands and parameters because it can be entered without using the shift key (i'm not capable of 10 finger typing, so i wanted to have a little more convenience). Maybe I will add an option to choose your own separator symbol in the config section of the script in a later release.


Edited by Cake/Sorbus
Link to comment
Share on other sites

Thank you Cake/Sorbus for making this and sharing it with everyone. It looks very interesting and I will definitely play around with it.

 

About the hyphens though - DCS automatically uses hyphens for unit name numbering (1-1, 1-2, 2-1, 2-2, etc) so it would definitely be advantageous if we could use a different character. Otherwise we'll have to edit and change pretty much every unit number for use with your script.

Link to comment
Share on other sites

@Hunter_5E

 

 

You're right! Though DCS currently only has this type of naming scheme in the Open Beta.

 

Won't be too long though (I hope) before this hits stable so I decided to address the issue right now.

 

I added an option in the config section at the top of the "Gamemaster_Functions" script file. You can now change the symbol the script uses to recognize commands & parameters to any symbol or string you want.

Link to comment
Share on other sites

Thanks for implementing that, it will be very handy.

 

I've got spawns working from your templates and smoke markers etc but need some help with group spawns. I'm wanting to create air defence groups like SA11 Buk etc as your templates have only single units for them.

 

In your manual it states "requires a late activated group set up in the mission editor as a template." I can't seem to get this to work though. If I set up a group and set it to late activation then save it as a template, it doesn't save the late activation part in the template and I can't get it to spawn with your commands.

 

I can activate late groups but not make templates and spawn them. Do the templated groups have to be on the map somewhere or simply saved as a template? Also, will my own templates work while yours are loaded with the "Gamemaster_Templates.lua"? I've tried with and without yours loaded and still can't get my groups to spawn from templates.

 

I must be doing something wrong somewhere?

Link to comment
Share on other sites

 

In your manual it states "requires a late activated group set up in the mission editor as a template."

 

Whoops, that line is a bit misleading! :music_whistling:

 

What I meant to say was that my script takes the late activated group that you have set up in the mission editor and (utilizing SPAWN from MOOSE) uses it as a template to spawn unlimited copies from. You don't have to create a template of the group in the templates tab of the mission editor. Just set up the group as late activated and then let it spawn ingame with the -s command.

 

 

Regarding the SA11: The air defence templates should actually spawn as completely functional air defence groups. With the SA11 you have three different templates at your disposal:

-A low strength group consisting of command post, launcher, search radar and resupply truck -> sa11l

-A medium strength group that has an additional launcher -> sa11m

-A heavy strength group that has a second launcher and additional close-in defences (Igla MANPAD & Tunguska) -> sa11h

I tested these templates again in stable and OB and they spawned just fine (small bug with the medium one, but nothing critical) for me. Please give it another go, and report back if the SA11 does not spawn as described.


Edited by Cake/Sorbus
Link to comment
Share on other sites

Also, will my own templates work while yours are loaded with the "Gamemaster_Templates.lua"?

 

 

They do work alongside each other, as long as you don't accidentally name one of your groups the same as one of the template groups that I have set up in "Gamemaster_Templates.lua"

Link to comment
Share on other sites

Hi lahsoldier,

 

 

and thanks for the feedback!

 

My script looks for hyphens in the marker text to separate the commands and different parameters from each other. Thats probably why the -act and -s commands didn't work for your group of T-90 which you named "T-90". The script thinks that the "T" and the "90" are different parameters because they have a hyphen between them. Try changing the group name to "T90" or "T_90" and see if it works then. You can also enable the option DebugMode in the config section of the script. This will give you status messages ingame that return to you how the script interpreted your command input (The messages are in german though, I didn't translate them). Note that these messages are shown to every player in the mission.

 

When developing the script I chose the hyphen as the separator for commands and parameters because it can be entered without using the shift key (i'm not capable of 10 finger typing, so i wanted to have a little more convenience). Maybe I will add an option to choose your own separator symbol in the config section of the script in a later release.

 

Thanks for the reply and I will check it. Probably what happened.

Asus Prime 390A, Intel I7-8700k@4.8ghz, 32g ram, Nvidia EVGA GeForce RTX 2070, Track IR5, SSD(DCS dedicated), HDD for Win 10. TM Warthog 78051 Track IR5 Thrustmaster pedels

Link to comment
Share on other sites

Tested again today and all your template spawns work as described. I assumed your Buk units were singles when I saw three different designations for them. My bad.

 

I can get everything to work ok except spawning my own late activated groups. Tried in stable and open beta, same thing. Is there some kind of naming convention to follow or do they need to be visible before activation? I've set the start time to next day or after as per DCS manual then selected late activation. I can then activate them but can't spawn them.

 

Simple test mission below (open beta). Maybe you can spot what dumb mistake I'm making :cry: (I set my command character to # btw)

 

PS, a suggestion - could you add a selectable delay for explosions? The person typing in the command doesn't get to see the explosion as it is finished before you get out of map view.

Zeus Test.miz

Link to comment
Share on other sites

Tested again today and all your template spawns work as described. I assumed your Buk units were singles when I saw three different designations for them. My bad.

 

I can get everything to work ok except spawning my own late activated groups. Tried in stable and open beta, same thing. Is there some kind of naming convention to follow or do they need to be visible before activation? I've set the start time to next day or after as per DCS manual then selected late activation. I can then activate them but can't spawn them.

 

Simple test mission below (open beta). Maybe you can spot what dumb mistake I'm making :cry: (I set my command character to # btw)

 

PS, a suggestion - could you add a selectable delay for explosions? The person typing in the command doesn't get to see the explosion as it is finished before you get out of map view.

 

I tested your mission and I found that once I replaced your Moose and the other scripts with the most current one that are linked at the beginning of this thread your late activations worked perfect with the -act- command. Don't know if it was Moose or one of the scripts causing the issue but I would just download and replace all of it with the most current ones. If you used these to begin with they might be corrupted for some reason and a redownloading would take care of that also.

Asus Prime 390A, Intel I7-8700k@4.8ghz, 32g ram, Nvidia EVGA GeForce RTX 2070, Track IR5, SSD(DCS dedicated), HDD for Win 10. TM Warthog 78051 Track IR5 Thrustmaster pedels

Link to comment
Share on other sites

Thanks for testing that out for me, much appreciated.

 

Thing is though, as I stated in my last post, I can activate groups no problem with -act- but can't spawn them with the -s- command.

 

I've tried using very simple names, all lower case letters, all upper case letters but nothing works. They just won't spawn for some unknown reason.

Link to comment
Share on other sites

Hmm, I have looked at the mission file you uploaded and I have to admit that I'm stumped. I first confirmed that the groups you have set up do not spawn with the s command on my system as well. Then I added another group and gave it the same arrangement and naming scheme and set it to late activation. That one spawned just fine! What confuses me is that I can see no difference between the group that I have set up and the ones you had already placed in the mission. I've attached my edited version of your test mission. Please check if you can spawn the groups that I added (ARV_Star2 and APC_Star2).

 

Could you describe to me in detail which steps you take when setting up a group for late activation in the ME? Maybe we can find the error that way...

 

 

I like your suggestion of a selectable delay with the explosions, I will add that to the list of planned features.

Zeus Test_Edit.miz


Edited by Cake/Sorbus
Link to comment
Share on other sites

Thanks for testing that out for me, much appreciated.

 

Thing is though, as I stated in my last post, I can activate groups no problem with -act- but can't spawn them with the -s- command.

 

I've tried using very simple names, all lower case letters, all upper case letters but nothing works. They just won't spawn for some unknown reason.

 

Sorry I guess I missed that part but I will say that when I first tried it, I couldn't get anything to spawn with either command. Only after I switched them out could I get them to spawn with act. the "s" command still wouldn't work.

Asus Prime 390A, Intel I7-8700k@4.8ghz, 32g ram, Nvidia EVGA GeForce RTX 2070, Track IR5, SSD(DCS dedicated), HDD for Win 10. TM Warthog 78051 Track IR5 Thrustmaster pedels

Link to comment
Share on other sites

Eureka! Found the problem :thumbup:

 

Turns out I'd been misled by reading the latest "DCS User Manual EN 2020.pdf" in the "Doc" folder in Open Beta. See the screenshot below and note what it says in CAPS AND UNDERLINED.

 

I can only guess that this hasn't been fully implemented yet as you can clearly activate groups that are NOT set to a start time a day or more after mission start.

 

You wouldn't have noticed that my start time was set to 8:0:0/2 unless you'd unchecked the late activation tick box. With that box checked, the start time shows as 0:0:0/0.

I set my start time to 8:0:0/0 and that fixed the problem.

 

Anyway, glad we found the problem - all is good now. Thanks for your help guys, really appreciated.

2059008016_DCSManual2020.jpg.68060c7edf04b28ce37498a116da595c.jpg


Edited by Hunter_5E
Link to comment
Share on other sites

@lahsoldier

 

I had changed my command character to #, as I said in my earlier post. That is why you couldn't get anything to work until you'd changed out the scripts files.

 

I also said "I've set the start time to next day or after as per DCS manual then selected late activation." which I think you both missed.

 

Perhaps this is a good reminder to us all to make sure we read and understand other peoples posts before replying to them. We all make that mistake at some point, me included, so no disrespect intended. Just a friendly reminder to us all.

Link to comment
Share on other sites

You wouldn't have noticed that my start time was set to 8:0:0/2 unless you'd unchecked the late activation tick box. With that box checked, the start time shows as 0:0:0/0.

I set my start time to 8:0:0/0 and that fixed the problem.

 

 

Huh, so that caused the problem! I actually read what you wrote about the start time, but since the group could be activated by command, I wrongly dismissed this as the cause of the issue. :doh:

 

My guess is that the start time somehow keeps MOOSE from recognizing the group as late activated...but it works now, and that's the important bit! :)

Link to comment
Share on other sites

Yeah that kinda threw me as well, the fact that they could be activated and the fact that the user manual states in caps and underlined that they MUST be set to a day or so after mission start. I thought this was the norm and what everyone did.

 

Its a pain that there's totally misleading stuff like that in the official manual but like you said, it works now and that's the main thing.

 

Thank you again for sharing your Zeus script and for your help in troubleshooting my problem.

Link to comment
Share on other sites

Sorbus, I just ran across this, and I wanted to say THANK YOU!!!

 

I have been using another version, its a little clunkier than this one. The ability to just throw a unit/group into the ME and be able to spawn it right up without having to go into the lua and add it is pretty amazing too!

 

I've also been fighting with AI aircraft as the game master for my group lately, excited to be able to force them into a new orbit pattern without using the ridiculous CA pathing interface!

 

Again, thank you for this amazing tool, its certainly going to make my life easier to give the boys a proper mission.

Link to comment
Share on other sites

Loving your slick script!

Would it be possible, for example, to have a command to start a Mig21_2 which has been set, in the mission editor, to "start from ramp" "uncontrolled" and has a triggered action "start Mig21_2"?

 

Hi, it's pretty late here, so I apologize beforehand if I misunderstood your question due to tiredness.

 

I understand that you want to spawn a MiG 21 on the ramp in an uncontrolled state and turn it on at a later time.

There are three different ways to do this with the gamemaster script:

 

1. Method: Set the group up as late activated, start from ramp and uncontrolled in the mission editor (ME), then activate it ingame with the "-act" command (see Section 5.2 of the manual). The group will then spawn in an uncontrolled state. To turn it on you can use the "-ctrlon" command (see section 5.13).

 

2. Method: Set the group up the same as above, but ingame use the "-s" command (see section 5.1) instead to spawn it. You will have to add the parameter "-kt" to ensure that tasking of the group doesn't get overriden on spawn and "-op" to have the group spawn at the location you set it up at and not at your map marker. You can later turn the group on with the "-ctrlon" command.

 

3. Method: In the ME set the group up as late activated, but let it start in the air. Ingame you spawn it with the "-s" command but you add the parameter "-ground". The group then spawns in the air, at your map marker, but will then almost instantly respawn on the ramp and in an uncontrolled state, at the airbase nearest to your map marker. You can then turn it on with the "-ctrlon" command.

 

 

*Edit*

I just reread your question now that I'm a little more awake...you want to spawn an uncontrolled MiG 21 and have it turn on automatically when an external condition is met (by use of a triggered action and a corresponding trigger that you have set up in the ME)

 

I must confess that I never really did much with these triggered actions you can set up in the groups tab of the ME. They should work though, as long as you use the "-act" command to spawn the group ingame.

 

Why the "-act" command and not "-s"? The "-act" command mirrors what happens when the ME trigger action "Group activate" is used, it just activates the group in the exact state that you have set it up with in the ME.

 

The "-s" command on the other hand uses the SPAWN class from MOOSE to create a copy of the group you have set up and then activates that copy. The copy that spawns has a modified group name and a different GroupID than the group you have created in the ME. In consequence it won't be affected by triggers that target the original group because as far as DCS is concerned it's a completely different group.


Edited by Cake/Sorbus
Link to comment
Share on other sites

  • 3 weeks later...

Hey man, thanks for the great work here. I took a look at the code and found it very easy to navigate and extend.

 

Since we're a big CTLD shop, I added three functions/commands in that:

 

1 - Allow you to spawn in a CTLD extractable group and specify the quantity.

 

2 - Allow you to spawn CTLD crates.

 

3 - Spawns a few different types of statics.

 

If you are interested in merging these, LMK and I'll send it over.

[sIGPIC][/sIGPIC]

Are you ready to take your chopper flying skills to the next level?

Then check out http://www.blacksharkden.com/ Or visit us on Discord https://discord.gg/kaayJ5z and talk to some of our awesome pilots today.

Link to comment
Share on other sites

If you are interested in merging these, LMK and I'll send it over.

 

 

Yes, please! :D

 

 

I just started coding my own command for the spawning of statics, but I'm very curious to see your code on that.

 

And I hadn't even thought about creating an integration with CTLD...nice!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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