here's a lot you can include within each if and else block. If you can find the appropriate CET commands, you can add visual effects. Alternatively, you can make the code check the character's state, enabling the time slowdown automatically when you're low on health or if health changes too dramatically
First, find "init.lua" in Cyberpunk 2077\bin\x64\plugins\cyber_engine_tweaks\mods\SlowMoModV2. Then, open it with a text editor, paste and replace all the code. In the game, open CET ( for 2.0), and you will now see "SlowMo" under bindings. Note: Don't change the indentation of the code.
Enabling and disabling slowmo once causes scanner/hack time slowdown to disappear until save game reload or restart. Looks like this slowmo script prevents the game from managing time scale after using it. Any way to fix this?
Try this, and Yes ,conflicts with other slowdown effects.Therefore, it's not advisable to implant other time-rela cyberwares, and hacking actions that would slow down the player character. but in case of a conflict, pressing the hotkey twice would resolve it.
local time = 0
function toggleSlowMo() local dilation local m local ignoreFlag local duration
if time == 0 then dilation = 0.01 time = time + 1 m = "enter" ignoreFlag = true duration = 100
print("Time has been slowed") else dilation = 1 time = 0 m = "exit" duration = 1 ignoreFlag = false
print("Time has been restored") end
local soundEventName = 'time_dilation_sandevistan_' .. m
Game['gameObject::PlaySoundEvent;GameObjectCName'](Game.GetPlayer(), soundEventName) Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration) Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag) end
I managed to get the Player slowed when enabling just by removing the "ignoreFlag" lines (local ignoreFlag / ignoreFlag = true and ignoreFlag = false / Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag)) it's working for me, hope it helps :) Also, if someone find the way to add the Sandevistan visual effect, fell free to add it here !
I'm trying to use this .lua to replicate the slow time effects of the "MoorE Technologies Sandevistan" from the "Time Dilation Overhaul" mod. That specific sandy would also slow down the player along with the bullets from weapons like the Militech M-10AF Lexington and other normal pistols and assault rifles, smg's etc.
For example, I could aim at an npc's head, shoot any gun and then watch the bullet travel in slowmo and then the hit registered when the bullet finally hit the target depending on the dilation. (I used 95%+ slow) Where as after 2.0 this now only happens with smart guns. (Most other guns are now instant hit no matter what.)
Does anyone know if it is still possible, what do we need to put in the .lua to achieve the same thing to slow the bullets and hitreg?
The player won't be slowed.(If you prefer not to, change the "true" in "ignoreFlag = true" to "false".and consider a more suitable value for 'dilation' (e.g., 0.01 for 1% speed))
Unlike the previous code, this should work even if you're pressing other keys at the same time.
Please note that only the player character's speed won't be affected. Firearms have their own firing rates. So, after activation, melee attacks can proceed at a normal pace, but using firearms would require waiting for the firing rate or continuously reactive "the bullet time". The code "dilation = 0.01" controls the degree of slowdown. If using firearms, this value can be changed to 0.2 or even higher.
Be cautious if you use this in the DLC, especially during the extended fighting sequences at the beginning. These levels are heavily scripted, may cause the game to crash
I have also added Sandevistan's sound effects to this mod.
local time = 0
function toggleSlowMo() local dilation local m local ignoreFlag local duration
if time == 0 then dilation = 0.01 time = time + 1 m = "enter" ignoreFlag = true duration = 100
print("Time has been slowed") else dilation = 1 time = 0 m = "exit" duration = 1 ignoreFlag = false
print("Time has been restored") end
local soundEventName = 'time_dilation_sandevistan_' .. m
Game['gameObject::PlaySoundEvent;GameObjectCName'](Game.GetPlayer(), soundEventName) Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration) Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag) end
A line in the init.lua code, which is not effective:-- registerInput("modname_actionname", "slowmo", toggleSlowMo) . This can modify the hotkey behavior to: press to slow down, release to restore the original speed. If you prefer this Hold mode, simply remove the "--" and add "--" in front of the code below it (or delete them directly).
Just a question, is there an event or callback fired by Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration) when the `duration` parameter expires? That way, it could be used like an "ability" with a short set duration whereby `time` is set to 0 and the correct `soundEventName` is played on exit.
Also, have you tried to contact the mod author so they can fix the filepath in the mod archive? That way, others who are not computer savvy can install using Vortex and enjoy the mod. Or maybe you could upload your variant yourself?
When using sandevistan or kerenzikov there are also slow motion shooting sound effects - it moddifies the sound of each shot and adds kinda echo to it. This doesn't happen when using this mod.
Just in case anyone as dumb as me stumbles across wanting to hold the key instead of toggling, you also have to remove the "end)" at the bottom of the page.
i am using mod organiser 2. when installing, it will state that the filetree is wrong. your folder is likely named "SlowMoModV2" with an init.lua file in it.
Here is the end result of what you need to do to get things to work
@Charlesantoine could easily make a modified version of this file by incorporating it into CET and Native UI, with the ingame MODS selector to configure how slow you want it. From 0.1 to 100. Worth a shot. Then all people'd need to do is download into their VORTEX manager and they'd be golden.
91 comments
local time = 0
function toggleSlowMo()
local dilation
local m
local ignoreFlag
local duration
if time == 0 then
dilation = 0.01
time = time + 1
m = "enter"
ignoreFlag = true
duration = 100
print("Time has been slowed")
else
dilation = 1
time = 0
m = "exit"
duration = 1
ignoreFlag = false
print("Time has been restored")
end
local soundEventName = 'time_dilation_sandevistan_' .. m
Game['gameObject::PlaySoundEvent;GameObjectCName'](Game.GetPlayer(), soundEventName)
Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration)
Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag)
end
-- registerInput("modname_actionname", "slowmo", toggleSlowMo)
registerInput("modname_actionname", "slowmo2.0", function(isKeyDown)
if not isKeyDown then return end
toggleSlowMo()
end)
added Sandevistan's sound effects
thx
local time = 0
function toggleSlowMo()
local dilation
local m
local ignoreFlag
local duration
if time == 0 then
dilation = 0.01
time = time + 1
m = "enter"
ignoreFlag = true
duration = 100
print("Time has been slowed")
else
dilation = 1
time = 0
m = "exit"
duration = 1
ignoreFlag = false
print("Time has been restored")
end
local soundEventName = 'time_dilation_sandevistan_' .. m
Game['gameObject::PlaySoundEvent;GameObjectCName'](Game.GetPlayer(), soundEventName)
Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration)
Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag)
end
-- registerInput("modname_actionname", "slowmo", toggleSlowMo)
registerInput("modname_actionname", "slowmo2.0", function(isKeyDown)
if not isKeyDown then return end
toggleSlowMo()
end)
(local ignoreFlag / ignoreFlag = true and ignoreFlag = false / Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag))
it's working for me, hope it helps :) Also, if someone find the way to add the Sandevistan visual effect, fell free to add it here !
That specific sandy would also slow down the player along with the bullets from weapons like the Militech M-10AF Lexington and other normal pistols and assault rifles, smg's etc.
For example, I could aim at an npc's head, shoot any gun and then watch the bullet travel in slowmo and then
the hit registered when the bullet finally hit the target depending on the dilation. (I used 95%+ slow)
Where as after 2.0 this now only happens with smart guns. (Most other guns are now instant hit no matter what.)
Does anyone know if it is still possible, what do we need to put in the .lua to achieve the same thing to slow the bullets and hitreg?
Here's a video demonstrating what I'm trying to explain.
https://www.youtube.com/watch?v=L5PlnaYhpPg
registerInput
For 2.0
local time = 0
function toggleSlowMo()
local dilation
local m
local ignoreFlag
local duration
if time == 0 then
dilation = 0.01
time = time + 1
m = "enter"
ignoreFlag = true
duration = 100
print("Time has been slowed")
else
dilation = 1
time = 0
m = "exit"
duration = 1
ignoreFlag = false
print("Time has been restored")
end
local soundEventName = 'time_dilation_sandevistan_' .. m
Game['gameObject::PlaySoundEvent;GameObjectCName'](Game.GetPlayer(), soundEventName)
Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration)
Game.GetTimeSystem():SetIgnoreTimeDilationOnLocalPlayerZero(ignoreFlag)
end
-- registerInput("modname_actionname", "slowmo", toggleSlowMo)
registerInput("modname_actionname", "slowmo2.0", function(isKeyDown)
if not isKeyDown then return end
toggleSlowMo()
end)
-- registerInput("modname_actionname", "slowmo", toggleSlowMo)
. This can modify the hotkey behavior to: press to slow down, release to restore the original speed. If you prefer this Hold mode, simply remove the "--" and add "--" in front of the code below it (or delete them directly).Just a question, is there an event or callback fired by
Game.GetTimeSystem():SetTimeDilation(CName"TimeDilation", dilation, duration)
when the `duration` parameter expires? That way, it could be used like an "ability" with a short set duration whereby `time` is set to 0 and the correct `soundEventName` is played on exit.Also, have you tried to contact the mod author so they can fix the filepath in the mod archive? That way, others who are not computer savvy can install using Vortex and enjoy the mod. Or maybe you could upload your variant yourself?
Anyone knows how to add these sound effects?
i am using mod organiser 2. when installing, it will state that the filetree is wrong. your folder is likely named "SlowMoModV2" with an init.lua file in it.
Here is the end result of what you need to do to get things to work
bin/x64/plugins/cyber_engine_tweaks/mods/SlowMoModV2/init.lua
you will need to create bin/x64/plugins/cyber_engine_tweaks/mods/
or if you are manually installing it, put the slowmomodv2 folder inside the mods folder as listed above.
I copied Ezpeasy09's code change and overwrote the original code. Currently in tutorial, slowmo works fine
Doens't show up on CTE. Thanks