Hi,
FloatingHotspot Module does not show in inventory over items..
Is there away to do so?
Many thanks
Slasher
There's most definitely a way. You have to edit the module accordingly.
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):
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;
}
Does not like item/ item.Name
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
InventoryItem* item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);