Showing alert messages

Announcements, support questions, and discussion for the Dialogue System.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Showing alert messages

Post 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!
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing alert messages

Post by Tony Li »

Hi,

You may need to tick the Dialogue Manager GameObject's Display Settings > Alert Settings > Allow Alerts During Conversations.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Showing alert messages

Post 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 559 times
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing alert messages

Post 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.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Showing alert messages

Post 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)
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing alert messages

Post by Tony Li »

Hi,

Great! I'm glad you got it all working. Thanks for the update.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Showing alert messages

Post 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:".
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing alert messages

Post 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?
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Showing alert messages

Post 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 546 times
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing alert messages

Post by Tony Li »

Hi,

Is Achievements your own script?

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