Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 3.0
Source Code

View Revisions: Issue #2715 All Revisions ] Back to Issue ]
Summary 0002715: Scripting access to dmflags and co
Revision 2016-04-30 12:41 by Dusk
Description One of the major uses of ConsoleCommand is to have mods set dmflags. So in order to remove ConsoleCommand we need to provide a proper way for mods to affect gameplay settings.

I managed to put together an interface that allows mods to specify values for gameplay settings while allowing the server admin to override the mods' choices. ACS can set a dmflag to be either enabled, disabled or leave it as it is (leave it as "default", which means it falls back to the actual CVar value).

Example:

script 1 OPEN
{
        SetGameplaySetting(GS_NOMONSTERS, GS_ENABLED);
        SetGameplaySetting(GS_INFINITEAMMO, GS_DISABLED);
        SetGameplaySetting(GS_NOJUMP, GS_DISABLED);
        SetGameplaySetting(GS_COMPAT_LIMITEDAIRMOVEMENT, GS_ENABLED);
}


This enables no-monsters mode and limited airmovement. It also disables infinite ammo and no jump.

Some issues, though:
* should the mod really be allowed to disable a setting like this? Maybe all we should provide is default and enabled.
* I still think that compat_limitedairmovement should be inverted. We should really decide on dmflags because this will sort of lock them
* The patch currently needs to change all declarations of the affected flag CVars, because C++03 doesn't have constructor deferring (I could add a constructor overload to FFlagCVar otherwise).
Revision 2016-04-30 12:37 by Dusk
Description One of the major uses of ConsoleCommand is to have mods set dmflags. So in order to remove ConsoleCommand we need to provide a proper way for mods to affect gameplay settings.

I managed to put together an interface that allows mods to specify values for gameplay settings while allowing the server admin to override the mods' choices. ACS can set a dmflag to be either enabled, disabled or leave it as it is (leave it as "default", which means it falls back to the actual CVar value).

Example:

script 1 OPEN
{
        SetGameplaySetting(GS_NOMONSTERS, GS_ENABLED);
        SetGameplaySetting(GS_INFINITEAMMO, GS_DISABLED);
        SetGameplaySetting(GS_NOJUMP, GS_DISABLED);
        SetGameplaySetting(GS_COMPAT_LIMITEDAIRMOVEMENT, GS_ENABLED);
}


This enables no-monsters mode and limited airmovement. It also disables infinite ammo and no jump.

Some issues, though:
* should the mod really be allowed to disable a setting like this? Maybe all we should provide is default and enabled.
* I still think that compat_limitedairmovement should be inverted. We should really decide on dmflags because this will sort of lock them






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker