Ciribob ED Testers Team

Join Date: Mar 2015 Location: Brighton, UK Posts: 1,939

DCS-SimpleSlotBlock - Multiplayer Slot Blocking Script



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



or click this:



Copy the SimpleSlotBlockGameGUI.lua to your C:\Users\\Saved Games\DCS\Scripts\hooks and into any other DCS folders e.g. DCS.openalpha\Scripts\hooks



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



Code: 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:



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



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:



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



To enable, simply set the flag back to 0



Code: 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:



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



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:



Code: ssb.prefixes = { "104th", } "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:



Code: ssb.controlNonAircraftSlots = true



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 Games\DCS\Logs



There should be a line that looks something like:



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



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



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 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 theThe script can be used to:To Install got to GitHub https://github.com/ciribob/DCS-SimpleSlotBlock and click "clone or download" and download the repositoryor click this: https://github.com/ciribob/DCS-Simpl...ive/master.zip Copy the SimpleSlotBlockGameGUI.lua to your C:\Users\\Saved Games\DCS\Scripts\and into any other DCS folders e.g. DCS.openalpha\Scripts\SSB (SimpleSlotBlock) only has a few global configuration options. These are listed in the file and shown below: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: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 workNext 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:This will disable the playable helicopter with the GROUP NAME of HELI1To enable, simply set the flag back to 0To reserver a slot for a specific clan tag (or individual player) add a new entry to the ssb.prefixes list in the GameGUI: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 NAMEi.e to reserve a UH1 for the 104th Squadron:then set the UH-1 GROUP NAME to: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.Non aircraft slots, GCI / Game Commander etc can be globally reserved. Turning this on will effectmissions on the server.First edit SimpleSlotBlockGameGUI.lua and set: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 inTo obtain a players UCID, have the player try to join a slot running SSB and then check the dcs.log in C:\Users\\Saved Games\DCS\LogsThere should be a line that looks something like: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 :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.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 nowI'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 initialisesPlease let me know how you get on or if you have any issues! Enjoy Attached Files slot_block_test_helis.miz (7.0 KB, 142 views)

Scripts: Complete Transport And Logistics Deployment - CTLD /







Projects:

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord __________________ 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 DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! Last edited by Ciribob; 12-27-2017 at 12:21 PM .