Hi,
my question is this:
Adding which inventory has been clicked on when combining inventory items. Player Says the line (which is a Random 'Say' variable).
Already have:
player.SayAt(26, 0, 270,String.Format("To my knowledge %s and %s do not mix.",player.ActiveInventory.Name, inventory.Name));
// rather than just using ID: inventory[6]
Help appreciated
Cheers
not able to test this but this should work. Where are you putting this call? on_mouse_click?
InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
player.SayAt(26, 0, 270,String.Format("To my knowledge %s and %s do not mix.",player.ActiveInventory.Name, item.Name));
I can't believe I missed that :(
Cheers (nod)
You can also use InventoryItem *item = inventory[game.inv_activated];
Cheers Khris (nod)
Khris, Wouldn't that give him the inventory item that has been activated and not the one clicked on?
inventory[game.inv_activated] is equivalent to player.ActiveInventory.
Quote from: dayowlron on Mon 21/08/2017 11:35:10inventory[game.inv_activated] is equivalent to player.ActiveInventory.
No, it isn't. The names might be confusingly similar, but they are not intrinsically the same value.
Quote from: The Manualâ,,¢ (http://www.adventuregamestudio.co.uk/manual/index.html?page=ags41.htm#gamevariables)game.inv_activated Inventory item that the player last clicked on. Useful for unhandled_event.