Page 1 of 1

OnAlertStart & OnAlertEnd

Posted: Sat Dec 03, 2022 3:43 pm
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.

Re: OnAlertStart & OnAlertEnd

Posted: Sat Dec 03, 2022 7:46 pm
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.)

Re: OnAlertStart & OnAlertEnd

Posted: Sat Dec 03, 2022 9:34 pm
by lmartim
Hey Tony,

Those those UnityEvents just solved my problem! Thanks for your help! :D

Re: OnAlertStart & OnAlertEnd

Posted: Sun Dec 04, 2022 8:00 am
by Tony Li
Glad to help!