User Tools

Site Tools


world_setup:game_features:notifications

Notification System

The notification system refers to the set of UI components that show a list of temporary messages on the left side of the screen. If multiple notification messages are sent they are queued up, giving the player a few seconds to view each. A basic notification looks like this:

Basic Notification Commands

You add basic notifications using the following commands:

*notify [PLAYER_NAME] [HEADLINE](|[SUBTEXT])
*notifylarge [PLAYER_NAME] [HEADLINE](|[SUBTEXT])
*notifyall [HEADLINE]|[SUBTEXT]

Scripted Notifications

If you want to make the notification popup interactable, or have a layout more complex than just a single text message, you can script a notification popup using the Scripted OSD systems.

Here is an example:

	$secsTillStart = 60
	osdcreate(OSDNOTIFICATION1, "CrowPopup", "RC Battle", $secsTillStart )
	osdadditem(OSDMINHEIGHT, "", "100" )
	osdadd(TEXT, 10, 10, 230, 0, "", "Free-for-all RC battle starts in:" ) 
	osdadd(COUNTDOWN, 70, 40, 0, 0, "", "$secsTillStart") 
	osdadd(TEXT, 105, 43, 0, 0, "", "secs" ) 
	osdadd(EXITBUTTON, 25, 70, 200, 25, "join", "Sign Up" )
	osdactivate()

Scripted notification windows are always 240 pixels wide, and the height needs to be specified using OSMINHEIGHT per the example above. The 4th parameter to osdCreate determines how long (in seconds) the notification will stay on screen for. (This will default to 10 seconds if omitted).

There are four notification slots, OSDNOTIFICATION1, OSDNOTIFICATION2, OSDNOTIFICATION3, OSDNOTIFICATION4. If, after using the example above, you trigger another osd using OSDNOTIFICATION1 it would replace the first instance rather than being queued up after it.

Automatic Initial Notifications

The *settingsGraphicsInitial Notifications Mode option allows you to activate automatic notification that appear for all users shortly after they join the world. Currently this setting is either 0 (off) or 1 (which shows high-scores).

When using the high-score notification mode, the scores which are used in the display are controlled by *settingsEconomyHigh Scores Mode. (Some worlds may care about wealth and age, others might use kills/deaths, kudos or other factor).

world_setup/game_features/notifications.txt · Last modified: 2023/02/28 07:06 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki