Open metita opened 5 years ago
This is probably not possible in GoldSource due to how the impulse command is implemented.
The client has a command handler that converts the first argument to an integer (meaning * is converted to 0) The commands are handled in a way that makes getting a list of them impossible, so either you'd need to create a separate list of descriptions (which can become outdated) or rework it to use interfaces, which is a fair amount of work and does not work with plugins.
Changing the client code to support passing the string argument is impossible because the value is stored in usercmd_t
instances, which are sent by the engine to the server.
You could assign a special impulse command code but if any mods/plugins are using it it will conflict.
Relevant code at: Client: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/cl_dll/input.cpp#L509 https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/cl_dll/input.cpp#L726 Server: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/player.cpp#L3429
An assistance command could still be added, listing the main impulses implemented in each game. Either server-cide (as some internal commands in the "pfnClientCommand" hook), or a client-side (something like "impulse(s)list" or "impulseshelp").
Then, once triggered, the client will see something like: List of available impulses for game "Half-Life": 99 - Display VALVe's logos at the right-side top ("Half-Life", "Sierra", "VALVe"). 100 - Enable/Disable the flashlight. 201 - Make a decal (spray/tag). etc.
This kind of help could even be added for the commands listed in the game binaries, in the "pfnClientCommand" hook (that I said above, with commands like "vote", "votemap", "listmaps", "timeleft", "listplayers", etc.). In order to list those ones to the players because they are not supposed to know them (since a few are not client-side and not listed as predefined command suggested from console), so players have to divine them, or be aware, which is annoying.
An assistance command could still be added, listing the main impulses implemented in each game. Either server-cide (as some internal commands in the "pfnClientCommand" hook), or a client-side (something like "impulse(s)list" or "impulseshelp").
Then, once triggered, the client will see something like: List of available impulses for game "Half-Life": 99 - Display VALVe's logos at the right-side top ("Half-Life", "Sierra", "VALVe"). 100 - Enable/Disable the flashlight. 201 - Make a decal (spray/tag). etc.
This kind of help could even be added for the commands listed in the game binaries, in the "pfnClientCommand" hook (that I said above, with commands like "vote", "votemap", "listmaps", "timeleft", "listplayers", etc.). In order to list those ones to the players because they are not supposed to know them (since a few are not client-side and not listed as predefined command suggested from console), so players have to divine them, or be aware, which is annoying.
Agreed, seems a good feature to be added. Thanks for contributing to this Feature request, appreciated :)
Title.