Page 1 of 1

Setting key binds

Posted: Wed Sep 01, 2010 1:10 am
by dbfuru
Hello :)

I believe I have successfully implemented the ActorInventory into the example module, and made a weapon and set it to generate in the dungeon, but I can't seem to find out how to bind keys to actions, like (i)nventory, (e)quipment, etc.

I tried looking for these settings in the tome module but I could not find which lua file they were in. If I could see that I might be able to figure it out myself.

Either way I would like to know how to bind keys to actions or what lua file these are stored in.

Thank you very much!

Re: Setting key binds

Posted: Wed Sep 01, 2010 3:39 am
by yufra
It is a bit tricky to set this up, and I think it might benefit from having an interface, say PlayerPickup or PlayerInventory. First you need to look at the "setupCommands" function in tome/class/Game.lua. ToME is already looking for some default commands like SHOW_INVENTORY and WEAR_ITEM, and what these do is determined here. Second you should look at the tome/class/Player.lua and copy over the playerPickup and other functions. That should get you there, but I may be forgetting something. Good luck!