Page 1 of 2

Showing alert messages

Posted: Sun Apr 02, 2023 2:00 pm
by lostmushroom
Hey Tony, I'm having trouble getting alert messages to show. I'm using a customised version of the Visual Novel template Dialogue UI, which contains an alert panel. I then added ShowAlert("Hello"); to the script field of a node, but nothing is showing. Should that work, or am I missing some steps?

Thanks!

Re: Showing alert messages

Posted: Sun Apr 02, 2023 2:43 pm
by Tony Li
Hi,

You may need to tick the Dialogue Manager GameObject's Display Settings > Alert Settings > Allow Alerts During Conversations.

Re: Showing alert messages

Posted: Sun Apr 02, 2023 5:02 pm
by lostmushroom
Just checked that, but it's still not showing up. These are my alert settings.
alert settings.JPG
alert settings.JPG (18.07 KiB) Viewed 554 times

Re: Showing alert messages

Posted: Sun Apr 02, 2023 7:03 pm
by Tony Li
Hi,

Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then play the scene and the conversation. When you get to the line where the alert should have appeared, review the logs in the Console window. You should see a line like:

Dialogue System: Lua(ShowAlert("Hello"))

If not, make sure the ShowAlert() command is in the Script field, not the Conditions or Sequence field.

If you do see that line in the Console window, make sure your alert panel is sized and positioned properly so that it will be onscreen when showing alerts.

Re: Showing alert messages

Posted: Mon Apr 03, 2023 10:46 am
by lostmushroom
Hey Tony. I figured it out, it was related to an issue I had a while ago where I had to adjust the Hide state on the Dialogue Panel to avoid the UI disappearing.

I just updated DS and it's all working now (and the disappearing UI bug has gone away, so all good :D)

Re: Showing alert messages

Posted: Mon Apr 03, 2023 11:10 am
by Tony Li
Hi,

Great! I'm glad you got it all working. Thanks for the update.

Re: Showing alert messages

Posted: Mon Apr 03, 2023 11:29 am
by lostmushroom
One more quick question - when it comes to showing achievements, how do I get the alert message to display "Unlocked: [achievement name]"? The current Unlocked Text is just "Unlocked:".

Re: Showing alert messages

Posted: Mon Apr 03, 2023 11:33 am
by Tony Li
What's the actual ShowAlert() that you're using. For example, does it look like this?
  • Script: ShowAlert("Unlocked: Martial Weapons Skill")
or like this?
  • Script: ShowAlert("Unlocked: [var=unlockedSkill]")
Or something else?

Re: Showing alert messages

Posted: Mon Apr 03, 2023 1:01 pm
by lostmushroom
For achievement-related alerts, I removed ShowAlert() in the script field so that it wouldn't show every time you run the node. Instead, I'm using UnlockAchievement("Completed Level 1"); which is making an alert appear, but the alert only says "Unlocked: " instead of "Unlocked: Completed Level 1". I'm guessing that's because it's just taking the text from the Unlocked Text field here.
achievements.JPG
achievements.JPG (18.17 KiB) Viewed 541 times

Re: Showing alert messages

Posted: Mon Apr 03, 2023 1:39 pm
by Tony Li
Hi,

Is Achievements your own script?

Where is the UnlockAchievement() Lua function defined? Is it from a third-party integration?