Messages.lua: Difference between revisions
From Spring
Jump to navigationJump to search
→Location: Split to purpose |
added defaults(not completed) |
||
| Line 4: | Line 4: | ||
==Purpose== | ==Purpose== | ||
This file defines what messages are shown when a player dies. | This file defines what messages are shown when a player dies. | ||
==default== | |||
*missing file will not crash the engine (verified) | |||
*not mandatory for the game (verified) | |||
*will not output infolog error (=?) | |||
*a default file is loaded by engine(=?) | |||
==Source== | ==Source== | ||
Revision as of 12:00, 30 April 2011
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.
default
- missing file will not crash the engine (verified)
- not mandatory for the game (verified)
- will not output infolog error (=?)
- a default file is loaded by engine(=?)
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 %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