Closed CaptainPRICE closed 7 years ago
Movement is not done by "simulating" key presses. It is done via https://wiki.garrysmod.com/page/CUserCmd/SetForwardMove
Please fix it as soon as possible!
I am going to paste some brief details from the source code here:
Running on Development (current dev) branch, WITHOUT ANY ADDONS (launched with these command-line options: -noaddons -noworkshop
). Playing on Sandbox gamemode with gm_flatgrass map.
I have tried this in both, singleplayer and multiplayer. I have verified integrity of game files, also restored default game options.
Even with NO other hooks, it still doesn't work (this was just to confirm that no other CreateMove
hook is returning a non-nil value which would make our hook not run at all, that was not the case).
Even with clearing buttons every time before setting, it still does not work.
Even with returning true / false / nil value in CreateMove hook, it still does not work.
Even without localized function calls, it still does not work.
Simple and short said: I have literally tried it in every single way possible, it just doesn't work. Also, this has been confirmed as "bug" by a few friends of mine.
Movement is not done by "simulating" key presses. It is done via https://wiki.garrysmod.com/page/CUserCmd/SetForwardMove
Ok, I see. But, someone will have to fix GMod wiki about CreateMove
though...
edit To be more specific: Some functions are documented wrong, and some are incomplete, and there are no examples (just SelectWeapon function has one).
Details
CUserCmd.SetButtons
function does not work with some bits (IN_FORWARD, etc).Steps to reproduce
As an example, go ahead and use this script I created just for this case: createmove-setbuttons-issue.lua Comments from the source code tells you pretty much everything, just run the script and read through it. It is pretty simple to reproduce this bug. Just try to make your player run forward in CreateMove with SetButtons functions, and you will find yourself stuck, because it just won't work. There is kind of old thread on the Facepunch forums (link), but it doesn't have much details though.