FloatingHotspot Module does not show in inventory over items..

Started by Slasher, Thu 22/04/2021 14:29:47

Previous topic - Next topic

Slasher

Hi,

FloatingHotspot Module does not show in inventory over items..

Is there away to do so?

Many thanks

Slasher

Khris

There's most definitely a way. You have to edit the module accordingly.

eri0o

Slasher, in the Module Script, before the Game.GetLocationName function, use InventoryItem.GetAtScreenXY, 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
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;
  }
  

Slasher

Does not like item/ item.Name

Crimson Wizard

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

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

SMF spam blocked by CleanTalk