You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server can't customize which weapons should be available in game. As of now, all weapons are enabled by default, and the only way to change it requires recompiling the game.
Judging by code, this option was meant to be implemented with cvars, probably with CVAR_SYNC flag:
I tested and it's possible via a script like this:
procedureMyGameOnJoin(Player: TActivePlayer; Team: TTeam);
var
i: Integer;
begin// Disable all except deagle and law.for i := 2to13do
Player.WeaponActive[i] := False;
end;
begin
Game.OnJoin := @MyGameOnJoin;
end.
Also there is the SC2 function SetWeaponActive, and the ForceWeapon scripting options. I think that these cover all the advanced needs of this system. But for the simple use case it would be nice to be able to just set enabled weapons at the command line, so I agree with the TODO.
I think just straight up having 14 cvars is the right way to go here (sv_weaponactive1, sv_weaponactive2...). If more control is really needed, the scripting covers it, so all we should do is set the value in the WeaponActive global, and possibly call NetworkServerFunctions.SetWeaponActive if the game has already been started.
I would like to spend a little more time familiarizing myself with WeaponActive and WeaponSel before implementing this, though.
Server can't customize which weapons should be available in game. As of now, all weapons are enabled by default, and the only way to change it requires recompiling the game.
Judging by code, this option was meant to be implemented with cvars, probably with
CVAR_SYNC
flag:opensoldat/server/Server.pas
Lines 714 to 716 in a3aae37
The UI for this is ready in launcher's weapons-settings branch, but functionality is missing.
The text was updated successfully, but these errors were encountered: