Page 1 of 1

dynamically change i_timescale cvar [Zscript]

Posted: Tue Dec 12, 2017 3:58 am
by GiveOneMoreChance
Hello, in new gzdoom added i_timescale cvar. I try change this cvar dynamically but cvar always reset to 1.
In player tick
Super.tick()
If (CountInv("TestItem")) Cvar.GetCvar("i_timescale").SetFloat(0.5)
else Cvar.GetCvar("i_timescale").SetFloat(1.0)
If change code to
Super.tick()
Cvar.GetCvar("i_timescale").SetFloat(0.5)
All works fine

Re: dynamically change i_timescale cvar [Zscript]

Posted: Tue Dec 12, 2017 4:00 am
by Rachael
No. Changing the time scale is not permitted - it's a debug variable, nothing more. There's a reason why it was not included in the patch notes. (Its existence is not a secret, but I discourage any active documentation of it because it's meant to diagnose issues with things like model rotations and interpolations and such - things only developers right now will find useful)

Many things have to happen before the mod can change the time scale.

Also, only custom defined [wiki]CVARINFO[/wiki] CVars can be changed, not internal ones.