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