scripting:reference:system_functions:constructionfunctions
This is an old revision of the document!
Table of Contents
Building Construction Functions
System functions that allow you to construct buildings in the world and set/query construction parameters
sysIsBuildingPositionValid
| Format | sysIsBuildingPositionValid( [Building Type] ) |
|---|---|
| Description | Checks whether the player's current position is a valid place to add a building of the specified type |
| Parameters | Building Type number |
| Returns | 1 if the position is valid, 0 if not |
Example:
Event( "PlaceAnyBuilding", "" )
{
$buildingType = $gParam[1]
$isValid = sysIsBuildingPositionValid( $buildingType )
if ( $isValid == 1 )
{
$buildingName = sysGetTextEntry()
$constrAmount = -1
$didAdd = sysAddBuildingWorld( $buildingType,$gPlayerID,$gPlayerWorldX,$gPlayerWorldY,$buildingName,$constrAmount )
}
}
sysAddBuilding
| Format | sysAddBuilding ( [Building Type], [Owner ID], [MapX], [MapY], [ [Building_Name], [Construction Amount 1], [Construction Amount 2] ] ) ) |
|---|---|
| Description | Used to add a new building to your world |
| Parameters | Building Type number |
| Owner player ID | |
| Map Coordinate X | |
| Map Coordinate Y | |
| (Optional) Building Name | |
| (Optional) Construction Amount 1 | |
| (Optional) Construction Amount 2 | |
| Returns | 1 if the building was added to the world, 0 if not |
Example:
Event( "PlaceAnyBuilding", "" )
{
$nBuildingType = $gParam[1]
$valid = sysIsBuildingPositionValid( $nBuildingType )
if ( $valid = 1 )
{
$buildingName = sysGetTextEntry()
$didAdd = sysAddBuilding( nBuildingType,$gPlayerID,$gPlayerX,$gPlayerY,$buildingName )
}
}
sysAddBuildingWorld
TBD
sysGetBuildingTypeName
TBD
sysGetConstructionMaterialsAmount
TBD
sysIsInBuildZone
TBD
sysIsInNoBuildZone
TBD
scripting/reference/system_functions/constructionfunctions.1580298277.txt.gz · Last modified: (external edit)
