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

script_map.cpp File Reference
#include "stratagus.h"
#include "map.h"
#include "fov.h"
#include "fow.h"
#include "iolib.h"
#include "netconnect.h"
#include "network.h"
#include "script.h"
#include "tileset.h"
#include "translate.h"
#include "ui.h"
#include "unit.h"
#include "version.h"
#include "video.h"

Functions

script_map.cpp - The map ccl functions.
static int CclStratagusMap (lua_State *l)
 
static int CclRevealMap (lua_State *l)
 
static int CclCenterMap (lua_State *l)
 
static int CclSetStartView (lua_State *l)
 
static int CclShowMapLocation (lua_State *l)
 
static int CclSetFogOfWar (lua_State *l)
 
static int CclGetFogOfWar (lua_State *l)
 
static int CclSetMinimapTerrain (lua_State *l)
 
static int CclSetEnableMapGrid (lua_State *l)
 
static int CclGetIsMapGridEnabled (lua_State *l)
 
static int CclSetFieldOfViewType (lua_State *l)
 
static int CclGetFieldOfViewType (lua_State *l)
 
static int CclSetOpaqueFor (lua_State *l)
 
static int CclGetIsOpaqueFor (lua_State *l)
 
static int CclRemoveOpaqueFor (lua_State *l)
 
static int CclSetFogOfWarType (lua_State *l)
 
static int CclGetFogOfWarType (lua_State *l)
 
static int CclSetFogOfWarOpacityLevels (lua_State *l)
 
static int CclSetFogOfWarBlur (lua_State *l)
 
static int CclSetFogOfWarBilinear (lua_State *l)
 
static int CclGetIsFogOfWarBilinear (lua_State *l)
 
static int CclSetForestRegeneration (lua_State *l)
 
static int CclSetFogOfWarColor (lua_State *l)
 
static int CclSetFogOfWarGraphics (lua_State *l)
 
static int CclSetMMFogOfWarOpacityLevels (lua_State *l)
 
static int CclSetTileSize (lua_State *l)
 
void SetTile (unsigned int tileIndex, const Vec2i &pos, int value)
 Set a tile. More...
 
static int CclDefinePlayerTypes (lua_State *l)
 
static int CclLoadTileModels (lua_State *l)
 
static int CclDefineTileset (lua_State *l)
 
static int CclBuildTilesetTables (lua_State *l)
 
static int CclSetTileFlags (lua_State *l)
 
static int CclGetTileTerrainName (lua_State *l)
 
static int CclGetTileTerrainHasFlag (lua_State *l)
 
static int CclSetEnableWallsForSP (lua_State *l)
 
static int CclIsWallsEnabledForSP (lua_State *l)
 
static int CclGetIsGameHoster (lua_State *l)
 
void MapCclRegister ()
 register ccl features More...
 

Function Documentation

◆ CclBuildTilesetTables()

static int CclBuildTilesetTables ( lua_State *  l)
static

Build tileset tables like humanWallTable or mixedLookupTable

Called after DefineTileset and only for tilesets that have wall, trees and rocks. This function will be deleted when removing support of walls and alike in the tileset.

◆ CclCenterMap()

static int CclCenterMap ( lua_State *  l)
static

Description

Center the map.

Parameters
lLua state.

Example:

– Center the view at position x=11 and y=1. CenterMap(11, 1)

◆ CclDefinePlayerTypes()

static int CclDefinePlayerTypes ( lua_State *  l)
static

Define the type of each player available for the map

Parameters
lLua state.

◆ CclDefineTileset()

static int CclDefineTileset ( lua_State *  l)
static

Define tileset

Parameters
lLua state.

◆ CclGetFieldOfViewType()

static int CclGetFieldOfViewType ( lua_State *  l)
static

Get unit's field of view type - ShadowCasting or SimpleRadial

◆ CclGetFogOfWar()

static int CclGetFogOfWar ( lua_State *  l)
static

Description

Get if the fog of war is enabled.

Parameters
lLua state.

Example:

GetFogOfWar()

◆ CclGetFogOfWarType()

static int CclGetFogOfWarType ( lua_State *  l)
static

Get Fog of War type - legacy or enhanced

◆ CclGetIsFogOfWarBilinear()

static int CclGetIsFogOfWarBilinear ( lua_State *  l)
static

Check if FOW bilinear upscaling enabled

◆ CclGetIsGameHoster()

static int CclGetIsGameHoster ( lua_State *  l)
static

Check if network game was created on this PC

◆ CclGetIsMapGridEnabled()

static int CclGetIsMapGridEnabled ( lua_State *  l)
static

Check if map grid is enabled

◆ CclGetIsOpaqueFor()

static int CclGetIsOpaqueFor ( lua_State *  l)
static

Check opacity for the tile's terrain.

Parameters
lLua state.

◆ CclGetTileTerrainHasFlag()

static int CclGetTileTerrainHasFlag ( lua_State *  l)
static

Check if the tile's terrain has a particular flag.

Parameters
lLua state.
Returns
True if has the flag, false if not.

◆ CclGetTileTerrainName()

static int CclGetTileTerrainName ( lua_State *  l)
static

Get the name of the terrain of the tile.

Parameters
lLua state.
Returns
The name of the terrain of the tile.

◆ CclIsWallsEnabledForSP()

static int CclIsWallsEnabledForSP ( lua_State *  l)
static

Check if walls enabled for single player games (for debug purposes)

◆ CclLoadTileModels()

static int CclLoadTileModels ( lua_State *  l)
static

Load the lua file which will define the tile models

Parameters
lLua state.

◆ CclRemoveOpaqueFor()

static int CclRemoveOpaqueFor ( lua_State *  l)
static

◆ CclRevealMap()

static int CclRevealMap ( lua_State *  l)
static

Reveal the complete map.

Parameters
lLua state.

◆ CclSetEnableMapGrid()

static int CclSetEnableMapGrid ( lua_State *  l)
static

Activate map grid (true|false)

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetEnableWallsForSP()

static int CclSetEnableWallsForSP ( lua_State *  l)
static

Enable walls enabled for single player games (for debug purposes)

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetFieldOfViewType()

static int CclSetFieldOfViewType ( lua_State *  l)
static

Select unit's field of view algorithm - ShadowCasting or SimpleRadial

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

Tiled types of FOW don't work with shadow casting

◆ CclSetFogOfWar()

static int CclSetFogOfWar ( lua_State *  l)
static

Description

Set fog of war on/off.

Example:

SetFogOfWar(true)
Parameters
lLua state.

◆ CclSetFogOfWarBilinear()

static int CclSetFogOfWarBilinear ( lua_State *  l)
static

Activate FOW bilinear upscaling type (true|false)

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetFogOfWarBlur()

static int CclSetFogOfWarBlur ( lua_State *  l)
static

Set parameters for FOW blurer (radiuses and number of iterations)

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetFogOfWarColor()

static int CclSetFogOfWarColor ( lua_State *  l)
static

Description

Set Fog color.

Parameters
lLua state.

Example:

– Red fog of war SetFogOfWarColor(128,0,0)

◆ CclSetFogOfWarGraphics()

static int CclSetFogOfWarGraphics ( lua_State *  l)
static

Define Fog graphics

Parameters
lLua state.

◆ CclSetFogOfWarOpacityLevels()

static int CclSetFogOfWarOpacityLevels ( lua_State *  l)
static

Set opacity (alpha) for different levels of fog of war - explored, revealed, unseen

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetFogOfWarType()

static int CclSetFogOfWarType ( lua_State *  l)
static

Select which type of Fog of War to use

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

Tiled types of FOW don't work with shadow casting

◆ CclSetForestRegeneration()

static int CclSetForestRegeneration ( lua_State *  l)
static

Description

Set forest regeneration speed.

Parameters
lLua state.
Returns
Old speed

Example:

– No regeneration. SetForestRegeneration(0) – Slow regeneration every 50 seconds SetForestRegeneration(50) – Extremely slow regeneration every 1h of game time SetForestRegeneration(3600)

◆ CclSetMinimapTerrain()

static int CclSetMinimapTerrain ( lua_State *  l)
static

Description

Enable display of terrain in minimap.

Parameters
lLua state.

Example:

– Show the minimap terrain SetMinimapTerrain(true)

◆ CclSetMMFogOfWarOpacityLevels()

static int CclSetMMFogOfWarOpacityLevels ( lua_State *  l)
static

Set opacity (alpha) for different levels of fog of war - explored, revealed, unexplored for mini map

Parameters
lLua state.
Returns
0 for success, 1 for wrong type;

◆ CclSetOpaqueFor()

static int CclSetOpaqueFor ( lua_State *  l)
static

Set opaque for the tile's terrain.

Parameters
lLua state.
Returns
0 for success, 1 for wrong tile's terrain;

◆ CclSetStartView()

static int CclSetStartView ( lua_State *  l)
static

Description

Define the starting viewpoint for a given player.

Parameters
lLua state.

Example:

– Start view for player 0. SetStartView(0, 25, 12) – Start view for player 1. SetStartView(1, 71, 38)

◆ CclSetTileFlags()

static int CclSetTileFlags ( lua_State *  l)
static

Set the flags like "water" for a tile of a tileset

Parameters
lLua state.

◆ CclSetTileSize()

static int CclSetTileSize ( lua_State *  l)
static

Description

Define size in pixels (x,y) of a tile in this game

Parameters
lLua state.

Example:

SetTileSize(32,32)

◆ CclShowMapLocation()

static int CclShowMapLocation ( lua_State *  l)
static

Show Map Location

Parameters
lLua state.

◆ CclStratagusMap()

static int CclStratagusMap ( lua_State *  l)
static

Parse a map.

Parameters
lLua state.

◆ MapCclRegister()

void MapCclRegister ( )

register ccl features

Register CCL features for map.

◆ SetTile()

void SetTile ( unsigned int  tileIndex,
const Vec2i pos,
int  value 
)

Set a tile.

Set a tile

Parameters
tileIndexTile number
poscoordinate
valueValue of the tile
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.