Closed rolfosian closed 4 months ago
The RegisterKeyBind
function is really meant for testing purposes, it's not supposed to be used for gameplay features.
As such, I don't think this feature is necessary, but feel free to try to convince me otherwise.
Ah ok that's a shame. Tbh for my use case it's not strictly required but I would have to first find and then hook quite a few different press/release functions (if they are all even exposed, i found a few so far but not all of them yet) and I might also have to account for any PlayerCharacter changes to re-register those functions if the PlayerCharacter changes i think? instead of being able to simply fire the toggle on a particular key down and then key up.
oh in case you consider toggling to be a loaded term for actual disgusting cheating heres what it actually is
local UEHelpers = require('./mods/shared/UEHelpers/UEHelpers')
function ToggleTwerking()
local PlayerCharacter = StaticFindObject('/Script/FSD.Default__GameFunctionLibrary'):GetLocalPlayerCharacter(UEHelpers.GetWorld())
if PlayerCharacter:GetPropertyValue('isDancing') then
return PlayerCharacter:Server_SetIsDancing(false, 18)
end
return PlayerCharacter:Server_SetIsDancing(true, 18)
end
RegisterKeyBind(Key.F1, function()
ExecuteInGameThread(function()
ToggleTwerking()
end)
end)
i noticed you can dance while pressing different buttons and reviving (which is done by holding the e key) so i thought about syncing it with those by having the callback execute once on key down and once on key up. obviously an edge case but who knows maybe someone else might find some use out of it? lol
Just fyi, you shouldn't need to specify a path for UEHelpers. Are you doing this because you were having problems getting it to work without a path ? If the below doesn't work, then something is wrong.
local UEHelpers = require("UEHelpers")
oh i didnt know that, i just did the relative path cause thats what i did for other modules before in diff folders
I noticed that there is no way to specify the type of key event for
RegisterKeyBind
and it looks like only key down is supported at the moment. Would it be possible/not too much trouble to add support for other events like keyup (key release)?