Lumberyard Tutorials by Jonathan Capes

Usage Examples

Show a Buttonless Popup for a Duration

The Show Popup node with Button Kind set to 2 remains on-screen until hidden. The following function displays the Popup Message for the Popup Duration in seconds.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Popup DurationNumberIn
Popup MessageStringIn

Graph of Function

Script Canvas graph of function

Show Toast if Popup Yes Clicked

Display a Yes/No Popup. If the player clicks 'yes', tell them the consequence with a Toast notification. The following function displays the Popup Message and then displays the Toast Message for the Toast Duration in seconds if 'yes' is clicked.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Popup MessageStringIn
Popup SourceEntity IDSelfIn
Toast DurationNumberIn
Toast MessageStringIn
Button PressedNumberLocal
Popup IDNumberLocal

Graph of Function

Script Canvas graph of function

Clear and Display New Toast

Ensure that Toast notifications never overlap with the following function. Provide any current Toast notification's ID with Previous Popup ID and it will be hidden before a new Toast notification displays Toast Message for the Toast Duration in seconds. The function outputs the New Popup ID.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Previous Popup IDNumberIn
Toast DurationNumberIn
Toast MessageStringIn
New Popup IDNumberOut

Graph of Function

Script Canvas graph of function

Clear and Display New Buttonless Popup

Ensure that Buttonless Popups never overlap and give them a timeout with the following function. Provide any current Popup's ID with Previous Popup ID and it will be hidden before a new Toast notification displays Popup Message for the Popup Duration in seconds. The function outputs the New Popup ID.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Popup DurationNumberIn
Popup MessageStringIn
Previous Popup IDNumberIn
New Popup IDNumberOut

Graph of Function

Script Canvas graph of function

Clear a Popup after a Timeout

Hide any Toast notification or Popup, regardless of Button Kind, after a Timeout in seconds. The following function can also be used to override a Popup's timeout. If the Popup was not closed by the player before the Timeout, the output of Timed Out? will be True.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Popup IDNumberIn
TimeoutNumberIn
Timed Out?BooleanOut

Graph of Function

Script Canvas graph of function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Previous Popup IDNumberIn
Tag AddedCRCIn/Out
Tag Toast MapMap<CRC, String>In
Toast DurationNumberIn
New Popup IDNumberOut

Show Toast when a Tag is Added

Display Toast notifications as tags are added to the player. If a tag is in the Tag Toast Map as a key, it's value string will be displayed as a Toast notification for the Toast Duration in seconds. Connect this function after the output of the On Tag Added node and provide any existing Previous Popup ID. Any active Toast notification is hidden. The function outputs the Tag Added to the player as well as the New Popup ID.

Function Node

The Function

Graph Variables

Variable NameVariable TypeDefault ValueScope
Previous Popup IDNumberIn
Tag AddedCRCIn/Out
Tag Toast MapMap<CRC, String>In
Toast DurationNumberIn
New Popup IDNumberOut

Graph of Function

Script Canvas graph of function