Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Author: yakuzadeso & Elec0
- --------------------------------------------------------------------------------
- --Settings
- --Whether to end slow mo with cool exit or not, right before touching the ground, right before exiting the dash.
- EndSlowMoWithCoolExit = true --Set to false if you want the dash to end at the actual end of the dash ability, or end when the dash key is released. Useful for inf swift mod.
- -- How many ms the initial period of higher time dilation will last
- DashStartExtraSlowTime = 500
- -- How many ms the main period of slow-mo lasts for, after the extra slow-mo ends
- DashSlowTime = 1000
- -- What time dilation factor the beginning of the dash has (lower is slower)
- ExtraSlowFactor = 0.1
- -- What time dilation factor the rest of the dash has (after ExtraSlow segment)
- SlowFactor = 0.5
- --------------------------------------------------------------------------------
- --Keybinds
- --Main Key
- Key = Key.F --Change "F" to whatever you want. Valid keys on the mod's page.
- --ModifierKey
- ModifierKey = ModifierKey.ALT -- Change "ALT" to whatever you want. Valid Modifier Keys on the mod's page.
- --------------------------------------------------------------------------------
- local BipedPlayer = nil
- local GameplayStatics = nil
- local Enabled = true
- RegisterKeyBind(
- -- [snip]
- )
- function SlowMoSwift()
- if Enabled then
- print("SlowMoSwift is On!")
- else
- print("SlowMoSwift is Off!")
- end
- GameplayStatics = StaticFindObject("/Script/Engine.Default__GameplayStatics")
- RegisterHook("/Game/Pawn/Shared/StateTree/BTT_Biped_ShadowBlink_2.BTT_Biped_ShadowBlink_2_C:ReceiveExecute",
- function()
- if BipedPlayer.bInCombatMode and Enabled then
- StartSlowMo()
- end
- end)
- -- No matter what, the slow-mo ends when the ShadowBlink is finished
- RegisterHook("/Game/Pawn/Shared/StateTree/BTT_Biped_ShadowBlink_2.BTT_Biped_ShadowBlink_2_C:ExitTask",
- function()
- EndSlowMo()
- end)
- RegisterHook(
- "/Game/Pawn/Shared/StateTree/BTS_Biped_TopLevel.BTS_Biped_TopLevel_C:InpActEvt_DodgeAndBlinkButton_K2Node_CustomInputActionEvent_25",
- function()
- if not EndSlowMoWithCoolExit then
- EndSlowMo()
- end
- end)
- end
- function StartSlowMo()
- GameplayStatics:SetGlobalTimeDilation(BipedPlayer, ExtraSlowFactor)
- StartSlowMoDelays()
- end
- function StartSlowMoDelays()
- ExecuteWithDelay(math.floor(DashStartExtraSlowTime), function()
- StartSlowMo2()
- end)
- if EndSlowMoWithCoolExit then
- -- I think, for user customization, that having the overlapping time segments is less intuitive than having 2 sequential
- -- ones. I've found people get confused at the overlap more easily. Just my opinion, though.
- ExecuteWithDelay(math.floor(DashStartExtraSlowTime + DashSlowTime), function()
- EndSlowMo()
- end)
- end
- end
- function StartSlowMo2()
- GameplayStatics:SetGlobalTimeDilation(BipedPlayer, SlowFactor)
- end
- function EndSlowMo()
- GameplayStatics:SetGlobalTimeDilation(BipedPlayer, 1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement