tuliomir Posted August 8, 2021 Share Posted August 8, 2021 I'm borrowing an idea from the mod "Fast Keys" here.  I want to bind a key, say, F1 to the "Walk To" action. Waaay better than trying to right-click and hope it works while being chased by a horde and trying to dodge the translucent bushes at the same time 😱 </panic>  Looking at the source code available I can imagine something along the lines of... local KEY_WALK = { name = "Walk To", key = Keyboard.KEY_F1, } if ModOptions and ModOptions.AddKeyBinding then ModOptions:AddKeyBinding("[Player Control]",KEY_WALK) end local function KeyUp(keynum) local specificPlayer = getSpecificPlayer(0) if specificPlayer ~= nil then if keynum == KEY_WALK.key then -- F1 ISWorldObjectContextMenu.WHAT_SHOULD_I_PUT_HERE?(0) end end end Events.OnKeyPressed.Add(KeyUp); Can someone shine a light here? I'm at a loss of where to search for this "WHAT_SHOULD_I_PUT_HERE" function that calls the "Walk To" action.  Thanks in advance! Link to comment Share on other sites More sharing options...
Tchernobill Posted September 2, 2021 Share Posted September 2, 2021 (edited) Hi tuliomir, I looked at the walkToAction in there and found it was using the action of WalkToTimedAction.lua That one requires a square as target. I found the Mouse:getX and getY functions from https://projectzomboid.com/modding/ Then at the same place I found IsoUtils.XToIso that I was not able to use properly. With luck they were used ~properly by DebugContextMenu.lua. Just the zoom management is wrong (I'd guess obsolete) and I was lucky to find it fast enough. That was it for the target square. I added a way to bypass the end of the current move action when we start the next and the result is here: https://steamcommunity.com/sharedfiles/filedetails/?id=2591232239 Edited September 2, 2021 by Tchernobill text construction needs clear articulation Link to comment Share on other sites More sharing options...
tuliomir Posted September 7, 2021 Author Share Posted September 7, 2021 So happy to see this implemented! Thanks a lot, @Tchernobill!  Link to comment Share on other sites More sharing options...
Raven-14 Posted October 25, 2021 Share Posted October 25, 2021 On 9/1/2021 at 8:25 PM, Tchernobill said: Hi tuliomir, I looked at the walkToAction in there and found it was using the action of WalkToTimedAction.lua That one requires a square as target. I found the Mouse:getX and getY functions from https://projectzomboid.com/modding/ Then at the same place I found IsoUtils.XToIso that I was not able to use properly. With luck they were used ~properly by DebugContextMenu.lua. Just the zoom management is wrong (I'd guess obsolete) and I was lucky to find it fast enough. That was it for the target square. I added a way to bypass the end of the current move action when we start the next and the result is here: https://steamcommunity.com/sharedfiles/filedetails/?id=2591232239 Is it possible to make a mod, that if u are holding W your character always walks forward to your mouses pointer and stops moving when u let go. Then when holding S down u walk backwards but still follows your mouse pointer and faces your mouse pointer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now