Updated documentation for the coming new map format.

This commit is contained in:
feber 2004-07-25 11:41:19 +00:00
parent c052d9602a
commit 59b16cbaa0
5 changed files with 505 additions and 220 deletions

View file

@ -50,7 +50,8 @@
<a href="game.html">Game</a>
<a href="icon.html">Icon</a>
<a href="magic.html">Magic</a>
<a href="pud.html">PUD</a>
<a href="mappresentation.html">Map Presentation</a>
<a href="mapsetup.html">Map Setup</a>
<a href="research.html">Research</a>
<a href="savegame.html">SaveGame</a>
<a href="sound.html">Sound</a>
@ -133,6 +134,8 @@
<dd></dd>
<dt><a href="research.html#CheckDependency">CheckDependency</a></dt>
<dd></dd>
<dt><a href="mappresentation.html#CreateMap">CreateMap</a></dt>
<dd></dd>
<dt><a href="game.html#CreateUnit">CreateUnit</a></dt>
<dd></dd>
<dt><a href="game.html#Credits">Credits</a></dt>
@ -145,8 +148,6 @@
<dd></dd>
<dt><a href="ai.html#DefineAiPlayer">DefineAiPlayer</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineAiWcNames">DefineAiWcNames</a></dt>
<dd></dd>
<dt><a href="research.html#DefineAllow">DefineAllow</a></dt>
<dd></dd>
<dt><a href="unittype.html#DefineAnimations">DefineAnimations</a></dt>
@ -163,8 +164,6 @@
<dd></dd>
<dt><a href="game.html#DefineConstruction">DefineConstruction</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineConstructionWcNames">DefineConstructionWcNames</a></dt>
<dd></dd>
<dt><a href="ui.html#DefineCursor">DefineCursor</a></dt>
<dd></dd>
<dt><a href="config.html#DefineDecorations">DefineDecorations</a></dt>
@ -199,7 +198,9 @@
<dd></dd>
<dt><a href="icon.html#DefineIconAlias">DefineIconAlias</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineIconWcNames">DefineIconWcNames</a></dt>
<dt><a href="mappresentation.html#DefineMapOption">DefineMapOption</a></dt>
<dd></dd>
<dt><a href="mappresentation.html#DefineMapSetup">DefineMapSetup</a></dt>
<dd></dd>
<dt><a href="ui.html#DefineMenu">DefineMenu</a></dt>
<dd></dd>
@ -209,8 +210,6 @@
<dd></dd>
<dt><a href="magic.html#DefineMissileType">DefineMissileType</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineMissileTypeWcNames">DefineMissileTypeWcNames</a></dt>
<dd></dd>
<dt><a href="research.html#DefineModifier">DefineModifier</a></dt>
<dd></dd>
<dt><a href="game.html#DefineRaceNames">DefineRaceNames</a></dt>
@ -221,9 +220,9 @@
<dd></dd>
<dt><a href="config.html#DefineSprites">DefineSprites</a></dt>
<dd></dd>
<dt><a href="tileset.html#DefineTileset">DefineTileset</a></dt>
<dt><a href="tileset.html#DefineTileModel">DefineTileModel</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineTilesetWcNames">DefineTilesetWcNames</a></dt>
<dt><a href="tileset.html#DefineTileset">DefineTileset</a></dt>
<dd></dd>
<dt><a href="ui.html#DefineUI">DefineUI</a></dt>
<dd></dd>
@ -233,12 +232,8 @@
<dd></dd>
<dt><a href="unittype.html#DefineUnitType">DefineUnitType</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineUnitTypeWcNames">DefineUnitTypeWcNames</a></dt>
<dd></dd>
<dt><a href="research.html#DefineUpgrade">DefineUpgrade</a></dt>
<dd></dd>
<dt><a href="pud.html#DefineUpgradeWcNames">DefineUpgradeWcNames</a></dt>
<dd></dd>
<dt><a href="unittype.html#DefineVariables">DefineVariables</a></dt>
<dd></dd>
<dt><a href="ui.html#DefineViewports">DefineViewports</a></dt>
@ -253,6 +248,8 @@
<dd></dd>
<dt><a href="research.html#GetDependency">GetDependency</a></dt>
<dd></dd>
<dt><a href="mappresentation.html#GetMapOption">GetMapOption</a></dt>
<dd></dd>
<dt><a href="game.html#GetPlayerData">GetPlayerData</a></dt>
<dd></dd>
<dt><a href="game.html#GetThisPlayer">GetThisPlayer</a></dt>
@ -341,8 +338,12 @@
<dd></dd>
<dt><a href="savegame.html#SaveGame">SaveGame</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SelectTileset">SelectTileset</a></dt>
<dd></dd>
<dt><a href="game.html#Selection">Selection</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SetAiType">SetAiType</a></dt>
<dd></dd>
<dt><a href="config.html#SetAllPlayersBuildingLimit">SetAllPlayersBuildingLimit</a></dt>
<dd></dd>
<dt><a href="config.html#SetAllPlayersTotalUnitLimit">SetAllPlayersTotalUnitLimit</a></dt>
@ -411,6 +412,8 @@
<dd></dd>
<dt><a href="config.html#SetGroupKeys">SetGroupKeys</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SetHeightMap">SetHeightMap</a></dt>
<dd></dd>
<dt><a href="config.html#SetHoldClickDelay">SetHoldClickDelay</a></dt>
<dd></dd>
<dt><a href="config.html#SetKeyScroll">SetKeyScroll</a></dt>
@ -421,6 +424,8 @@
<dd></dd>
<dt><a href="game.html#SetLocalPlayerName">SetLocalPlayerName</a></dt>
<dd></dd>
<dt><a href="mappresentation.html#SetMapMiniImage">SetMapMiniImage</a></dt>
<dd></dd>
<dt><a href="config.html#SetMaxSelectable">SetMaxSelectable</a></dt>
<dd></dd>
<dt><a href="sound.html#SetMenuMusic">SetMenuMusic</a></dt>
@ -477,8 +482,14 @@
<dd></dd>
<dt><a href="config.html#SetSpeeds">SetSpeeds</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SetStartView">SetStartView</a></dt>
<dd></dd>
<dt><a href="game.html#SetThisPlayer">SetThisPlayer</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SetTile">SetTile</a></dt>
<dd></dd>
<dt><a href="mapsetup.html#SetTileMap">SetTileMap</a></dt>
<dd></dd>
<dt><a href="config.html#SetTitleScreens">SetTitleScreens</a></dt>
<dd></dd>
<dt><a href="config.html#SetTrainingQueue">SetTrainingQueue</a></dt>

View file

@ -0,0 +1,177 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
---- (c) Copyright 2002-2004 by Lutz Sammer, Russell Smith
---- 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>Stratagus Configuration Language Description: PUD conversion</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
</head>
<body>
<h1>Stratagus Configuration Language Description: Map Presentation</h1>
<hr><pre width=80>
_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
</pre>
<p><b>(C) Copyright 1998-2004 by The Stratagus Project. Distributed under the
<a href="../gpl.html">"GNU General Public License"</a></b>
<hr>
<a href="../index.html">Stratagus</a>
<a href="../faq.html">FAQ</a>
<a href="magic.html">PREV</a>
<a href="research.html">NEXT</a>
<a href="index.html">CCL Index</a>
<hr>
<a href="#PresentMap">PresentMap</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.
<p>
Note: This is for the new map format. Not implented yet.
<h2>Functions</h2>
<a name="CreateMap"></a>
<h3>PresentMap(name, description, numplayers, mapwidth, mapheight)</h3>
<dl>
<dt>Name</dt>
<dd>Name of the map as displayed to the user.</dd>
<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>
</dl>
<p>
Note: This is for the new map format. Not implented yet.
<h4>Example</h4>
<pre>
PresentMap("Doom World",
"As you enter hell, you encounter the home of Doom monster. " +
"Be careful for the worst of them all: John Carmack.",
4, 64, 64)
</pre>
<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 implented yet.
<h4>Example</h4>
<pre>
SetMiniImage("doomworld/doomworld.png")
</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.
<p>
Note: This is for the new map format. Not implented yet.
<h4>Example</h4>
<pre>
DefineMapSetup("doomworld/doomworld.map")
</pre>
<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, your race, game type,
number of opponents or the amount of resources on the map.
<p>
Note: This is for the new map format. Not implented yet.
<h4>Example</h4>
<pre>
tileset = GetMapOption("tileset")
</pre>
<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 implented yet.
<h4>Example</h4>
<pre>
DefineMapOption("Resources", {"Map default", "Low", "Medium", "High"})
DefineMapOption("Difficulty", {"finger in the nose", "easy", "mission impossible"})
DefineMapOption("TileSet", {"desert", "winter", "forest"})
</pre>
<p>
<hr>
Last changed: $Id$<br>
All trademarks and copyrights on this page are owned by their respective owners.
<address>(c) 2002-2003 by <a href="http://stratagus.org">
The Stratagus Project</a></address></body></html>

197
doc/scripts/mapsetup.html Normal file
View file

@ -0,0 +1,197 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
---- (c) Copyright 2002-2004 by François 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>Stratagus Configuration Language Description: PUD conversion</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
</head>
<body>
<h1>Stratagus Configuration Language Description: Map Setup</h1>
<hr><pre width=80>
_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
</pre>
<p><b>(C) Copyright 1998-2004 by The Stratagus Project. Distributed under the
<a href="../gpl.html">"GNU General Public License"</a></b>
<hr>
<a href="../index.html">Stratagus</a>
<a href="../faq.html">FAQ</a>
<a href="magic.html">PREV</a>
<a href="research.html">NEXT</a>
<a href="index.html">CCL Index</a>
<hr>
<a href="#SetStartView">SetStartView</a>
<a href="#SetAiType">SetAiType</a>
<a href="#SetHeightMap">SetHeightMap</a>
<a href="#SelectTileset">SelectTileset</a>
<a href="#SetTile">SetTile</a>
<a href="#SetTileMap">SetTileMap</a>
<hr>
<h2>Intro - Introduction to functions to setup maps</h2>
A map is defined in 2 steps. This page documents map setup functions
used in the second step.
<p>
The map setup functions load the actual map into the engine. This
includes functions to load the tileset which
are defined in the <a href="tileset.html">Tileset page</a>.
<p>
Another functions defined elsewhere are usefull in the map setup step:
<a href="game.html#CreateUnit">CreateUnit</a> and
SetPlayerData, SetSharedVision, SetDiplomacy.
<p>
Note: This is for the new map format. Not implemented yet.
<h2>Functions</h2>
<a name="SetStartView"></a>
<h3>SetStartView(player, x, y)</h3>
Set the location of the map where stratagus will show to the given
player when starting. A little bit like a different CenterMap for each
player.
<dl>
<dt>player</dt>
<dd>number of the player</dd>
<dt>x</dt>
<dd>x position in tiles</dd>
<dt>y</dt>
<dd>y position in tiles</dd>
</dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
SetStartView(0, 20, 10)
</pre>
<a name="SetAiType"></a>
<h3>SetAiType(ai-type)</h3>
Set what kind of ai algorithm should be used. For example: an air based
ai for a map with a lot of obstacles
<p>
<dl>
<dt>ai-type</dt>
<dd>
The name of the ai algorithm to use.
</dd></dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
SetAiType("ai-air")
</pre>
<a name="SetHeightMap"></a>
<h3>SetHeightMap(imagepath)</h3>
A pixel in the heightmap represents the height of one tile. This
function is optional. If the game doesn't need a height map, default
values will be used.<p>
<dl>
<dt>imagepath</dt>
<dd>Filename of the grayscale image for the heightmap.
Black(0) is lowest level. White(255) is highest level.</dd>
</dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
SetHeightMap("doomworld/doomworldheights.png")
</pre>
<a name="SelectTileset"></a>
<h3>SelectTileset(tileset)</h3>
Select the Tileset to use for this map.
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
SelectTileset("desert")
</pre>
<a name="SetTile"></a>
<h3>SetTile(tilemodel, x, y)</h3>
Set a tile of the tilemodel given by tilename at the position defined
by the x,y coordinates. SetTile can be called ingame for special effects.
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
-- Create a uniform desert of sand.
for i=0 to 32 do
for j=0 to 32 do
SetTile("sand", i, j)
end
end
</pre>
<a name="SetTileMap"></a>
<h3>ApplyTileMap(tilemapfile, x, y, width, height)</h3>
Apply a tilemap from a compact tilemap file to our tilemap.
<dl>
<dt>tilemapfile</dt>
<dd>Path to the tilemapfile.</dd>
</dl>
<p>
Note: This is for the new map format. Not implemented yet.
<h4>Example</h4>
<pre>
-- Load the full map from a file
SetTileMap("doomworld/doomworld.tmf", 0, 0, 64, 64)
-- Replace the middle square with a tilemap showing a volcano
SetTileMap("doomworld/volcano.tmf", 25, 25, 10, 10)
</pre>
<p>
<hr>
Last changed: $Id$<br>
All trademarks and copyrights on this page are owned by their respective owners.
<address>(c) 2002-2003 by <a href="http://stratagus.org">
The Stratagus Project</a></address></body></html>

View file

@ -1,179 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
---- (c) Copyright 2002-2004 by Lutz Sammer, Russell Smith
---- 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>Stratagus Configuration Language Description: PUD conversion</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
<meta name="Author" content="johns98@gmx.net">
<meta name="Keyword" content="ccl,pud">
<meta name="Description" content="">
</head>
<body>
<h1>Stratagus Configuration Language Description: PUD conversion</h1>
<hr><pre width=80>
_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
</pre>
<p><b>(C) Copyright 1998-2004 by The Stratagus Project. Distributed under the
<a href="../gpl.html">"GNU General Public License"</a></b>
<hr>
<a href="../index.html">Stratagus</a>
<a href="../faq.html">FAQ</a>
<a href="magic.html">PREV</a>
<a href="research.html">NEXT</a>
<a href="index.html">CCL Index</a>
<hr>
<a href="#DefineAiWcNames">DefineAiWcNames</a>
<a href="#DefineConstructionWcNames">DefineConstructionWcNames</a>
<a href="#DefineIconWcNames">DefineIconWcNames</a>
<a href="#DefineMissileTypeWcNames">DefineMissileTypeWcNames</a>
<a href="#DefineTilesetWcNames">DefineTilesetWcNames</a>
<a href="#DefineUpgradeWcNames">DefineUpgradeWcNames</a>
<a href="#DefineUnittypeWcNames">DefineUnittypeWcNames</a>
<hr>
<h2>Intro - Introduction to function for pud converting</h2>
This contains everything about converting from wc2.
<h2>Functions</h2>
<a name="DefineAiWcNames"></a>
<h3>DefineAiWcNames( "ai-0", "ai-1", ... )</h3>
Define AI mapping from original number to internal symbol.
The parameters are simply a list of ai names. The first name coresponds to pud ai number
0, the second name coresponds to pud ai number 1, and so on.
<h4>Example</h4>
<pre>
DefineAiWcNames(
"land-attack", "passive", "orc-03", "hum-04", "orc-04", "hum-05", "orc-05",
"hum-06", "orc-06", "hum-07", "orc-07", "hum-08", "orc-08", "hum-09", "orc-09",
"hum-10", "orc-10", "hum-11", "orc-11", "hum-12", "orc-12", "hum-13", "orc-13",
"hum-14-orange", "orc-14-blue", "sea-attack", "air-attack", "hum-14-red",
"hum-14-white", "hum-14-black", "orc-14-green", "orc-14-white", "orc-exp-04",
"orc-exp-05", "orc-exp-07a", "orc-exp-09", "orc-exp-10", "orc-exp-12", "orc-exp-06a",
"orc-exp-06b", "orc-exp-11a", "orc-exp-11b", "hum-exp-02a-red", "hum-exp-02b-black")
</pre>
<a name="DefineConstructionWcNames"></a>
<h3>DefineConstructionWcNames( "construction-0", "construction-1", ... )</h3>
Define construction mapping from original number to internal symbol.
The parameters are simply a list of construction names. The first name coresponds
to wc2 construction 0, the second name coresponds to construction 1, and so on.
<h4>Example</h4>
<pre>
DefineConstructionWcNames("human-shipyard", "orc-shipyard")
</pre>
<a name="DefineIconWcNames"></a>
<h3>DefineIconWcNames("icon-0", "icon-1", ... )</h3>
Define icon mapping from original number to internal symbol.
The parameters are simply a list of icon names. The first name coresponds
to wc2 icon 0, the second name coresponds to icon 1, and so on.<p>
<b>NOTE:</b>In the original there are only 195 icons
<h4>Example</h4>
<pre>
;; This is the default icon mapping.
DefineIconWcNames("icon-peasant", "icon-peon", "icon-footman")
</pre>
<a name="DefineMissileTypeWcNames"></a>
<h3>DefineMissileTypeWcNames("missile1", "missile2", ... )</h3>
Define missiletype mapping from original number to internal symbol.
The parameters are simply a list of missile names. The first name coresponds
to wc2 missile 0, the second name coresponds to missile 1, and so on.
<h4>Example</h4>
<pre>
DefineMissileTypeWcNames("missile-lightning", "missile-griffon-hammer")
</pre>
<a name="DefineTilesetWcNames"></a>
<h3>DefineTilesetWcNames("tileset-0", "tileset-1", ... )</h3>
Define tileset mapping from original number to internal symbol.
This is FIXED to 4 tileset, bad.
<dl>
<dt>tileset-0</dt>
<dd>Name of the tileset assigned to index 0 (summer).
</dd>
<dt>tileset-1</dt>
<dd>Name of the tileset assigned to index 1 (winter).
</dd>
<dt>tileset-2</dt>
<dd>Name of the tileset assigned to index 2 (wasteland).
</dd>
<dt>tileset-3</dt>
<dd>Name of the tileset assigned to index 3 (orc swamp).
</dd>
</dl>
<h4>Example</h4>
<pre>
-- This is the default tileset mapping.
DefineTilesetWcNames("tileset-summer", "tileset-winter", "tileset-wasteland", "tileset-swamp")
</pre>
<a name="DefineUpgradeWcNames"></a>
<h3>DefineUpgradeWcNames("upgrade-0", "upgrade-1", ... )</h3>
Define upgrade mapping from original number to internal symbol.
The parameters are simply a list of upgrade names. The first name coresponds
to wc2 upgrade 0, the second name coresponds to upgrade 1, and so on.
<h4>Example</h4>
<pre>
DefineUpgradeWcNames("upgrade-sword1", "upgrade-sword2")
</pre>
<a name="DefineUnitTypeWcNames"></a>
<h3>DefineUnitTypeWcNames("unit-0", "unit-1", ... )</h3>
Define unit-type mapping from original number to internal symbol.
The parameters are simply a list of upgrade names. The first name coresponds
to wc2 unit 0, the second name coresponds to wc2 unit 1, and so on.
<h4>Example</h4>
<pre>
DefineUnitTypeWcNames("unit-footman", "unit-grunt")
</pre>
<hr>
Last changed: $Id$<br>
All trademarks and copyrights on this page are owned by their respective owners.
<address>(c) 2002-2003 by <a href="http://stratagus.org">
The Stratagus Project</a></address></body></html>

View file

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
---- (c) Copyright 2002-2004 by Lutz Sammer, Russell Smith
---- (c) Copyright 2002-2004 by Russell Smith, François 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
@ -46,52 +46,131 @@
<a href="index.html">CCL Index</a>
<hr>
<a href="#DefineTileset">DefineTileset</a>
<a href="pud.html#DefineTilesetWcNames">DefineTilesetWcNames</a>
<a href="pud.html#DefineTileModel">DefineTileModel</a>
<hr>
<h2>Intro - Introduction to tileset functions and variables</h2>
Everything around the C Tileset structure.
A Tileset defines a set of tilemodels that can be used in a tiled map.
The map is thus devided in tiles.
<p>
Properties of tilemodels:
<ul>
<li> a graphic (or more if animated)
<li> Name
<li> Allowed tilemodel neighbours
<li> Speed (aka cost) modifiers
<li> Category (like 'land', 'water', 'beach', 'lava', 'walkable', ...)
<li> Ressources and how it can be harvested
<li> Destruction: how the tile can be destroyed. When destroyed the tile transforms into another tilemodel.
</ul>
<p>
Note: This is the for the new map format. Not implented yet.
<h2>Functions</h2>
<a name="DefineTileset"></a>
<h3>DefineTtileset( ident class name image palette slots animations)</h3>
<h3>DefineTileSet(name, width, height)</h3>
Define a tileset for the engine.<p>
Define a tileset to which tilemodels can be added.
The width and height define the size of each tile.
<p>
This could also be defined in own levels. <p>
FIXME:
Note: This is the for the new map format. Not implented yet.
<dl>
<dt>ident</dt>
<dd>.
</dd>
<dt>class</dt>
<dd>.
</dd>
<dt>name</dt>
<dd>.
<dd>Name of the tilemodel as exposed to the user in the editor and used in the scripts.
</dd>
<dt>image</dt>
<dd>.
<dt>width</dt>
<dd>width of the tiles. Most of the times, people use 32 pixels tiles.
</dd>
<dt>palette</dt>
<dd>.
</dd>
<dt>slots</dt>
<dd>.
</dd>
<dt>animations</dt>
<dd>.
<dt>height</dt>
<dd>height of the tiles. Most of the times, people use 32 pixels tiles.
</dd>
</dl>
<h4>Example</h4>
<pre>
DefineTileset( ... )
DefineTileset("desert", 32, 32)
</pre>
<a name="DefineTileModel"></a>
<h3>DefineTileModel(...)</h3>
Define a tile model which is used in the tilemap.
<p>
<p>
Note: This is the for the new map format. Not implented yet.
<dl>
<dt>name</dt>
<dd>Name of the tilemodel as exposed to the user in the editor</dd>
<dt>tileset</dt>
<dd>Name of the tileset this tilemodel is part of.</dd>
<dt>imagepath<br>
</dt>
<dd>Filename of the image with graphics of tiles.</dd>
<dt>imageposition</dt>
<dd>Position of the tile graphic in the graphic file.<br>
</dd>
<dt>categories = {category1, category2, ...}<br>
</dt>
<dd>Bool strings defined by DefineBool that identifies the categories
of this tylemodel. Examples: water, space, beach, land, grass. A tilemodel
will often be part of generic categories and more specific ones. For
example ground and grass. The categories allows to specify generic
behaviours and special ones. Building restrictions will use the
categories. </dd>
<dt>neighbours = {{N-neighbour}, {E-neighbour}, ...}</dt>
<dd>Names of the categories of tilemodels which can be used next to
this tilemodel.&nbsp; Each list is for a seperate direction:
north, east, south, west. This is useful only for the editor.<br>
<br>
Note: the current tilemodel can't be it's neighbour if it's not in one
of the categories listed here.</dd>
<dt>accessmodifier = {unitboolflag=modifier, unitboolflag2=modifier2, ...}</dt>
<dd>Speed modification in percents for units with the given
boolflag.&nbsp; Use 0 for unaccessible tiles.</dd>
<dt>harvest = {harvested= tilemodel, resource-name = quantity} </dt>
<dd><span style="font-style: italic;">harvested</span>: tilemodel
the tile transforms into when completely harvested.<br>
<span style="font-style: italic;">resource-name</span>: Name of
the resource available and in what quantity. <br>
Of course, harvest list isnt needed when the tile cannot be harvested.</dd>
<dt>destruction = {destroyed = tilemodel, damage = damage-value}</dt>
<dd><span style="font-style: italic;">destroyed</span>: tilemodel
the tile transforms into when destroyed.<br>
<span style="font-style: italic;">damage</span>: damage required
to destroy this tile.<br>
Of course destruction list isn't needed when the tile cant be destroyed.<br>
</dd>
</dl>
<h4>Example</h4>
<pre>
DefineTileModel("oily-sand", "desert",
"graphics/tilesets/desert.png", 12,
categories = {"land", "buildable"},
neighbours = {{"sand","beach-N"},{"sand","beach-E"},{"sand","beach-S"},{"sand","beach-W"}}
accessmodier = {groundtroups=50, ships=0, camels=200},
harvest= {harvested-tile="sand", oil=23},
destruction = {destroyed="sand", damage=100}
)
</pre>
<hr>
Last changed: $Id$<br>
All trademarks and copyrights on this page are owned by their respective owners.