Modinfo.lua: Difference between revisions
→Example: Mutator and base content examples |
|||
| Line 12: | Line 12: | ||
==Details== | ==Details== | ||
== | ==Examples== | ||
===Main Game file=== | ===Main Game file=== | ||
<code><pre> | <code><pre> | ||
| Line 70: | Line 70: | ||
[[Category:Game development]] | [[Category:Game development]] | ||
[[Category:gamedata]] | [[Category:gamedata]] | ||
[[File:Example.jpg]] | |||
Revision as of 16:27, 16 April 2011
Location
modinfo.lua is a file in the root directory of a Spring Game.
Purpose
define a content package as Spring game. Read by lobbies and engine.
Source
The engine source code which parses the data from this file is viewable here: https://github.com/spring/spring/blob/master/rts/System/FileSystem/ArchiveScanner.cpp
Details
Examples
Main Game file
local modinfo = {
name = "My Awesome Spring Game v1.0",
shortName = "MASG",
game = "My Awesome Spring Game",
shortGame = "MASG",
mutator = "Official",
version = "v1.0",
description = "An awesome game I made with units",
url = "http://www.linktomyawesomegame.com/",
modtype = "1",
}
return modinfo
Mutator
A mutator depends on the main game file, but does not replace it, it will usually have a different name and shortName but the same game and shortGame values as the main game file. It should still have a modtype of 1.
local modinfo = {
name = "My Awesome Spring Game Mutator",
shortName = "MASGM",
game = "My Awesome Spring Game",
shortGame = "MASG",
mutator = "Double Speed Mutator",
version = "v1.0",
description = "An awesome mutator I made for MASG",
url = "http://www.linktomyawesomegame.com/",
modtype = "1",
depend = "My Awesome Spring Game v1.0"
}
return modinfo
Base Content
Base content is a hidden, unplayable content package which is depended on by your game. For example you might include music in a hidden content package so that it was not updated with the main game files. It must have a modtype of 0. The following example is from springcontent.sdz, which is automatically loaded by Spring for all games.
local modinfo = {
name = "Spring content v1",
description = "Mods can depend on this archive to get all the spring content",
modtype = "0",
depend = {
'Spring Bitmaps'
},
}
return modinfo