View Issue Details

IDProjectCategoryView StatusLast Update
0000408ServerServerpublic2023-02-01 02:03
ReporterVortrex Assigned To 
PrioritylowSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Platformx64OSWindowsOS Version10
Summary0000408: Dynamic CVars
Description

(Originally suggested by PerikiyoXD)
There's no way of changing CVars by default on the console.

cvar set UniqueStuntJumps 1
[cvar] UniqueStuntJumps = 1

cvar get UniqueStuntJumps
[cvar] UniqueStuntJumps = 0

Scripting API has some specialized functions for on-the-fly toggling:

setTrafficEnabled
setTrainsEnabled
setCiviliansEnabled

Another approach could be:

setCVar("traffic", 0);
setCVar("trains", 1);
setCVar("planes", 0);
TagsNo tags attached.
Game

Activities

Vortrex

2022-06-17 12:17

administrator   ~0000269

This would also require resyncing the updated CVar to the client.

The effects of some cvars may not be able to be changed without a reload of the game, so those might need to be marked as read-only somehow.
If they aren't readonly (and the server updates the cvar), incoming clients will receive the new one when connecting and their game will be set differently than the already connected players.

PerikiyoXD

2022-06-17 12:20

reporter   ~0000270

CVars are set once but those might be set only by the server on demand. Compatibility or stability might depend on the CVar.

Vortrex

2023-02-01 02:02

administrator   ~0000337

So I'm thinking that a "read-only" state to the CVar system in Galactic might solve this issue

The internal function to set a CVar:

bool Set(const GChar* pszName, const GChar* pszValue, bool bCreate);

Perhaps a 4th arg like bool bReadOnly, and of course a bool member in the CVar class.
Using true for that new arg when calling to set the initial cvars from config when the server starts.

And an internal util function would be helpful:

bool IsReadOnly(const GChar* pszName);

This way we can have a server.setCVar in the scripting API without being able to modify the ones that can't (shouldn't?) be changed.

Issue History

Date Modified Username Field Change
2022-06-17 12:12 Vortrex New Issue
2022-06-17 12:17 Vortrex Note Added: 0000269
2022-06-17 12:20 PerikiyoXD Note Added: 0000270
2023-02-01 02:02 Vortrex Note Added: 0000337