Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Purpur on December 19, 2013, 02:56:35 AM

Title: Execute command by clicking an inventory item
Post by: Purpur on December 19, 2013, 02:56:35 AM
Hi there!

I have one question.
In one of our puzzles, the actor is supposed to play an animation right after the player clicks on a specified inventory item.

But as far as i know, the only script regarding the inventory items is the "items.items" script and i don't see any possibilities to manage these.

So, is there a way to run a script which says something like: if you click on this item, then do this and that?
It's not that important if it has to be a left- or a right click. Main thing is, i want to somehow interact with this single inventory item.

I really hope someone got an idea. Thanks in advance! :)
Title: Re: Execute command by clicking an inventory item
Post by: metamorphium on December 19, 2013, 08:34:42 AM
Of course it's possible. Simply implement a custom event for that item and call it from LeftClick in Game.script.

If you post your on "LeftClick" handler and script attached to the item in question I can help more.
Title: Re: Execute command by clicking an inventory item
Post by: Purpur on December 27, 2013, 06:43:32 PM
Sorry for my late response.
But thank you very much, we got it! :)

PS: I wish you a happy new year.