Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Modinfo.lua: Difference between revisions

From FIGHTORDER
imported>Flozi
Example: Add a full example
imported>Flozi
Example: Mutator and base content examples
Line 13: Line 13:


==Example==
==Example==
 
===Main Game file===
<code><pre>
<code><pre>
local modinfo = {
local modinfo = {
Line 25: Line 25:
   url = "http://www.linktomyawesomegame.com/",
   url = "http://www.linktomyawesomegame.com/",
   modtype = "1",
   modtype = "1",
}
return modinfo
</pre></code>
===Mutator===
A mutator depends on the main game file, but does not replace it, it will usually have a different <code>name</code> and <code>shortName</code> but the same <code>game</code> and <code>shortGame</code> values as the main game file. It should still have a <code>modtype</code> of 1.
<code><pre>
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
</pre></code>
===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 <code>modtype</code> of 0. The following example is from <code>springcontent.sdz</code>, which is automatically loaded by Spring for all games.
<code><pre>
local modinfo = {
  name = "Spring content v1",
  description = "Mods can depend on this archive to get all the spring content",
  modtype = "0",
  depend = {
    'Spring Bitmaps'
  },
}
}



Revision as of 15: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

Example

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