Members
"Cost/BuildTime"
"Pack/Time"
"Player/MaxPopulation"
"Researcher/TechCostMultiplier/time"
"ResourceGatherer/BaseSpeed"
"Upgrade/Time"
(constant) DirectEffectsSchema
Resources
- Source:
(constant) StatusEffectsSchema
action
action
action
action
action
action
add
affects
affects
affects
affects
affects
affects
allowCapture
- Source:
angle
- Source:
angle
angle
attacker
attackerOwner
autocontinue
- Source:
autocontinue
- Source:
capture
cmd
- Source:
damage
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entities
- Source:
entity
- Source:
entity
- Source:
formation
- Source:
fromStatusEffect
g_Commands
- Source:
g_DebugCommands
- Source:
id
- Source:
len
lock
members
- Source:
message
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
message
- Source:
metadata
- Source:
minCount
- Source:
multiply
multiply
multiply
multiply
multiply
newentity
- Source:
owner
- Source:
parameter
parameter
parameters
- Source:
parameters
- Source:
player
player
player
player
player
player
player
- Source:
players
players
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
players
- Source:
pos
pos
pushFront
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
queued
- Source:
r
resourceTemplate
- Source:
resourceType
- Source:
route
- Source:
segments
selected
selected
source
- Source:
status
- Source:
status
- Source:
statusEffects
target
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
target
- Source:
targetClasses
- Source:
targetClasses
- Source:
targetPlayer
- Source:
template
template
template
templates
- Source:
text
tracks
translateMessage
translateMessage
- Source:
translateMessage
- Source:
translateMessage
- Source:
translateMessage
- Source:
translateMessage
- Source:
translateMessage
- Source:
translateParameters
- Source:
translateParameters
- Source:
type
type
type
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
type
- Source:
x
- Source:
x
- Source:
x
- Source:
x
- Source:
x
- Source:
x
- Source:
x
- Source:
z
- Source:
z
- Source:
z
- Source:
z
- Source:
z
- Source:
z
- Source:
z
- Source:
Methods
ApplyValueModificationsToEntity()
- Source:
ApplyValueModificationsToTemplate()
- Source:
CanControlUnit()
Check if player can control this entity
returns: true if the entity is owned by the player and controllable
or control all units is activated, else false
- Source:
CanMoveEntsIntoFormation()
- Source:
CanOwnerControlEntity() → {boolean}
- Source:
Returns:
- Whether the owner of this entity can control the entity.
- Type
- boolean
CanPlayerOrAllyControlUnit() → {boolean}
Check if player can control this entity
- Source:
Returns:
- True if the entity is valid and controlled by the player
or the entity is owned by an mutualAlly and can be controlled
or control all units is activated, else false.
- Type
- boolean
ChangeEntityTemplate()
- Source:
Cheat()
ClusterEntities()
Group a list of entities in clusters via single-links
- Source:
CopyControlGroups()
Copy over the obstruction control group IDs.
This is needed to ensure that when a group of structures with the same
control groups is replaced by a new entity, they remains in the same control group(s).
This is the mechanism that is used to e.g. enable wall pieces to be built closely
together, ignoring their mutual obstruction shapes (since they would
otherwise be prevented from being built so closely together).
- Source:
DeleteEntityAndReturn()
- Source:
ExtractFormations()
Get some information about the formations used by entities.
- Source:
FilterEntityList()
Filter entities which the player can control.
- Source:
FilterEntityListWithAllies()
Filter entities which the player can control or are mutualAlly
- Source:
GetDockAngle()
Tries to find the best angle to put a dock at a given position
Taken from GuiInterface.js
- Source:
GetFormationRequirements()
- Source:
GetFormationUnitAIs()
Returns a list of UnitAI components, each belonging either to a
selected unit or to a formation entity for groups of the selected units.
- Source:
GetPlayerTemplateName()
GetRallyPointCommands()
- Source:
GetUpgradedTemplate(playerId, templateName)
Parameters:
| Name | Type | Description |
|---|---|---|
playerId |
number | the player id to check technologies for. |
templateName |
string | the original template name. |
- Source:
Returns:
the upgraded template name if it exists else the original template.
GetWallPlacement(placementData, wallSet, start, end)
Returns the wall piece entities needed to construct a wall between start.pos and end.pos. Assumes start.pos != end.pos.
The result is an array of objects, each one containing the following information about a single wall piece entity:
- 'template': the template name of the entity
- 'pos': position of the entity, as an object with keys 'x' and 'z'
- 'angle': orientation of the entity, as an angle in radians
All the pieces in the resulting array are ordered left-to-right (or right-to-left) as they appear in the physical wall.
Parameters:
| Name | Type | Description |
|---|---|---|
placementData |
Object that associates the wall piece template names with information about those kinds of pieces. Expects placementData[templateName].templateData to contain the parsed template information about the template whose filename is templateName. | |
wallSet |
Object that primarily holds the template names for the supported wall pieces in this set (under the 'templates' key), as well as the min and max allowed overlap factors (see GetWallSegmentsRec). Expected to contain template names for keys "long" (long wall segment), "medium" (medium wall segment), "short" (short wall segment), "tower" (intermediate tower between wall segments), "gate" (replacement for long walls). | |
start |
Object holding the starting position of the wall. Must contain keys 'x' and 'z'. | |
end |
Object holding the ending position of the wall. Must contains keys 'x' and 'z'. |
GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, distSoFar, segments)
Helper function for GetWallPlacement. Finds a list of wall segments and the corresponding remaining spacing/overlap
distance "r" that will suffice to construct a wall of the given distance. It is understood that two extra towers will
be placed centered at the starting and ending points of the wall.
Parameters:
| Name | Type | Description |
|---|---|---|
d |
Total distance between starting and ending points (constant throughout calls). | |
candidateSegments |
List of candidate segments (constant throughout calls). Should be ordered longer-to-shorter for better execution speed. | |
minOverlap |
Minimum overlap factor (constant throughout calls). Must have a value between 0 (meaning walls are not allowed to overlap towers) and 1 (meaning they're allowed to overlap towers entirely). Must be <= maxOverlap. | |
maxOverlap |
Maximum overlap factor (constant throughout calls). Must have a value between 0 (meaning walls are not allowed to overlap towers) and 1 (meaning they're allowed to overlap towers entirely). Must be >= minOverlap. | |
t |
Length of a single tower (constant throughout calls). Acts as buffer space for wall segments (see comments). | |
distSoFar |
Sum of all the wall segments' lengths in 'segments'. | |
segments |
Current list of wall segments placed. |
IncurBribeCost()
Incur the player with the cost of a bribe, optionally multiply the cost with
the additionalMultiplier
- Source:
InitGame()
- Source:
IsOwnedByAllyOfEntity()
Returns true if the entity 'target' is owned by an ally of
the owner of 'entity'.
IsOwnedByAllyOfPlayer()
Returns true if the entity 'target' is owned by an ally of player
IsOwnedByEnemyOfPlayer()
IsOwnedByEntityHelper()
IsOwnedByGaia()
IsOwnedByHelper()
IsOwnedByMutualAllyOfEntity()
IsOwnedByMutualAllyOfPlayer()
IsOwnedByNeutralOfPlayer()
IsOwnedByPlayer()
Returns true if the entity 'target' is owned by player
IsOwnedByPlayerOrMutualAlly(entity, player) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
entity |
number | The entityID to verify. |
player |
number | The playerID to check against. |
- Source:
Returns:
.
- Type
- boolean
LoadMapSettings()
Used to initialize non-player settings relevant to the map, like
default stance and victory conditions. DO NOT load players here
LoadPlayerSettings()
Used to create player entities prior to reading the rest of a map,
all other initialization must be done after loading map (terrain/entities).
Be VERY careful in using other components here, as they may not be properly initialised yet.
settings is the object containing settings for this map.
newPlayers if true will remove old player entities or add new ones until
the new number of player entities is obtained
(used when loading a map or when Atlas changes the number of players).
ObstructionsBlockingTemplateChange()
- Source:
PlaySound(name)
Simple wrapper function for playing sounds that are associated with entities
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Typically one of 'walk', 'run', 'attack', 'death', 'build', 'gather_fruit', 'gather_grain', 'gather_wood', 'gather_stone', 'gather_metal' |
PreInitGame()
Called when the map has been loaded, but before the simulation has started.
Only called when a new game is started, not when loading a saved game.
- Source:
ProcessCommand()
- Source:
QueryBuilderListInterface()
Similar to Engine.QueryInterface, but checks for all interfaces
implementing a builder list (currently Foundation and Repairable)
TODO Foundation and Repairable could both implement a BuilderList component
QueryMiragedInterface()
Similar to Engine.QueryInterface but first checks if the entity
mirages the interface.
QueryOwnerEntityID(id)
Parameters:
| Name | Type | Description |
|---|---|---|
id |
An entity's ID |
Returns:
The entity ID of the owner player (not his player ID) or ent if ent is a player entity.
QueryOwnerInterface()
Similar to Engine.QueryInterface but applies to the player entity
that owns the given entity.
iid is typically IID_Player.
QueryPlayerIDInterface()
Similar to Engine.QueryInterface but applies to the player entity
with the given ID number.
iid is typically IID_Player.
RemoveFromFormation()
Remove the given list of entities from their current formations.
- Source:
TransferGarrisonedUnits()
- Source:
TryConstructBuilding()
Attempts to construct a building using the specified parameters.
Returns true on success, false on failure.
- Source:
TryConstructWall()
- Source:
notifyBackToWorkFailure()
Sends a GUI notification about worker(s) that failed to go back to work.
- Source:
notifyOrderFailure(player)
Sends a GUI notification about entities that can't be controlled.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
number | The player-ID of the player that needs to receive this message. |
- Source:
notifyUnloadFailure()
Sends a GUI notification about unit(s) that failed to ungarrison.
- Source: