Popup messages: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
m (add)
 
(add spawnargs)
Line 1: Line 1:
== Introduction ==
== Introduction ==


Often it can be useful to show the player messages on the screen, this is used for instance for instruction in the training mission. This article describes how to make this work.
Often it can be useful to show the player messages on the screen, this is used for instance for instructions in the training mission. This article describes how to make this work.


== Usage ==
== Usage ==


For each message you want to show, insert one '''atdm:gui_message''' entity in your map. Set the proper spawnargs, then simple target that entity from any trigger.
For each message you want to show, insert one '''atdm:gui_message''' entity in your map. The place does not matter, but putting it near the location where the message appears makes sense. Set the proper spawnargs, then simple target that entity from any trigger.


You can also use '''atdm:target_message_enable''' and '''atdm:target_message_enable''' entities to disable/enable a certain message.
You can also use '''atdm:target_message_enable''' and '''atdm:target_message_enable''' entities to disable/enable a certain message.
Line 14: Line 14:


Here is an example screenshot from <code>maps/test/trigger_messages.map</code>. The highlighted entity itself is the message. It is targeted by the trigger in the door, showing the message everytime the player steps through the door. The red and green boxes are the '''atdm:target_message_disable''' and '''atdm:target_message_enable''' entities, that are targeted by two levers.
Here is an example screenshot from <code>maps/test/trigger_messages.map</code>. The highlighted entity itself is the message. It is targeted by the trigger in the door, showing the message everytime the player steps through the door. The red and green boxes are the '''atdm:target_message_disable''' and '''atdm:target_message_enable''' entities, that are targeted by two levers.
== Spawnargs ==
=== show (float, default: 0) ====
Time in seconds the message will be shown.
=== delay (float, default: 0) ====
Time in seconds before the message will appear.
=== text (string) ====
The text to display.
=== lines (int, default: 1) ====
The number of lines, will influence the vertical alignment of the text.
=== is_long (boolean, default: 0) ====
If set to true, a long message is assumed, this will influence the default show time, which is longer for long message.


{{editing}}
{{editing}}

Revision as of 19:52, 26 July 2009

Introduction

Often it can be useful to show the player messages on the screen, this is used for instance for instructions in the training mission. This article describes how to make this work.

Usage

For each message you want to show, insert one atdm:gui_message entity in your map. The place does not matter, but putting it near the location where the message appears makes sense. Set the proper spawnargs, then simple target that entity from any trigger.

You can also use atdm:target_message_enable and atdm:target_message_enable entities to disable/enable a certain message.

If you want your message to appear only once, no matter what, use atdm:trigger_once. If it should appear multiple times until a certain condition is fulfilled, use a atdm:trigger_multiple and then a atdm:target_message_disable entity to disable the message entity.

Messages.jpg

Here is an example screenshot from maps/test/trigger_messages.map. The highlighted entity itself is the message. It is targeted by the trigger in the door, showing the message everytime the player steps through the door. The red and green boxes are the atdm:target_message_disable and atdm:target_message_enable entities, that are targeted by two levers.

Spawnargs

show (float, default: 0) =

Time in seconds the message will be shown.

delay (float, default: 0) =

Time in seconds before the message will appear.

text (string) =

The text to display.

lines (int, default: 1) =

The number of lines, will influence the vertical alignment of the text.

is_long (boolean, default: 0) =

If set to true, a long message is assumed, this will influence the default show time, which is longer for long message.