Very strange, yes. Do you mean it pops up if you move over character/hotspot/object after having clicked somewhere else, or everytime? If it's just after a click, it may be that the buffers (clicked and timer) haven't reset, so when you move onto something the script gets called. Try:
Code: ags
And about the InventoryScreen(); thing, it calls the internal Inventory (smaller, bland, expands when you pick up more items), as opposed to opening the Inventory GUI (GUI3 by default, larger, bland but customisable, fixed size). Look up the show_inventory_window () function near the top of the global script of a new AGS game.
if (timer >= 20) {
if ((GetLocationType (mouse.x, mouse.y) != 0) || (GetInvAt (mouse.x, mouse.y) != -1)) { // Brace here
SetGUIPosition(2,guix,guiy);
InterfaceOn(2);
clicked=0;
timer=0;
} // And here
else { //clicked 'nowhere', so...
clicked=0; // stop checking
timer=0; //reset timer
}
}
And about the InventoryScreen(); thing, it calls the internal Inventory (smaller, bland, expands when you pick up more items), as opposed to opening the Inventory GUI (GUI3 by default, larger, bland but customisable, fixed size). Look up the show_inventory_window () function near the top of the global script of a new AGS game.