Page 1 of 1

How to make item usable?

Posted: 15 Nov 2017, 08:02
by andrej.chudoba
Greetings, I would like to know how to tell the game that the specific item should be usable from invenory (to have the "use" option on right click).. This seemed like an easy thing at first but I can't get it working in the game. I'm trying to create an item that would open UI window similar to the cooking/repair UI from call of misery, so I copied the item section of field cooking stove in items_cooking.ltx, renamed it, add section for it in itms_manager.ltx, itms_manager.script (pointing to ui_itm_test script), and in actor_effects_data.script. But still the only thing I can do with it is drop it. :)
So what is the deciding factor telling the game that the item should have the "use" ability?
Thanks in advance!

Re: How to make item usable?

Posted: 19 Nov 2017, 05:15
by Gazprom
for making an item usable, but only as a "trigger" for showing up your UI, in configs/misc/items.ltx copy-paste the "bread" section, and remove its attributes upon use (boosts etc.). Then in bind_stalker just search for the anabiotics effect in a specific seciton (I don't remember the name, something like "on_item_use"). From there, you can show up your UI. Then after the UI is closed you can script spawn the item, as it has disappeared upon its first use. In this way you'll always have your trigger item in your inventory, unless you drop it.