OnAlertStart & OnAlertEnd

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lmartim
Posts: 2
Joined: Sat Dec 03, 2022 3:32 pm

OnAlertStart & OnAlertEnd

Post by lmartim »

Hi everyone!

I'm trying to use the alert messages to show some special messages, like a key item or ability acquired.

How can I trigger some events, so I could change/block the player input (I'm using the new input system) while the alert is shown? I could accomplished that during conversations using the Dialogue System Events but I could't find some kind of similar option for alerts.

I found this old topic https://www.pixelcrushers.com/phpbb/vie ... art#p13771 but the receiver wont get the message. I even tried to use the Message Events but without success.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnAlertStart & OnAlertEnd

Post by Tony Li »

Hi,

The Dialogue System sends the OnShowAlert message to the Dialogue Manager and its children (see here) but if you need to disable player input while an alert is showing, I recommend using the Alert Panel's UIPanel component > OnOpen() and OnClose() UnityEvents. Since your dialogue UI is probably a child of the Dialogue Manager, it will be a singleton that survives scene changes. So you'll want to use a script method that finds the player in the current scene. (It's a similar concern to How To: Manage Player Controls and Scene Changes.)
lmartim
Posts: 2
Joined: Sat Dec 03, 2022 3:32 pm

Re: OnAlertStart & OnAlertEnd

Post by lmartim »

Hey Tony,

Those those UnityEvents just solved my problem! Thanks for your help! :D
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnAlertStart & OnAlertEnd

Post by Tony Li »

Glad to help!
Post Reply