What you should do is add a second function that remembers if the action command would do something custom in one of your scripts, like with a custom entity.
So you would have two functions:
- game:get_command_effect("action"): returns the built-in action or nil. This function is in the engine. There is is game:set_command_effect() because it is the engine who decides.
- game:get_custom_command_effect("action") and game:set_custom_command_effect("action", "something"): when the built-in action is nil, returns if your script would do something. These functions is not in the engine, they will be added by your quest. Call game:set_custom_command_effect() from your custom entity script.
And it is only when both of them return nil that nothing happens.
Actually, these additional functions game:get/set_custom_command_effect() already exist in ZSDX, I use them for the HUD.Indeed, the action icon of the HUD displays more state than just the built-in effect of the action command.
Last remark: if the player has the ability to run, the action command can be used to run. Unfortunately, the engine still returns nil in this case when you call game:get_command_effect("action"). I condiser this as a bug.