| CanPlaceFeature |
mgr:CanPlaceFeature(x, y, feature [, params/bool]) or mgr:CanPlaceFeature(plot, feature [, params/bool]) |
1 boolean |
no |
high |
Asks the terrain builder whether a feature can be placed on a plot. Returns false (no error) when too few args, plot cannot be parsed, plot is outside map bounds or feature param is -1. Read-only check. |
| CanPlaceImprovement |
mgr:CanPlaceImprovement(x, y, improvement [, player [, flag]]) |
1 boolean |
no (probably) |
medium |
Asks the improvement builder whether an improvement can be placed on a plot. Wrapper requires at least 3 args after self (it passes 3 to the plot helper), so the plot-object form needs a further arg or it returns false. Plot pointer not null-checked in wrapper. |
| CanPlaceResource |
mgr:CanPlaceResource(x, y, resource [, flag]) or mgr:CanPlaceResource(plot, resource) |
1 boolean |
no (probably) |
medium |
Asks the resource builder whether a resource can be placed on a plot. Form guessed from arg count: exactly 2 args after self is parsed as plot,resource; 3+ as x,y,resource,flag. So plot,resource,flag is read as x,y form. Returns false with <2 args. |
| DoesPlotBorderRiver |
mgr:DoesPlotBorderRiver(x, y) or mgr:DoesPlotBorderRiver(plot) |
1 boolean |
no |
high |
Returns whether the plot borders a river (WorldBuilder::Map::Manager::DoesPlotBorderRiver). Returns false if the plot cannot be parsed. |
| EditCliff |
mgr:EditCliff(x, y, direction, bAdd [, flag]) |
1 boolean (result of Manager::EditCliff) |
yes |
high |
Adds or removes a cliff on a plot edge in the given direction through WorldBuilder::Map::Manager::EditCliff. Returns false when args are missing (needs 3+ after self) or plot unparsable. Recorded as CommandEditCliff via Command::Manager::Do. |
| EditRiver |
local ok, code = mgr:EditRiver(x, y, direction, bAdd [, flag]) |
2 values: boolean (true when result code == 0), number (IResultCode) |
yes |
high |
Adds or removes a river segment on a plot edge through WorldBuilder::Map::Manager::EditRiver, returning success and a result code. On bad args returns false, 0. Non-zero code means the edit was refused; code meanings not decoded. |
| GetContinentPlots |
local plots = mgr:GetContinentPlots(continentIndex) |
1 table (array of 0-based plot indices) or nil |
no |
high |
Returns the plot indices belonging to a continent (land plots and lakes, excluding other water). Returns nil unless exactly one argument is given and it is a number. Table is empty if the continent has none. |
| GetDimensionsFromTiled |
local w, h = mgr:GetDimensionsFromTiled() |
2 numbers (width, height); defaults 64 and 48 when the file/attributes cannot be read |
no |
high |
Reads width and height attributes of the root |
| GetFeaturePlacementPlotList |
WorldBuilder.MapManager.GetFeaturePlacementPlotList(self, x, y, feature [, params]) |
1 table of numbers (probably plot indices, inference) or nothing |
no (probably) |
medium |
Returns a list of plots (numbers) related to placing a feature at a plot, from the terrain builder. Registered as static (no instance check). Returns nothing when plot is invalid or list is empty. luaL_checkinteger raises a Lua error on a non-number feature. |
| GetPlotValue |
mgr:GetPlotValue(plotIndex, valueType [, name]) |
1 value (variant converted by script system) or nothing if plot arg invalid |
no (probably) |
medium |
Returns a stored per-plot value entry (value type, optional name) from WorldBuilder::Map::Manager. Type is read from fixed slot 3, so an x,y plot form would misplace it. Returns nothing on bad plot. |
| IsImprovementPlaceable |
WorldBuilder.MapManager.IsImprovementPlaceable(self, resourceType) |
1 boolean |
no (probably) |
low |
Checks resource-definition data: true if the resource has valid-feature entries (own list non-empty, or a Resource_ValidFeature row matches its type name). Despite the name the code reads Resource definitions, not improvements; the intent is a guess (probably 'resource needs a feature'). Static; false on missing arg or unknown index. |
| IsWonderTooClose |
mgr:IsWonderTooClose(plot, feature) |
1 boolean |
no (probably) |
medium |
Returns true when a plot is too close to another natural wonder for the given feature (inverse of NaturalWonderDistanceCheck). False if args missing, plot not found, or plot null. Pass a plot object/index. |
| LoadPlotsFromTiled |
mgr:LoadPlotsFromTiled() |
nothing |
no (probably) |
medium |
Loads the Tiled (.tmx XML) map file named by the map import filename and places terrain/feature/resource/improvement/continent/district/building layers onto the map's plots. Fails silently (map filled/reset, no error) if the file or |
| SetAllRevealed |
mgr:SetAllRevealed(bRevealed, player) |
1 boolean |
yes |
high |
Reveals or hides the whole map for a player, grouped as one command block. Returns false unless both args given. No player validation in wrapper. |
| SetCoastalLowland |
mgr:SetCoastalLowland(x, y, lowlandType) or mgr:SetCoastalLowland(plot, lowlandType) |
1 boolean, always false |
no |
high |
Adds a coastal lowland (flood) type to a plot directly through the terrain manager's CoastalLowlandDataHandler. Return value is constant false even on success. Plot index computed as width*y+x without bounds check. No undo command. |
| SetContinentType |
mgr:SetContinentType(plot, continent) |
1 boolean (result of SetContinent) |
yes (probably) |
medium |
Sets a plot's continent via WorldBuilder::Map::Manager::SetContinent. False when args missing/plot unparsable. Recorded via Do (probably terrain unchanged, continent set). |
| SetFeatureType |
mgr:SetFeatureType(x, y, feature [, params/bool]) or mgr:SetFeatureType(plot, feature ...) |
1 boolean (result of SetFeature) |
yes (probably) |
medium |
Sets (or changes) the feature on a plot via WorldBuilder::Map::Manager::SetFeature. Feature and direction default to -1 when not given. -1 as feature probably clears it (guess). Validity checks are inside Manager::SetFeature (not read). |
| SetImprovementPillaged |
mgr:SetImprovementPillaged(x, y, bPillaged) or mgr:SetImprovementPillaged(plot, bPillaged) |
1 boolean, always false |
no (probably) |
medium |
Sets the pillaged state of the improvement on a plot directly via the improvement builder. Always returns false even on success; no WorldBuilder command, so not undoable. Plot-vs-x,y form is guessed from arg count (exactly 2 args after self = plot,bool). |
| SetImprovementType |
mgr:SetImprovementType(x, y, improvement [, player]) or mgr:SetImprovementType(plot, improvement) |
1 boolean (result of SetImprovement) |
yes |
high |
Sets the improvement on a plot (optionally with owner player) via WorldBuilder::Map::Manager::SetImprovement. Arg-count heuristic: exactly 2 args after self = plot,improvement; 3+ = x,y,improvement,player, so plot,improvement,player is read as x,y form. |
| SetPlotValue |
mgr:SetPlotValue(plotIndex, valueType, [name,] value) |
nothing |
unknown |
medium |
Stores a per-plot value entry (type, optional name, integer or string value) through WorldBuilder::Map::Manager::SetPlotValue. Silent no-op when plot arg unparsable. Number values truncated to int. Undo not visible in callee data. |
| SetResourceType |
mgr:SetResourceType(x, y, resource [, amount]) or mgr:SetResourceType(plot, resource) |
1 boolean (result of SetResource) |
yes |
high |
Sets the resource (with amount) on a plot via WorldBuilder::Map::Manager::SetResource. Arg-count heuristic as other Set* methods. Placement validity not checked in wrapper; use CanPlaceResource first. |
| SetRevealed |
mgr:SetRevealed(x, y, bRevealed, player) |
1 boolean |
yes (probably) |
medium |
Reveals or hides one plot for a player via WorldBuilder::Map::Manager::SetRevealed. Needs 3+ args after self; wrapper tells plot helper 2 args remain, so x,y form is probably required (inference). |
| SetRouteType |
mgr:SetRouteType(x, y, route [, flag]) or mgr:SetRouteType(plot, route) |
1 boolean (result of SetRoute) |
yes |
high |
Sets the route on a plot via WorldBuilder::Map::Manager::SetRoute. Arg-count heuristic: plot,route,flag is read as x,y form. |
| SetTerrainType |
mgr:SetTerrainType(plot, terrain) |
1 boolean (result of SetTerrain) |
yes (probably) |
medium |
Sets the terrain of a plot via WorldBuilder::Map::Manager::SetTerrain, and removes the plot's resource if it no longer fits the new terrain. Several commands are issued for one call. Only the plot-object form is parsed (helper told 1 arg). |