People Playground

People Playground

Not enough ratings
Second Slow Motion
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
822.573 KB
29 Aug, 2024 @ 11:22am
29 Aug, 2024 @ 5:03pm
6 Change Notes ( view )

Subscribe to download
Second Slow Motion

Description
Secondary slow-mo (/ fast-mo)

An overly programmed mod for adding a secondary slow motion button.
You can actually set the second slow-mo to any speed, even above 100%.
Meant to replace "Super Slow Motion" by Mr_kWKD and it's unofficial update by Blakary.

Default keys (changeable in settings):
Toggle Super Slow-Motion: H
Set Super Slow-Motion Speed: L

"Why does this use System.Reflection? Is this a virus?"

- Short answer: This modifies a variable that could not be done without it.

- Long answer:
The speed for slow motion is in a type called Global. What this mod does is that it uses reflection to modify this read-only variable.

C# code for people who know the language:

// TimeScaleTo is the variable that contains the slowmo speed. FieldInfo timeScaleTarget = typeof(Global).GetField("timeScaleTarget", BindingFlags.Instance | BindingFlags.NonPublic); // Uses reflection to get the timeScaleTarget variable. timeScaleTarget.SetValue(Global.main, TimeScaleTo); // Global.main is the instance used throughout the game. Setting it this way allows us to bypass this variable being readonly.

"What about UserPreferenceManager?"

This is only used to get the vanilla slow-mo speed.
Which is

UserPreferenceManager.Current.SlowMotionSpeed

in code.

"Is this open-source?"

It technically is.
Go to your steam library (C:\Program Files (x86)\Steam, or wherever else you installed PPG), then it's in steamapps\workshop\content\1118200\<workshop id>

I included the Visual Studio solution, the .csproj file, and everything else. Feel free to check it out.

(You can do this with nearly every mod by the way.)
3 Comments
Reycko  [author] 5 Jul @ 1:21pm 
R4ndomUser567 what doesn't work? this is fine in the latest beta
R4ndomUser567 1 Jun @ 7:25am 
Kinda rude to say that its "meant to replace" a different mod considering this doesn't do anything, unless its broken from a new update.
scammer 21 Mar @ 9:33pm 
Not working :steamthumbsdown: