"Dialogue Box" type overlay not working properly

Started by boolymanmc on

Topic category: Troubleshooting, bugs, and solutions

Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"Dialogue Box" type overlay not working properly

I am giving players a "cassette" type item.  When they right click it, I would like the audio to play, and a small overlay to pop up that displays an overlay of what the recorder is saying... in the form of a simple PNG img.

I have set up a global player_persistant logic variable called "dialogue1" that is defaulted to false.

I have created a procedure to trigger when the cassette is right clicked.  This procedure checks to make sure the global variable is false already (to prevent the player spam clicking the item and it causing issues).  If the global variable is false, the procedure will toggle it to true, play the audio, wait 31 seconds (the length of the audio), and then toggle the variable back to false.

I have set up my overlay to only show if the global variable is true; in other words, for that 31 seconds that the audio is playing. 

This is the cassette right click procedure:

 

Problem #1 - The audio doesn't play.  When I remove all of the overlay/variable procedures, the audio plays fine, so it's not a matter of something being wrong with the audio itself.

Problem #2 - The overlay does not toggle on or off properly.  It either stays on constantly, using the first of the below condition triggers, or does not come on at all using the second of the below screenshotted condition triggers.

This is my overlay condition trigger:

When using the above overlay trigger, the overlay is present in game nonstop, never toggling off. 

So I assumed that I would need to use an "If/then" procedure instead:

This did not show the overlay constantly, OR when I right clicked the cassette.  As though it simply wasn't reading the global variable at all.

 

If you could give me some detailed advice, I would appreciate it.  I am not very experienced with variables or procedures, so please explain things assuming I don't already know what you are talking about.