Jump to content

DCS-SimpleSlotBlock - Multiplayer Slot Blocking Script


Recommended Posts

Hi All

 

Ciribob, just a quick question on this. With respect to "Reserve Aircraft Slot". When I create a flight on a mission I normally create the flight with 2 or more aircraft. I've noticed that when reserving the slot on a particular flight of 2, only one aircraft will show as available and the number 2 slot is switched to an actual AI instead of client.

 

Example: 2 flights of two aircraft prior to to the script.

 

Group 1

Lusty 11

Lusty 12

 

Group 2

Lusty 21

Lusty 22

 

After adding the script.

Group 1

Lusty 11

 

Group 2

Lusty 21

 

The wingman on each flights are now switched to AI instead of client.

 

Is there a way to actually use the script for flights with multiple aircraft instead of just one?

 

Thanks in advance.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Hi All

 

Ciribob, just a quick question on this. With respect to "Reserve Aircraft Slot". When I create a flight on a mission I normally create the flight with 2 or more aircraft. I've noticed that when reserving the slot on a particular flight of 2, only one aircraft will show as available and the number 2 slot is switched to an actual AI instead of client.

 

Example: 2 flights of two aircraft prior to to the script.

 

Group 1

Lusty 11

Lusty 12

 

Group 2

Lusty 21

Lusty 22

 

After adding the script.

Group 1

Lusty 11

 

Group 2

Lusty 21

 

The wingman on each flights are now switched to AI instead of client.

 

Is there a way to actually use the script for flights with multiple aircraft instead of just one?

 

Thanks in advance.

Sorry no - the script only works at a group level and there must be one client per group.

 

It's good practice to do this anyway as any any f10 radio commands work per group

 

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

I got a bug report right after I added SSB to my mission while testing the slots blocking. Yesterday it said 334 and today it's 421. Check out the attached image, please. I clicked "OK" and the mission still ran normally.

 

S!

 

EDIT:

 

Fixed! The issue was having some scripts running simultaneously.

20180420_074459.thumb.jpg.77104b7195182c5d95ba492b761956fb.jpg


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

  • 6 months later...

Reserving slots for a squadron:

 

 

I'm willing to reserve slots for a squadron called, let's say XXX

First, a trigger to fire up SSB:

 

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

 

Second, adding the name of that squadron to the ssb.prefixes like this:

 

ssb.prefixes = {

"XXX",

}

 

 

That should be it, right?

Well, it ain't working for me. I'm not a member of that squadron and I still can join the reserved slots.

(Testing was done in multiplayer of course, not in the mission editor)

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

  • 2 months later...

Hi Ciribob, after years of just working fine, we've found an interesting issue.

 

When using an aircraft that is NOT slotblocked, SSB kicks in once the aircraft has been destroyed.

 

Steps we can use on our server for this;

1. Take the first Hornet slot on the Stennis.

2. Take off, destroy the aircraft

3. Swap slots to the second and back to the first

 

 

The script comes up with:

2019-01-20 16:18:08.963 INFO    LuaNET: REDSANDS - REJECTING Aircraft Slot - player: TOMBSTONE 1-1 | Frosties side:2 slot: 3338 ucid: redacted
2019-01-20 16:18:08.964 INFO    NET: rejected by onPlayerTryChangeSlot

Expected, nothing would happen as the slot isn't governed by SSB and it's perfectly accessible until the aircraft is destroyed.

 

Seems to be a DCS issue to me, but would appreciate your thoughts.

___________________________________________________________________________

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

Link to comment
Share on other sites

  • 3 weeks later...
Reserving slots for a squadron:

 

 

I'm willing to reserve slots for a squadron called, let's say XXX

First, a trigger to fire up SSB:

 

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

 

Second, adding the name of that squadron to the ssb.prefixes like this:

 

ssb.prefixes = {

"XXX",

}

 

 

That should be it, right?

Well, it ain't working for me. I'm not a member of that squadron and I still can join the reserved slots.

(Testing was done in multiplayer of course, not in the mission editor)

Same for me.

Link to comment
Share on other sites

  • 3 weeks later...

For some reason I should have updated this post but I didn't. My bad. The issue was another script, namely Moose Airboss was also messing with global flags. Because we use any number as disabled and 0 as enabled which is a better design because flags are by default there, then it disabled slots due to the global flags being the group name also.

 

I had reported this and it was fixed a little while back.

___________________________________________________________________________

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

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Hi !

I just found your script as a solution for me

i want to have some package not be usable at the beginning of the mission

 

 

but sadly that doesn't working

like script is not here

 

 

i put script in hook folder and added SSB command in the first trigger with time delayed of 3 seconds, but that is not OK !

 

 

have you an idea ?

 

 

big thanks

 

 

ps: i use the lastest OB

System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box

Link to comment
Share on other sites

new hi ;-)

 

 

because no one seems to tell that the script is not working

i continue to search with big comparaison with the example mission and i think i found why it does not working et now it seems OK ;)

 

 

time delayed was > 1 and the trigger was "at the beginning" and not "once"

 

 

i will continue to test my mission but it seems it's now OK

 

 

thanks and sorry for questions !! ;-)

System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box

Link to comment
Share on other sites

  • 2 weeks later...

hey Ciribob, i got a question,

i made myself a dynamic mission where spawns of aircrafts get disabled and enabled over the time..

 

You can capture an airport and after that you can spawn on there.

But the problem is, if i took of from gudauta and im on team blue and team red attacks gudauta and capping it while im airborne, i as a spawned player from gudauta gets directly despawned in the air.

 

is there a way to workaround this?

 

Greetz

BigMongostyler

Link to comment
Share on other sites

  • 1 month later...

Hi guys..

 

I try to add SBS on my dedicated server.

 

I add Lua file in Scrpts/Hooks.

 

And in the missions follow the steps..

 

 

When i check the server log (after restart dcs in teh server), Can´t foun any in the log related to SBS

 

ANy help to check?

 

 

FIXED.


Edited by HerVirek
Link to comment
Share on other sites

  • 1 month later...

Hi Y’all, does anyone have the slot block part of the CSAR script working on the new DCS dedicated servers...?

 

 

csar.csarMode = 0

 

-- 0 - No Limit - NO Aircraft disabling

-- 1 - Disable Aircraft when its down - Timeout to reenable aircraft

-- 2 - Disable Aircraft for Pilot when he's shot down -- timeout to reenable pilot for aircraft

-- 3 - Pilot Life Limit - No Aircraft Disabling -- timeout to reset lives?

 

csar.maxLives = 8 -- Maximum pilot lives

 

I’m not having any luck and not sure if it’s me not setting it up right or if it’s a new dedicated server issue...?

 

I’ve also tried the simple slot block script as well but also not working or me...?

 

Thank you...

:pilotfly:

[sIGPIC][/sIGPIC]

 

:gun_smilie:

 

229th Assault Helicopter Battalion - Always Recruiting

 

If you have a passion for helicopter flight simulation and would like to fly in a friendly and supportive online multiplayer environment, then you’ve just put your skids down safely on the right page…!

 

DCS Squadron Recruiting Page for the 229th

https://forums.eagle.ru/showthread.php?t=267081

 

For details see our website at:

http://1stcavdiv.forumotion.net/

Link to comment
Share on other sites

I’ll take the silence as a no then...?

Shame, would have been good to use in my missions, "que sera sera"

Have an outstanding day, y’all... :-)

:pilotfly:

[sIGPIC][/sIGPIC]

 

:gun_smilie:

 

229th Assault Helicopter Battalion - Always Recruiting

 

If you have a passion for helicopter flight simulation and would like to fly in a friendly and supportive online multiplayer environment, then you’ve just put your skids down safely on the right page…!

 

DCS Squadron Recruiting Page for the 229th

https://forums.eagle.ru/showthread.php?t=267081

 

For details see our website at:

http://1stcavdiv.forumotion.net/

Link to comment
Share on other sites

  • 3 months later...

Anyone having issues getting the script to work since last update? I have the lua in C:\users\\saved games\dcs\scripts\hooks and in the editor I have copied word for word from this thread into 3 different trigger's just like in the video. The slots remain active no matter what I do. It doesn't even look like the script is running. Has something changed recently?

Link to comment
Share on other sites

SimpleScriptBlocker. 104th, help!

 

Hey all. I cannot get it to work and was wondering if anyone uses it and might be able to help me.

 

I'm trying to block some slots from being used by people in multiplayer until a base is captured. I placed the lua file in my scripts/hooks folder in both saved and beta install Whenever I test in MP, I can still occupy all slots. I did do the DO SCRIPT actions as well, and even his sample heli mission doesn't work for me and author made that. IF there's another way to do it, that'd be helpful too. 104th server uses it even now so I know it's possible. I just don't know what I'm doin wrong, or what workaround they're using.

Link to comment
Share on other sites

@remus77

 

I think it would be simpler to write your own dedicated server script.

 

Keep in mind that the server can only communicate with the mission environment via user flags (well, at least that's the simplest approach).

 

First off, you need a way to signal when the base has been captured, I'd use a flag for this (handled by either ME trigger or script, your choice).

 

You could then have the dedicated server script check the value of said flag... if the flag has an arbitrary "base captured" value, kick the joining player back to spectators.

 

 

Here's the idea (required fields marked in red, do not remove any quotation marks):

 

local Callback_Table = {} [color="blue"]-- A callback table is required for the script to work[/color]

function Callback_Table.onGameEvent(eventName, playerID, slotID)  [color="blue"]-- This function will be called every time a server event happens[/color]
        
        if eventName == "change_slot" and slotID ~= nil and slotID ~= '' and playerID ~= nil then [color="blue"]-- Check whether a player has changed slot, check whether it's a spectator slot, also, check for nil values[/color]
           
           if net.dostring_in('server', " return trigger.misc.getUserFlag(\"[color="Red"]Flag name[/color]\"); ") ~= nil then 
              
              local CaptureFlag = net.dostring_in('server', " return trigger.misc.getUserFlag(\"[color="Red"]Flag name[/color]\"); ") [color="blue"]-- Makes the server return the value of a mission environment flag[/color]
           
              if CaptureFlag == "[color="Red"]Flag value when base is captured[/color]" then [color="Blue"]-- Checks whether the flag has the "base captured" value[/color]
              
                 local Player_List = net.get_player_list()
              
                 for PlayerIDIndex, playerId in pairs( Player_List ) do
                  
                     local Player_Info = net.get_player_info( playerId )
                     
                     if Player_Info.slot == slotID and playerID == playerId then
                     
                        net.force_player_slot(playerId, 0, '') [color="Blue"]-- This forces the player attempting to enter the blocked slot back to spectators[/color]
                     
                        net.send_chat_to(Unit_Name.." DISABLED!", playerId)
                        net.send_chat_to("CHOOSE ANOTHER SLOT!", playerId)
                     end
                 end
              end
           end   
        end
end


DCS.setUserCallbacks(Callback_Table )

 

Btw, this dedicated server script must be placed in C:\Users\Your Username\Saved Games\DCS.openbeta\Scripts\Hooks


Edited by Hardcard
Link to comment
Share on other sites

@remus77

 

I think it would be simpler to write your own dedicated server script.

 

Keep in mind that the server can only communicate with the mission environment via user flags (well, at least that's the simplest approach).

 

First off, you need a way to signal when the base has been captured, I'd use a flag for this (handled by either ME trigger or script, your choice).

 

You could then have the dedicated server script check the value of said flag... if the flag has an arbitrary "base captured" value, kick the joining player back to spectators.

 

 

Here's the idea (required fields marked in red, do not remove any quotation marks):

 

local Callback_Table = {} [color="blue"]-- A callback table is required for the script to work[/color]

function Callback_Table.onGameEvent(eventName, playerID, slotID)  [color="blue"]-- This function will be called every time a server event happens[/color]
        
        if eventName == "change_slot" and slotID ~= nil and slotID ~= '' and playerID ~= nil then [color="blue"]-- Check whether a player has changed slot, check whether it's a spectator slot, also, check for nil values[/color]
           
           if net.dostring_in('server', " return trigger.misc.getUserFlag(\"[color="Red"]Flag name[/color]\"); ") ~= nil then 
              
              local CaptureFlag = net.dostring_in('server', " return trigger.misc.getUserFlag(\"[color="Red"]Flag name[/color]\"); ") [color="blue"]-- Makes the server return the value of a mission environment flag[/color]
           
              if CaptureFlag == "[color="Red"]Flag value when base is captured[/color]" then [color="Blue"]-- Checks whether the flag has the "base captured" value[/color]
              
                 local Player_List = net.get_player_list()
              
                 for PlayerIDIndex, playerId in pairs( Player_List ) do
                  
                     local Player_Info = net.get_player_info( playerId )
                     
                     if Player_Info.slot == slotID and playerID == playerId then
                     
                        net.force_player_slot(playerId, 0, '') [color="Blue"]-- This forces the player attempting to enter the blocked slot back to spectators[/color]
                     
                        net.send_chat_to(Unit_Name.." DISABLED!", playerId)
                        net.send_chat_to("CHOOSE ANOTHER SLOT!", playerId)
                     end
                 end
              end
           end   
        end
end


DCS.setUserCallbacks(Callback_Table )

 

Btw, this dedicated server script must be placed in C:\Users\Your Username\Saved Games\DCS.openbeta\Scripts\Hooks

 

Not sure how you would write this up as you can't assign a flag name. You can set value of Flag# to another value that's about it. I take it to mean Flag_Name = 100 if value = 0 then slot is block set it to anything else slot is open correct?

Link to comment
Share on other sites

Not sure how you would write this up as you can't assign a flag name.

 

Custom flag names can be assigned as long as they are scripted.

But, anyway, even if you're working with ME flags (which have a number as name), the server script I posted would still work...just give the ME flag number as name.

 

The only thing that's missing in the script are the specific slot checks (in case the user is only interested in blocking specific slots when the base is captured)


Edited by Hardcard
Link to comment
Share on other sites

  • 1 month later...

Is there a specific way I can use the UUID used in the commander slot to limit an aircraft slot to a specific player?

 

I would like to hard set specific liveries for specific players. Is there a way I can do this using this script?

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

@OzDeaDMeaT

You can tweak the script I posted above, so it kicks specific players back to spectators whenever they choose slots that aren't reserved for them.

 

Also, specific liveries can be assigned to specific units, if you combine this with player name checks, then you can assign them to specific players as well.

You'll need to modify the group template table of the relevant units (also, you need to know the valid enumerator for each livery).


Edited by Hardcard
Link to comment
Share on other sites

  • 4 weeks later...

Uploaded a new version a few days ago. If you had trouble getting it to work, try the latest version

 

Sent from my HD1903 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

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