Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Thu 01/11/2012 04:26:21

Title: change mouse to pointer after combining items
Post by: Slasher on Thu 01/11/2012 04:26:21
After combining inventory items in the inventory the mouse cursor changes to walk. How can I get it to change to the active pointer?

I can get it to change to pointer but it is not active.

cheers for all help.

This seems to work but would be better if constant then do each successful combine.
Code (AGS) Select
function iorangejar_UseInv()
{
if(cELF.ActiveInventory==iblackleaf && spellbook==true)
{
 
gInventory.Visible = true;
mouse.Mode = eModeInteract;
mouse.UseModeGraphic(eModePointer);
cELF.LoseInventory(iorangejar);
cELF.LoseInventory(iblackleaf);
cELF.AddInventory(ibrownjar);
Display("You now have some swell potion.");

}
  else
{
Display("You don't want to combine with that!");
}
}


Will leave post open for time being.



Title: Re: change mouse to pointer after combining items
Post by: geork on Fri 02/11/2012 19:32:19
How do you mean active pointer? Does the pointer mouse mode not respond to any clicks?
Title: Re: change mouse to pointer after combining items
Post by: MurrayL on Fri 02/11/2012 20:29:26
I'm guessing what you want is to set the cursor mode back to 'Interact' after combining two inventory items?

It's a bit hacky, but you could do this in your global script:

Code (AGS) Select

function on_event(EventType event, int data)
{
if(event == eEventAddInventory && mouse.Mode == eModeWalk)
{
  mouse.Mode = eModeInteract;
  mouse.UseModeGraphic(eModePointer);
}
}


That way if you gain an inventory item, it sets the mouse pointer back to interact mode.

The check for 'walk' mouse mode is in case the player gains inventory items using a different cursor mode - I'm guessing that at no point in your game do you get an inventory item while using the walk cursor, so it should work fine like this.