Setting key binds

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
dbfuru
Posts: 1
Joined: Wed Sep 01, 2010 1:06 am

Setting key binds

#1 Post 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!

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Setting key binds

#2 Post 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!
<DarkGod> lets say it's intended

Post Reply