Jump to content

DCS-SimpleSlotBlock - Multiplayer Slot Blocking Script


Recommended Posts

Something thats been asked a few times is an easy way to enable or disable slots on a multiplayer mission, so I've put this together. Its basically a modified version of the script I use for the CSAR slot blocking.

 

The script only needs to be installed by the server host.

 

The script can be used to:

  • Block / unblock a slot by setting a flag
  • Reserve an aircraft slot for clan members only
  • Disable the GCI / AWACS / Ground commander slot for everyone except specific players

 

Installation

 

To Install got to GitHub https://github.com/ciribob/DCS-SimpleSlotBlock and click "clone or download" and download the repository

 

or click this: https://github.com/ciribob/DCS-SimpleSlotBlock/archive/master.zip

 

Copy the SimpleSlotBlockGameGUI.lua to your C:Users\Saved GamesDCSScriptshooks and into any other DCS folders e.g. DCS.openalphaScriptshooks

 

Configuration

 

SSB (SimpleSlotBlock) only has a few global configuration options. These are listed in the file and shown below:

 

NOTE: Changes to GameGUI files only take effect after a full DCS Restart

 

ssb.showEnabledMessage = true -- if set to true, the player will be told that the slot is enabled when switching to it
ssb.controlNonAircraftSlots = false -- if true, only unique DCS Player ids will be allowed for the Commander / GCI / Observer Slots


-- If you set this to 0, all slots are ENABLED
-- by default as every flag starts at 0.
-- If you set this to anything other than 0 all slots
-- will be DISABLED BY DEFAULT!!!

-- Each slot will then have to be manually enabled via
-- trigger.action.setUserFlag("GROUP_NAME",100)
-- where GROUP_NAME is the group name (not pilot name) and 100 is the value you're setting the flag too which must
-- match the enabledFlagValue

ssb.enabledFlagValue = 0  -- what value to look for to enable a slot.


-- any aircraft slot controlled by the GROUP Name (not pilotname!)
-- that contains a prefix below will only allow players with that prefix
-- to join the slot
--
-- NOTE: the player prefix must match exactly including case
-- The examples below can be turned on by removing the -- in front
--
ssb.prefixes = {
    -- "-=104th=-",
   -- "-=VSAAF=-",
   -- "ciribob", -- you could also add in an actual player name instead
   "some_clan_tag",
   "-=AnotherClan=-",
}


-- any NON aircraft slot eg JTAC / GCI / GAME COMMANDER
-- will only allow certain PLAYER IDS
-- PLAYER IDS are unique DCS ids that can't be changed or spoofed
-- This script will output to the them to the dcs.log file when a player changes slots so you can copy them out easily :)
-- This will only take effect if: ssb.controlNonAircraftSlots = true
ssb.commanderPlayerUCID = {
   "292d911c1b6f631476795cb80fd93b1f",
   "some_uniqe_player_ucid",
}

Usage In Missions

 

To enable the SSB script in a mission first create a TRIGGER with a TIME MORE of 1 and an ACTION of DO SCRIPT with the Script below:

 

  trigger.action.setUserFlag("SSB",100)

 

This first trigger turns on SSB for the currently running mission. If this flag isn't set in the mission then Slot Blocking will not work

 

Next create as many triggers as you like to enable or disable a slot. For example, to disable a slot at mission start:

 

Create a TRIGGER with a TIME MORE of 1 and an ACTION of DO SCRIPT with the Script below:

 

  trigger.action.setUserFlag("HELI1",100)

 

This will disable the playable helicopter with the GROUP NAME of HELI1

 

To enable, simply set the flag back to 0

 

  trigger.action.setUserFlag("HELI1",0)

 

Note: If you change the ssb.enabledFlagValue, remember to update all your triggers and flag values!

 

 

Reserve Aircraft Slot

 

To reserver a slot for a specific clan tag (or individual player) add a new entry to the ssb.prefixes list in the GameGUI:

 


ssb.prefixes = {
   "-=433=-",
   "ciribob",
}

 

You can add as many entries as you like, not every mission has to use them all but this sets the list of tags / prefixes we'll be looking for.

 

Next in a mission add the prefix you want to use for a unit to the GROUP NAME

 

i.e to reserve a UH1 for the 104th Squadron:

 


ssb.prefixes = {
   "104th",
}

 

then set the UH-1 GROUP NAME to: "Huey 1 104th"

 

The reservation system will still take into account if the slot is enabled or not so a slot could be reserved but disabled if you like.

 

 

Reserve Non Aircraft Slot

 

Non aircraft slots, GCI / Game Commander etc can be globally reserved. Turning this on will effect all missions on the server.

 

First edit SimpleSlotBlockGameGUI.lua and set:

 

ssb.controlNonAircraftSlots = true

 

Make sure that DCS isnt running when you edit or restart DCS for the settings to take effect.

 

Next you need to add players unique DCS player ids (UCID) to the list of ucids in ssb.commanderPlayerUCID

 

To obtain a players UCID, have the player try to join a slot running SSB and then check the dcs.log in C:Users\Saved GamesDCSLogs

 

There should be a line that looks something like:

 

00115.172 INFO    LuaNET: SSB - Player Selected slot - player: Ciribob side:2 slot: 2 ucid: 283d911c1b6f631476795cb80fd93b7a

 

Just copy the UCID e.g. 283d911c1b6f631476795cb80fd93b7a and add to the commanderPlayerUCID list in the GameGUI. Again make sure to restart DCS after changes to the GameGUI :

 


ssb.commanderPlayerUCID = {
   "292d911c1b6f631476795cb80fd93b1f",
   "283d911c1b6f631476795cb80fd93b7a",
   "223d911c1b6f631476795cb80fd93b8a",
}

 

The UCID is unique to the DCS player account so name changes won't affect it so its a pretty sure way to lock down a slot to specific members.

 

Tutorial Video

 

I've put together a quick example mission from scratch that shows how you can disable a slot at mission start and then use a players action to unlock it again.

 

I hope this helps explain it better!

 

Note - since the video gameGUI files must go in scripts / hooks folder now

 

 

I've also attached a pre-configured test mission from the tutorial video that shows activating a second helicopter slot by flying into a zone. You can test by installing the SimpleSlotBlockGameGUI.lua and then starting a multiplayer server.

 

Remember to unpause and wait a second if you're testing so that the script initialises :)

 

Please let me know how you get on or if you have any issues! Enjoy :)

slot_block_test_helis.miz


Edited by Ciribob
  • Like 3

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

Another Superb Mod from Ciribob. Thank you

 

| i9 9900K Octa Core 2TB SSD +32GB Spectrix DDR4 @3200MHz RGB | 2 x Radeon RX480 in Crossfire. | TrackIR5 HOTAS Warthog,MFG Crosswind Pedals | Cougar MFDs |

 

[OCG] Oceanic Combat Group

discord.gg/ZmXEBSU

"Through The Inferno"

by deadlyfishes

 

Official Australian Servers

 

SRS: All Servers have Auto-Connect Enabled

 

Server 1: TTI Caucasus

Server 2: TTI Persian Gulf

Server 3: OCG Training

Server 4: OCG NTTR & Multiplayer Missions

 

Australian Website

AU Discord Server

Link to comment
Share on other sites

  • 1 month later...

Bless you buddy!

 

I didn't work for me though. Did all you've said and double checked that. I have other lau scripts running in my mission. Could that be the problem?

 

EDIT: Works now!


Edited by Alpenwolf

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

Bless you buddy!

 

I didn't work for me though. Did all you've said and double checked that. I have other lau scripts running in my mission. Could that be the problem?

Since it works, and only based on the global flags, unless your other LUA changes global flags then no, its more likely to be a setup error.

___________________________________________________________________________

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

Link to comment
Share on other sites

Since it works, and only based on the global flags, unless your other LUA changes global flags then no, its more likely to be a setup error.

Sure it works! My bad, sorry... Sometimes double checking aint enough. A comma was all that was missing.

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

Ok... The whole thing works for me but only if I start a new server (for testing as you've mentioned). The mission runs now on the ACG Cold War server on DCS 1.5.6 and the slot blocking doesnt work there! What's the difference between running the mission on an empty server for testing only and having it on a public server like ACG?


Edited by Alpenwolf

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

Ok... The whole thing works for me but only if I start a new server (for testing as you've mentioned). The mission runs now on the ACG Cold War server on DCS 1.5.6 and the slot blocking doesnt work there! What's the difference between running the mission on an empty server for testing only and having it on a public server like ACG?

Have you copied the GameGUI file to the server?

 

Sent from my ONEPLUS A3003 using Tapatalk

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Have you copied the GameGUI file to the server?

 

Sent from my ONEPLUS A3003 using Tapatalk

The admin forgot to do that. I told him about it and now it works :thumbup:

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 3 months later...

In the current openalpha and openbeta, all gameGUI files must be moved to scripts/hooks instead of just scripts folder.

 

This will be the case as well in stable when openbeta is moved to stable :)

 

Sent from my ONEPLUS A3003 using Tapatalk

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

hmmm, good to see you are still watching the development. If you notice any more gotchas like this for the folks that like playing, please please take 5 mins to brain dump on a forum so we can avoid such things.

___________________________________________________________________________

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

Link to comment
Share on other sites

Looks like the Slot Blocking script ain't working no more after the DCS 1.5.8 update! Anyone having the same issue here?

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

Looks like the Slot Blocking script ain't working no more after the DCS 1.5.8 update! Anyone having the same issue here?
Check my post one post up... :)

 

Move it to scripts/hooks

 

Sent from my ONEPLUS A3003 using Tapatalk

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Check my post one post up... :)

 

Move it to scripts/hooks

 

Sent from my ONEPLUS A3003 using Tapatalk

Sorry, may bad. Just another one please; there is no such folder and I can't rename it to "Scripts/Hooks". You know, no characters like "/" are allowed in names.

cold war 1947 - 1991.jpg

Cold War 1947 - 1991                                       Discord
Helicopters Tournaments
Combined Arms Tournaments

You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com

Link to comment
Share on other sites

Sorry, may bad. Just another one please; there is no such folder and I can't rename it to "Scripts/Hooks". You know, no characters like "/" are allowed in names.
Make a folder called hooks in scripts folder :)

 

Sent from my ONEPLUS A3003 using Tapatalk

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • 3 months later...

Hi guys, is there a way to reserve slots ONLY for Game Master?

 

I need to have free access for Tactical Commander or Forward Observer but I need to reserve one slot only for Game Master.

 

Tks!!



[sIGPIC]https://forums.eagle.ru/signaturepics/sigpic128931_4.gif[/sIGPIC]

 

SO:Win10 64bit CPU:Intel i7 8700K@3.7 RAM:DDR4 46GB G.Skill Trident 3200MHz CL14 GPU:Nvidia EVGA GTX1080Ti FTW iCX MB:ASRock Z370 Extreme4 HDD:

512GB Samsung 970 PRO SSD M.2 NVMe + 250GB Samsung 850 EVO SSD + 2x500GB Seagate Barracuda 7200RPM

Link to comment
Share on other sites

Hi guys, is there a way to reserve slots ONLY for Game Master?

 

I need to have free access for Tactical Commander or Forward Observer but I need to reserve one slot only for Game Master.

 

Tks!!

 

Solved!



[sIGPIC]https://forums.eagle.ru/signaturepics/sigpic128931_4.gif[/sIGPIC]

 

SO:Win10 64bit CPU:Intel i7 8700K@3.7 RAM:DDR4 46GB G.Skill Trident 3200MHz CL14 GPU:Nvidia EVGA GTX1080Ti FTW iCX MB:ASRock Z370 Extreme4 HDD:

512GB Samsung 970 PRO SSD M.2 NVMe + 250GB Samsung 850 EVO SSD + 2x500GB Seagate Barracuda 7200RPM

Link to comment
Share on other sites

How?

 

Cancel or quote:

 

_unitRole == "forward_observer"

_unitRole == "artillery_commander"

_unitRole == "observer"

 

near line 282 and near line 331 in the SimpleSlotBlockGameGUI.lua

 

In this mode you will exclude these "slots" from the control of SSB and only Game Master's slot are affected by the restrictions...



[sIGPIC]https://forums.eagle.ru/signaturepics/sigpic128931_4.gif[/sIGPIC]

 

SO:Win10 64bit CPU:Intel i7 8700K@3.7 RAM:DDR4 46GB G.Skill Trident 3200MHz CL14 GPU:Nvidia EVGA GTX1080Ti FTW iCX MB:ASRock Z370 Extreme4 HDD:

512GB Samsung 970 PRO SSD M.2 NVMe + 250GB Samsung 850 EVO SSD + 2x500GB Seagate Barracuda 7200RPM

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...