Ravenfield

Ravenfield

Custom Keybinds for Mutator Mods
 This topic has been pinned, so it's probably important
Gaheris96  [developer] 9 Jul, 2020 @ 3:00pm
IF YOU ARE A MODDER
This mod allows you to easily use custom keybinds by converting keys and keycodes as string to KeyCode

How to use it :
function YourScript:Start() self.script.StartCoroutine("initCoroutine"); end function YourScript:initCoroutine() coroutine.yield(WaitForSeconds(1)) local go = GameObject.Find("Custom Keybinds"); if(go != nil) then local customKB = ScriptedBehaviour.GetScript(go); local key = self.script.mutator.GetConfigurationString("customKey"); if(key != nil or key != "") then local kcode = customKB:getKeyCodeFromCustomKey(key); if(kcode ~= nil and kcode ~= KeyCode.None) then self.customKey = kcode; end end end end

and then you can use that KeyCode as any other KeyCode :

if(self.customKey ~= nil and Input.GetKeyDown(self.customKey)) then print("Hello World !") end
< >
Showing 1-1 of 1 comments
Chai 14 Jul, 2020 @ 3:51am 
Cool
< >
Showing 1-1 of 1 comments
Per page: 1530 50