dynamically change i_timescale cvar [Zscript]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

dynamically change i_timescale cvar [Zscript]

Postby GiveOneMoreChance » Tue Dec 12, 2017 4:58 am

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
GiveOneMoreChance
 
Joined: 10 Aug 2017

Re: dynamically change i_timescale cvar [Zscript]

Postby Rachael » Tue Dec 12, 2017 5:00 am

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 CVARINFO CVars can be changed, not internal ones.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle


Return to Scripting

Who is online

Users browsing this forum: SanyaWaffles and 4 guests