1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
---- (c) Copyright 2002-2010 by Francois Beerten
---- This program is free software; you can redistribute it and/or modify
---- it under the terms of the GNU General Public License as published by
---- the Free Software Foundation; only version 2 of the License.
----
---- This program is distributed in the hope that it will be useful,
---- but WITHOUT ANY WARRANTY; without even the implied warranty of
---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
---- GNU General Public License for more details.
----
---- You should have received a copy of the GNU General Public License
---- along with this program; if not, write to the Free Software
---- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
---- 02111-1307, USA.
-->
<title>Bos Wars Spripting API: Map Presentation</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
<link rel="stylesheet" type="text/css" href="scripts.css">
</head>
<body>
<h1>Bos Wars Scripting API: Map Presentation</h1>
<hr>
<a href="../index.html">Bos Wars</a>
<a href="../faq.html">FAQ</a>
<a href="magic.html">PREV</a>
<a href="mapsetup.html">NEXT</a>
<a href="index.html">LUA Index</a>
<hr>
<a href="#PresentMap">PresentMap</a>
<a href="#DefinePlayerTypes">DefinePlayerTypes</a>
<a href="#SetMapMiniImage">SetMapMiniImage</a>
<a href="#DefineMapSetup">DefineMapSetup</a>
<a href="#GetMapOption">GetMapOption</a>
<a href="#DefineMapOption">DefineMapOption</a>
<hr>
<h2>Intro - Introduction to functions to present maps</h2>
A map is defined in 2 steps: <br>
<ul>
<li>First the presentation step which tells what the map will be
alike. The presentation step is used before starting a game and allows
the player to select the map he wants. </li>
</ul>
<ul>
<li>The setup step builds the map when starting a game. At that stage
the needed tilesets and the whole map are loaded into the engine.</li>
</ul>
<p>
This page documents map presentation functions.
<a name="PresentMap"></a>
<h3>PresentMap(description, numplayers, mapwidth, mapheight, mapuid)</h3>
<dl>
<dt>description</dt>
<dd>A textual description of the map that can be displayed to the user.</dd>
<dt>numplayers</dt>
<dd>The maximum number of players for this map.</dd>
<dt>mapwidth and mapheight</dt>
<dd>The sizes of the map.</dd>
<dt>mapuid</dt>
<dd>Random number to distinguish maps with the same file name. Be sure to change
this number when changing the map.</dd>
</dl>
<h4>Example</h4>
<pre class="lua">
PresentMap("Doom World", 4, 64, 64)
</pre>
<div class="nyi">
<a name="SetMapMiniImage"></a>
<h3>SetMapMiniImage(mapimage)</h3>
Set a small image of the map to display when the user previews the map.
<p>
<dl>
<dt>mapimage</dt>
<dd>
Path to the file with the graphic.
</dd></dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre class="lua">
SetMiniImage("doomworld/doomworld.png")
</pre>
</div>
<a name="DefinePlayerTypes"></a>
<h3>DefinePlayerTypes(player1, player2, ...)</h3>
Define the number of players and their type on the map. Possible values for player type are:
<ul>
<li>"neutral"</li>
<li>"nobody"</li>
<li>"computer"</li>
<li>"person"</li>
<li>"rescue-passive"</li>
<li>"rescue-active"</li>
</ul>
<h4>Example</h4>
<pre class="lua">
DefinePlayerTypes("person", "person")
</pre>
<a name="DefineMapSetup"></a>
<h3>DefineMapSetup(luafile)</h3>
Define the map setup file that will be loaded if the player starts a game with this map.
<h4>Example</h4>
<pre class="lua">
DefineMapSetup("doomworld/doomworld.map")
</pre>
<div class="nyi">
<a name="GetMapOption"></a>
<h3>GetMapOption(name)</h3>
Returns the value of the option.
<p>
A map can define configuration options. A player can modify those
options just before starting a game. For example: the tileset to use, game type,
number of opponents or the amount of resources on the map.
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre class="lua">
tileset = GetMapOption("tileset")
</pre>
</div>
<div class="nyi">
<a name="DefineMapOption"></a>
<h3>DefineMapOption(name, {possible-values})</h3>
<dl>
<dt>name</dt>
<dd>Name of the option.</dd>
<dt>possible-values</dt>
<dd>List of values the player can select. The first value is the default value.</dd>
</dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre class="lua">
DefineMapOption("Resources", {"Map default", "Low", "Medium", "High"})
DefineMapOption("Difficulty", {"finger in the nose", "easy", "mission impossible"})
DefineMapOption("TileSet", {"desert", "winter", "forest"})
</pre>
</div>
<hr>
All trademarks and copyrights on this page are owned by their respective owners.
<address>(c) 2002-2007 by the <a href="http://boswars.org">
Bos Wars Project</a></address></body></html>
|