World Event: OnCvar(String/Color/Number)Changed

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

World Event: OnCvar(String/Color/Number)Changed

Post by Major Cooke »

Whenever a cvar changes, this function would be called and would give access to the name of the cvar, and the value changed.

This would allow for, say, an iterator to run and find specific entities and change a value on them. I.e. say we have a separate real-time difficulty adjustment option which allows changing the aggressiveness of custom AI. Using GetCvar often tends to drag down performance, whereas access to a local variable seems a lot cheaper.

I also suggest an actual event because not everyone would realize that they would otherwise have to build a NetworkEvent-managed CVar changer, and perform a lot of string splitting just to make it work for strings in particular.

User cvars would include the player number 0-7 while server cvars would set it to -1.
User avatar
Rachael
Posts: 13555
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: World Event: OnCvar(String/Color/Number)Changed

Post by Rachael »

I'm honestly a bit dubious about this one.

Part of me wants to enable this only for CVARs that get defined in CVARINFO, unless the CVAR itself has CVAR_SERVERINFO or CVAR_USERINFO set on itself.

Or - enable it for any CVAR but only in the UI context, which means it would require net events in order to affect the playsim.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: World Event: OnCvar(String/Color/Number)Changed

Post by Graf Zahl »

Agreed. Aside from that it's also rather invasive. The devil is buried in the details which I'd rather not deal with.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: World Event: OnCvar(String/Color/Number)Changed

Post by Major Cooke »

CVARINFO is actually just what I need it for. But I understand. I'll just incorporate a network event version for my menu items.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”