Custom Commands?

Started by The Pink Bunny, April 12, 2016, 06:30:42 PM

Previous topic - Next topic
Is it possible to add a command to the list of game commands? (like "action","item_1","pause", etc.) I know I can just use game:on_key_pressed() or main:on_key_pressed(), but I want to be able to create a new command that works with things like game:set_command_keyboard_binding(). It would be great if I could look at the actual game object code to figure it out, but I can't find it in the data files or documentation.

The built-in commands are currently limited to the ones in the documentation, so no. But it is not that hard to add custom ones and detect them in game:on_key_pressed() as you suggest. Here is an example: https://github.com/christopho/zelda_roth_se/blob/dev/data/scripts/game_manager.lua.

Okay, thanks for the help! (and the fast reply!)