Messages.lua: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
Flozi (talk | contribs)
No edit summary
Line 1: Line 1:
==What and & Where is it?==
==Location==
'''messages.lua''' is a file in the '''gamedata\''' folder of a Spring Game.
<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.
It defines what messages are shown when a player dies. (and perhaps other messages too but nobody knows for sure)
 
Before the introduction of Lua it was once called messages.tdf with a slighly different synthax. (this still works)
==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


==Details==
==Details==
In the message string %i is replaced with the teamnumber and %s is replaced with the players name.
In the message string <code>%i</code> is replaced with the player's team number and <code>%s</code> is replaced with the player's name.


==Example==
==Example==
Line 18: Line 19:


===Multiple Messages===
===Multiple Messages===
Example taken from [http://code.google.com/p/zero-k/ zeroK]
Example taken from [http://code.google.com/p/zero-k/ zeroK]. One message is picked from the list at random.


<code><pre>
<code><pre>

Revision as of 14:59, 2 April 2011

Location

messages.lua is a file in the Gamedata/ directory of a Spring Game. It defines what messages are shown when a player dies.

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

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 %1(%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]] ] = {
                --AA/BA
                "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