Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DiggingUpGraves on Fri 26/07/2024 12:37:05

Title: Cursor disappears whenever I remove an item from the inventory
Post by: DiggingUpGraves on Fri 26/07/2024 12:37:05
Hi there, I've got something strange going on. Every time I start a script where a character needs to use an inventory item, and then lose it after the one use, the cursor vanishes. It still works, but you cannot see it. I already tried some lines about changing the cursor but nothing really works.
What's strangest is that I didn't have this problem with my previous game. I made that one in 3.6.0., this one in 3.6.1. Could this be the problem?


I'll add the code that I used too, just in case
function hDrawer_UseInv(Hotspot *theHotspot, CursorMode mode)
{
  if (player.ActiveInventory == iDrawerkey)
  {
    player.Say("Hi");
    SetBackgroundFrame(1);
    player.LoseInventory(iDrawerkey);
  }
}
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: Crimson Wizard on Fri 26/07/2024 12:42:15
When the ActiveInventory is reset (in your case that's because item is removed from inventory), cursor switches to the first enabled cursor mode in the list. By default that's Walk cursor, but may be a different one if you disabled Walk.

Normally you should disable cursors that you don't use. This may be done either by disabling "StandardMode" property in the editor (if I remember correctly), or by setting Mouse.DisableMode in game_start function in script.
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: DiggingUpGraves on Fri 26/07/2024 12:56:45
Thank you! It's somewhat working right now. I'm going to look through my old game and see what the mouse/cursor stuff looks like now that I know.
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: DiggingUpGraves on Fri 26/07/2024 13:01:45
I wholly fixed it by just giving 'Walk to' a cursor
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: Crimson Wizard on Fri 26/07/2024 23:45:47
Quote from: DiggingUpGraves on Fri 26/07/2024 13:01:45I wholly fixed it by just giving 'Walk to' a cursor

This means that you are using random cursors in your game, instead of configuring a logical behavior.
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: DiggingUpGraves on Mon 29/07/2024 13:11:58
But I've got a default cursor, and disabled all the ones I don't need.
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: DiegoHolt on Wed 04/09/2024 00:59:31
Hi, I'm having the same problem here... how did you solve it?  ???
Title: Re: Cursor disappears whenever I remove an item from the inventory
Post by: Crimson Wizard on Wed 04/09/2024 01:22:27
Quote from: DiegoHolt on Wed 04/09/2024 00:59:31Hi, I'm having the same problem here... how did you solve it?  ???

Clearly decide which cursors do you want to use in your game.
Disable all the other cursors, either by disabling "StandardMode" property in the editor, or using Mouse.DisableMode in game_start script function.
https://adventuregamestudio.github.io/ags-manual/Mouse.html#mousedisablemode

This will prevent AGS from switching to unused cursor after active inventory is removed.