_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

Stratagus Configuration Language Description: Map Presentation


Stratagus FAQ PREV NEXT LUA Index
PresentMap DefinePlayerTypes SetMapMiniImage DefineMapSetup GetMapOption DefineMapOption

Intro - Introduction to functions to present maps

A map is defined in 2 steps:

This page documents map presentation functions.

PresentMap(description, numplayers, mapwidth, mapheight, mapuid)

description
A textual description of the map that can be displayed to the user.
numplayers
The maximum number of players for this map.
mapwidth and mapheight
The sizes of the map.
mapuid
Random number to distinguish maps with the same file name. Be sure to change this number when changing the map.

Example

    PresentMap("Doom World", 4, 64, 64)

SetMapMiniImage(mapimage)

Set a small image of the map to display when the user previews the map.

mapimage
Path to the file with the graphic.

Note: This is for the new map format. Not implemented yet.

Example

    SetMiniImage("doomworld/doomworld.png")

DefinePlayerType(player1, player2, ...)

Define the number of players and their type on the map. Possible values for player type are:

Example

    DefinePlayerTypes("person", "person")

DefineMapSetup(luafile)

Define the map setup file that will be loaded if the player starts a game with this map.

Example

    DefineMapSetup("doomworld/doomworld.map")

GetMapOption(name)

Returns the value of the option.

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.

Note: This is for the new map format. Not implemented yet.

Example

    tileset = GetMapOption("tileset")

DefineMapOption(name, {possible-values})

name
Name of the option.
possible-values
List of values the player can select. The first value is the default value.

Note: This is for the new map format. Not implemented yet.

Example

   DefineMapOption("Resources", {"Map default", "Low", "Medium", "High"})
   DefineMapOption("Difficulty", {"finger in the nose", "easy", "mission impossible"})
   DefineMapOption("TileSet", {"desert", "winter", "forest"})


(C) Copyright 2002-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.