-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG - Release] (LUA) RegisterConsoleCommand_ - Console Ignoring Strings #653
Comments
Need feedback from other UE4SS Devs. |
I know UE refers to objects with paths sometimes with single quotes, so those might need to go in double quotes if passed as a console command param, therefore should we only accept double quotes ? |
Indeed, I think in some rare cases single quotes can be in full name paths as well. |
It uses single quotes for certain types of paths. |
I've noticed that all current console related hooks/handlers return the full command string as first callback parameter. |
The dev docs describe the correct behavior for all three different ways of dealing with commands. |
The examples are wrong in the docs, that's where the confusion is coming from I think. |
I'm not sure what "command" means. |
Actually, I'm wrong in my previous comment. |
Same for the ProcessConsoleExec hook, it's intended to be the full command as one param, and then a table of the param contents as another param for convenience. I believe this example is wrong where it says full command is in param[0]: -- Entered into console: CommandExample 1 2 3
-- Output
--[[
Custom command callback for 'CommandExample' command executed.
Full command: CommandExample 1 2 3
Number of parameters: 3
Parameter #1 -> '1'
Parameter #2 -> '2'
Parameter #3 -> '3'
Parameter #0 -> 'CommandExample'
--]] |
I find it kind of weird that ProcessConsoleExec hook gives only the "paramters". If the first callback parameter should be the full command, so user can parse it, Then the CommandsParts argument in the Callback should contain the "command name" as well, otherwise the user HAS to parse the command anyway just to get the command name. |
Yes this is true, we should definitely include the name in CommandParts. |
The only question is, do we break Lua common usage and make it CommandParts[0] to not break any potential mods that rely on CommandParts[1] being the first param to the command ? |
Damn, both not ideal. But I find the second solution worse. |
) * feat: Implement explode_by_occurrence_with_quotes feat: Replace explode_by_occurrence with explode_by_occurrence_with_quotes in all ProcessConsoleExec functions * feat: In RegisterProcessConsoleExecPreHook and RegisterProcessConsoleExecPostHook the callback parameter CommandParts should contain all separated parts of the command, the "command name" as well * docs: Fix and Improve description and examples for RegisterConsoleCommandGlobalHandler, RegisterConsoleCommandHandler, RegisterProcessConsoleExecPreHook and RegisterProcessConsoleExecPostHook * docs: Add function documentation to explode_by_occurrence_with_quotes
Wrapped with "quotes" addition with insensitive casing works wonders and congratulations on the fix! String-spaced values seems to be fixed for now until UE allows more odd input. |
Branch or Release
v3.0.1
d935b5b
Game and Engine Version
probably any
Describe the bug
console does not recognize strings and treats all spaces as a parameter
Mods directory
...
To Reproduce
Expected behavior
strings to be processed properly
"foo bar"
'foo bar'
['foo bar']
none work
spaces and command both act as seperators no matter what
Screenshots, UE4SS Log, and .dmp file
input
>modify Ultra_Dynamic_Sky_C 'Time of Day' 0
output
[Lua] of
Desktop (please complete the following information):
Win10
Additional context...
The text was updated successfully, but these errors were encountered: