Jibble

Author Topic: Overhotspot label stays on screen when using an inv item on an object (SOLVED)  (Read 361 times)

I am using the verb coin system. When I click, for example, look at locker, the overhotspot label disappears, which is how I like it. But for some reason,when using an inventory item, the label remains, which I don't like. One way i found to get rid of it, is in the code below. But to enter this every single time is a lot of extra work, when I get the feeling it can be permanently adjusted in the verb coin script to hide the label everytime, until the commands have stopped? But I don't want to go messing with it without knowing what i'm doing. If anyone can help, thanks.


Code: Adventure Game Studio
  1. function Locker_UseInv()
  2. {
  3. if (player.ActiveInventory == SmKey)
  4.   {
  5.  
  6. gOverhotspot.Visible = false;
  7. cEgo.Walk(74, 161, eBlock);
  8. cEgo.FaceLocation(cEgo.x, 50);
  9. cEgo.Think("I tried using the key in the locker.");
  10. cEgo.ChangeView(8);
  11. cEgo.Animate(3, 2, eOnce, eBlock);
  12. cEgo.ChangeView(1);
  13. gOverhotspot.Visible = true;
  14. }
  15.  
« Last Edit: 26 Apr 2018, 23:21 by ManicMatt »

I've recently answered a similar question, maybe will work in your case too:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=55979.0

Other than that general solution, I guess you may find where ProcessClick is called in whatever UI module you are using, and put gOverhotspot.Visible = false before ProcessClick, and gOverhotspot.Visible = true after ProcessClick. That would cover at least the user actions.
« Last Edit: 26 Apr 2018, 16:33 by Crimson Wizard »

There's several times in the script where it says ProcessClick, but that will certainly narrow it down! I'll have a look. (It's the Curse of Monkey Island UI.)

UPDATE:

Unless I misunderstood you, putting visibilty before and after process click made no difference, because it would instantly become visible again. I looked at the repeatedly execute method, and that would cause it to be permanently invisible, because both would be running at the same time, so it would be telling the game to make it both invisible and visible whilst freely moving the cursor around.

HOWEVER:

Taking inspiration from that I figured I need the engine to check if it is being blocked, and I found an old thread from 2007! Here is how it's been inserted into my script. Just hope it doesn't cause any unexpected problems but I can always just remove that piece of code.

Code: Adventure Game Studio
  1. function repeatedly_execute_always()
  2. {
  3. if ( ! IsInterfaceEnabled() )gOverhotspot.Visible = false;
  4.  
  5. }
  6.  
  7. function repeatedly_execute()
  8. {
  9. gOverhotspot.SetPosition(mouse.x-95, mouse.y-46);
  10. gOverhotspot.Visible = true;
  11. }
« Last Edit: 26 Apr 2018, 20:28 by ManicMatt »

Oh, maybe I put that wrongly, anyway you did exactly what should be done.
« Last Edit: 26 Apr 2018, 21:54 by Crimson Wizard »

Nice one, cheers! :)