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 3: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
If (CountInv("TestItem")) Cvar.GetCvar("i_timescale").SetFloat(0.5)
else Cvar.GetCvar("i_timescale").SetFloat(1.0)
If change code to
All works fine
Joined: 11 Aug 2017

Re: dynamically change i_timescale cvar [Zscript]

Postby Rachael » Tue Dec 12, 2017 4: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
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Return to Scripting

Who is online

Users browsing this forum: drfrag and 0 guests