<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Validmaps.lua</id>
	<title>Validmaps.lua - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Validmaps.lua"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Validmaps.lua&amp;action=history"/>
	<updated>2026-04-21T04:24:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=Validmaps.lua&amp;diff=1254&amp;oldid=prev</id>
		<title>Qrow: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Validmaps.lua&amp;diff=1254&amp;oldid=prev"/>
		<updated>2026-02-24T05:59:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:59, 23 February 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Qrow</name></author>
	</entry>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=Validmaps.lua&amp;diff=1253&amp;oldid=prev</id>
		<title>intermisc/gamedev&gt;Flozi: Game development -&gt; Game Dev</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Validmaps.lua&amp;diff=1253&amp;oldid=prev"/>
		<updated>2013-03-25T20:18:09Z</updated>

		<summary type="html">&lt;p&gt;Game development -&amp;gt; Game Dev&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Location==&lt;br /&gt;
validmaps.lua is a file in the root folder of a Spring game.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
from http://springrts.com/wiki/The_Talking_Changelog&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Valid maps are listed in the mod&amp;#039;s &amp;quot;ValidMaps.lua&amp;quot; file&lt;br /&gt;
A valid map count of 0 means that any map can be used with the mod&lt;br /&gt;
This can be used in concert with LuaRules to setup multi-player scenarios and tutorials&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Basically this means that a Spring game can create a whitelist of maps and the lobbies will only display these maps in their selection menu. In the end it depends on the lobby how maps are listed.&lt;br /&gt;
All map names that are returned are playabe. &lt;br /&gt;
&lt;br /&gt;
To block a certain map, validmaps.lua has to loop through all maps to build a table of  mapnames, not inserting the unwanted map, and then return that table.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;=&amp;gt;&amp;#039;&amp;#039;&amp;#039;is it that correct? Or is there an easy way, ie returning a second table of unvalid maps or is there an unvalidmaps.lua?&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;=&amp;gt;&amp;#039;&amp;#039;&amp;#039;don&amp;#039;t know, please add&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
Just returning a table of map names is the easiest example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {&lt;br /&gt;
   &amp;quot;DesertCliffsV1&amp;quot;,&lt;br /&gt;
   &amp;quot;Eye_Of_Horus_v2&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Use mapnames as returned by [[Lua_ConstGame|Game.mapName]]&lt;br /&gt;
&lt;br /&gt;
===Example to filter maps by various aspects===&lt;br /&gt;
http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/ValidMaps.lua by det&lt;br /&gt;
If I understand this correctly this not a working example (it is disabled with &amp;#039;&amp;#039;if (false)&amp;#039;&amp;#039; anyway) but more a reference:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--  ValidMaps.lua&lt;br /&gt;
--&lt;br /&gt;
--  This file can be added to a mod to dictate which maps&lt;br /&gt;
--  can (and can not) be used with it. The map information&lt;br /&gt;
--  is the map&amp;#039;s default information, and is done before&lt;br /&gt;
--  MapOptions.lua can be used by maps.&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
-- Map specific call-outs:&lt;br /&gt;
--&lt;br /&gt;
--   Spring.GetMapList() -&amp;gt; { &amp;#039;map1.smf&amp;#039;, &amp;#039;map2.smf&amp;#039;, &amp;#039;map3.sm3&amp;#039;, etc... }&lt;br /&gt;
--&lt;br /&gt;
--   Spring.GetMapInfo(&amp;#039;map1&amp;#039;) -&amp;gt; {&lt;br /&gt;
--     author  = &amp;#039;string&amp;#039;,&lt;br /&gt;
--     desc    = &amp;#039;string&amp;#039;,&lt;br /&gt;
--     mapX    = number,&lt;br /&gt;
--     mapY    = number,&lt;br /&gt;
--     tidal   = number,&lt;br /&gt;
--     gravity = number,&lt;br /&gt;
--     metal   = number,&lt;br /&gt;
--     windMin = number,&lt;br /&gt;
--     windMax = number,&lt;br /&gt;
--     extractorRadius = number,&lt;br /&gt;
--     startPos = {&lt;br /&gt;
--       [1] = { x = number, z = number },&lt;br /&gt;
--       [2] = { x = number, z = number },&lt;br /&gt;
--       [3] = { x = number, z = number },&lt;br /&gt;
--       etc ...&lt;br /&gt;
--     },&lt;br /&gt;
--   }&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--  Example filtering code&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
if (false) then&lt;br /&gt;
  local mapList = Spring.GetMapList()&lt;br /&gt;
  local validMaps = {}&lt;br /&gt;
  for _, mapName in ipairs(mapList) do&lt;br /&gt;
    if (mapName:lower():find(&amp;#039;metal&amp;#039;)) then&lt;br /&gt;
      local mapInfo = Spring.GetMapInfo(mapName)&lt;br /&gt;
      local minX = (16 * 512)&lt;br /&gt;
      local minY = (8  * 512)&lt;br /&gt;
      if ((mapInfo.mapX &amp;gt;= minX) and&lt;br /&gt;
          (mapInfo.mapY &amp;gt;= minY)) then&lt;br /&gt;
        validMaps[#validMaps + 1] = mapName&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  if (#validMaps == 0) then&lt;br /&gt;
    return { &amp;#039;FAKEMAP&amp;#039; }&lt;br /&gt;
  else&lt;br /&gt;
    return validMaps&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return {}  --  returning an empty table means  *ALL MAPS*  are valid&lt;br /&gt;
           --  for *NO MAPS*, return a fake map name, ex: { &amp;#039;FakeMap&amp;#039; }&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Working exampe===&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;=&amp;gt;&amp;#039;&amp;#039;&amp;#039;would be nice to have one&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--this validmaps.lua:&lt;br /&gt;
--blocks all &amp;quot;speedmetal&amp;quot; variants by name&lt;br /&gt;
--only allows square sized maps&lt;br /&gt;
--also allows the map &amp;quot;Derpa Derp&amp;quot;&lt;br /&gt;
EXAMPLE SCRIPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Compatible Lobbies==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;=&amp;gt;&amp;#039;&amp;#039;&amp;#039;What lobbies read and support this?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;TASClient&amp;#039;&amp;#039;&amp;#039; - yes (?) Satirik: &amp;#039;&amp;#039;just fixed it in tasclient&amp;#039;&amp;#039; http://springrts.com/phpbb/viewtopic.php?f=11&amp;amp;t=19495 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Spring Lobby&amp;#039;&amp;#039;&amp;#039; - No, _koshi_: &amp;#039;&amp;#039;yeah, we actually can build a list of valid maps, it&amp;#039;s just not used in the frontend&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;zeroK Lobby&amp;#039;&amp;#039;&amp;#039; - ?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Alpha Lobby&amp;#039;&amp;#039;&amp;#039; - ?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Dev]]&lt;/div&gt;</summary>
		<author><name>intermisc/gamedev&gt;Flozi</name></author>
	</entry>
</feed>