Messages.lua: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
No edit summary
Flozi (talk | contribs)
95 ! remove engine support for gamedata/messages.tdf,
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{deprecated|Removed in Spring 95.0. See {{sourcelink|file=cont/examples/Widgets/game_messages.lua}} for a possible replacement.}}
==Location==
==Location==
<code>messages.lua</code> is a file in the <code>Gamedata/</code> directory of a Spring Game. It defines what messages are shown when a player dies.
<code>messages.lua</code> is a file in the <code>Gamedata/</code> directory of a Spring Game.  
 
==Purpose==
This file defines what messages are shown when a player dies.


==Source==
==Source==
The engine source code which parses the data from this file is viewable here: https://github.com/spring/spring/blob/master/rts/Game/Messages.cpp
The engine source code which parses the data from this file is viewable here:  
 
* {{sourcelink|file=rts/Game/Messages.cpp}}


==Details==
==Details==
Line 10: Line 17:
==Example==
==Example==
===Single Message===
===Single Message===
Example taken from [[Air Raid]]
Example taken from Air Raid:


<code><pre>
<code><pre>
return {
return {
"Player %1(%s) is down!"
  "Player %i(%s) is down!"
}
}
</pre></code>
</pre></code>
Line 23: Line 30:
<code><pre>
<code><pre>
local messages = {
local messages = {
        [ [[Team%i(%s) is no more]] ] = {
  [ [[Team%i(%s) is no more]] ] = {
                --AA/BA
    "Team%i (%s) has been obliterated",
                "Team%i (%s) has been obliterated",
    "Team%i (%s) has been liquidated",
                "Team%i (%s) has been liquidated",
    "Team%i (%s) has been eradicated",
                "Team%i (%s) has been eradicated",
    "Team%i (%s) has been terminated",
                "Team%i (%s) has been terminated",
    "Team%i (%s) has bowed out",
                "Team%i (%s) has bowed out",
    "Team%i (%s) has gone to a better place",
                "Team%i (%s) has gone to a better place",
    "Team%i (%s) beheld Satan as he fell from heaven LIKE LIGHTNING!",
                "Team%i (%s) beheld Satan as he fell from heaven LIKE LIGHTNING!",
    "Team%i (%s) is out of existence",
                "Team%i (%s) is out of existence",
    ...
                ...
    },
        },
}
}
return messages
return messages
</pre></code>
</pre></code>


[[Category:Game development]]
 
[[Category:gamedata]]
[[Category:gamedata]]

Latest revision as of 11:48, 17 November 2013

Removed in Spring 95.0. See cont/examples/Widgets/game_messages.lua for a possible replacement.


Location

messages.lua is a file in the Gamedata/ directory of a Spring Game.

Purpose

This file defines what messages are shown when a player dies.

Source

The engine source code which parses the data from this file is viewable here:

Details

In the message string %i is replaced with the player's team number and %s is replaced with the player's name.

Example

Single Message

Example taken from Air Raid:

return {
  "Player %i(%s) is down!"
}

Multiple Messages

Example taken from zeroK. One message is picked from the list at random.

local messages = {
  [ [[Team%i(%s) is no more]] ] = {
    "Team%i (%s) has been obliterated",
    "Team%i (%s) has been liquidated",
    "Team%i (%s) has been eradicated",
    "Team%i (%s) has been terminated",
    "Team%i (%s) has bowed out",
    "Team%i (%s) has gone to a better place",
    "Team%i (%s) beheld Satan as he fell from heaven LIKE LIGHTNING!",
    "Team%i (%s) is out of existence",
    ...
    },
}
return messages