Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Thu 22/04/2021 14:29:47

Title: FloatingHotspot Module does not show in inventory over items..
Post by: Slasher on Thu 22/04/2021 14:29:47
Hi,

FloatingHotspot Module does not show in inventory over items..

Is there away to do so?

Many thanks

Slasher
Title: Re: FloatingHotspot Module does not show in inventory over items..
Post by: Khris on Thu 22/04/2021 14:36:16
There's most definitely a way. You have to edit the module accordingly.
Title: Re: FloatingHotspot Module does not show in inventory over items..
Post by: eri0o on Thu 22/04/2021 15:13:31
Slasher, in the Module Script, before the Game.GetLocationName (https://adventuregamestudio.github.io/ags-manual/Game.html#gamegetlocationname) function, use InventoryItem.GetAtScreenXY (https://adventuregamestudio.github.io/ags-manual/InventoryItem.html#inventoryitemgetatscreenxy), and if the inventory item received is not null, use it's name, otherwise, proceed with Game.GeLocationName

Something like below (sorry for identation, typed from a phone):

Code (ags) Select
String s;
    InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
  if (item == null) {
    //  Display("No inventory item at the mouse coordinates");
    s = Game.GetLocationName(mouse.x,  mouse.y);
  }
  else {
    // Display("Inventory item number %d at the mouse.", item.ID);
    s = item.Name;
  }
 
Title: Re: FloatingHotspot Module does not show in inventory over items..
Post by: Slasher on Thu 22/04/2021 16:31:27
Does not like item/ item.Name
Title: Re: FloatingHotspot Module does not show in inventory over items..
Post by: Crimson Wizard on Thu 22/04/2021 16:39:44
Quote from: Slasher on Thu 22/04/2021 16:31:27
Does not like item/ item.Name

You need to declare a variable of that name

Code (ags) Select

InventoryItem* item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);