Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Jigen Daisuke on Fri 15/12/2017 10:57:13

Title: Use_Inventory mouse-mode Item cursor problem (on standard template)
Post by: Jigen Daisuke on Fri 15/12/2017 10:57:13
Hi guys' I'm new to the forum and I'm developing my first game.
I would like to change the behaviour of the Use inventory item cursor (I'm using AGS 3.4.0 with the standard template, where the mouse-mode change right-clicking).

Explaination:
When you don't have an object active in the inventory you don't see the use_inventory cursor when you right-click.
When you use an inventory item to do some action (e.g. The player use a screwdriver on a screw) the game activate the object cursor of mouse-mode "Use inventory" and you can click with this on hotspot/objects/etc to interact.
After using the object you can be in two situations:

1-You lose the object--->the game deactivate the "Use inventory" mouse mode and hide the cursor so when you right click it's not available.
2-You do NOT lose the object--> the "Use inventory" mouse mode is still active when you right click and the cursor mantain the shape of the object. 

Request: Is it possible to force the game on ALWAYS deactivate the "Use inventory" mouse mode after using an object? (like the situation 1)

Maybe it's a silly question but I didn't find answers on old topics :(
Thank you in advance!
Title: Re: Use_Inventory mouse-mode Item cursor problem (on standard template)
Post by: Khris on Fri 15/12/2017 11:09:29
Sure, just call
  player.ActiveInventory = null;
This should automatically move on the cursor mode to eModeWalkto as well.
Title: Re: Use_Inventory mouse-mode Item cursor problem (on standard template)
Post by: Jigen Daisuke on Fri 15/12/2017 12:15:22
Quote from: Khris on Fri 15/12/2017 11:09:29
Sure, just call
  player.ActiveInventory = null;
This should automatically move on the cursor mode to eModeWalkto as well.

Thank you, I will try ASAP!

If I understood well, I have to put this line after all "use inventory" events
Title: Re: Use_Inventory mouse-mode Item cursor problem (on standard template)
Post by: Khris on Fri 15/12/2017 13:51:12
I hope you aren't planning on deselecting the item regardless of whether the attempted action was fruitful?
Title: Re: Use_Inventory mouse-mode Item cursor problem (on standard template)
Post by: Jigen Daisuke on Sat 16/12/2017 10:30:27
Quote from: Khris on Fri 15/12/2017 13:51:12
I hope you aren't planning on deselecting the item regardless of whether the attempted action was fruitful?

No, only after a successful action that do not cause LoseInventory of the object :grin:
I will create a "deselect" button on the icon bar for other situations :smiley: