| 
  
   Size: 6628 
  
  Comment:  
 | 
    ← Revision 25 as of 2019-12-18 17:18:13  ⇥ 
  Size: 2113 
  
  Comment:  
 | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 1: | Line 1: | 
| ## page was renamed from Buildings ## page was renamed from BuildingsVars <<TableOfContents>>  | 
Building objects can reference details about the buildings currently built or still in progress in your cities. | 
| Line 5: | Line 3: | 
| Each city has up to 74 possible buildings on it, 32 spaces inside plus walls and town hall, and 40 spaces outside. | See also: [[BuildingTypes|Building Types]]<<BR>> See also: [[BuildingFunctions|Building Functions|]]  | 
| Line 7: | Line 6: | 
| The first building you start with is city.building[73] (The Town Hall) and each building you construct after that takes the next available number counting back to 0... (72,71,70,69,etc) | '''These objects can be referenced as:''' | 
| Line 9: | Line 8: | 
| In the following examples, x can be any number from 0-73: |  . ''m_city.cityManager.buildings[x].property '''or''' city.buildings[x].property'' . ''m_city.cityManager.function.property '''or''' city.function.property''  | 
| Line 11: | Line 11: | 
| When referencing these objects via the Building object, the ''[x]'' can be any number from 0-73. Each city has up to 74 possible buildings on it, 32 spaces inside plus walls and town hall, and 40 spaces outside. The first building you start with is city.building[73] (The Town Hall) and each building you construct after that takes the next available number counting back to 0... (72,71,70,69,etc) | |
| Line 12: | Line 13: | 
| When referencing these objects via a function, please see BuildingFunctions. For example, city.getBuildingByTypeId(25).level would tell you the level of the academy. | |
| Line 13: | Line 15: | 
| == buildings[x].name == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].name || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[0].name ||  | 
||<tablewidth="796px" tableheight="123px"#cccccc>'''Property ''' ||<#cccccc>'''Type''' ||<#cccccc>'''Description ''' || ||name ||String ||The name of the type of building ("Forge","Stable","Inn",etc.) || ||positionId ||int ||The number indicating the position id of the building. Town Hall is in position -1. See images below for each position id. || ||status ||int ||The active status of the building. 0 = complete, 1 = upgrading, 2 = demolishing. || ||endTime ||int ||Returns the time in UNIX timestamp format indicating when building will be finished upgrading or demolishing. Returns 0 if not being worked on. || ||startTime ||int ||Returns the time in UNIX timestamp format indicating when building began upgrading or demolishing. Returns 0 if not being worked on. || ||typeId ||int ||Returns the numerical code for the [[BuildingTypes]] || ||level ||int ||Returns the level of the building. || ||length ||int ||Returns the total number of buildings in the city. ||  | 
| Line 17: | Line 25: | 
| ''' Position IDs for Building ''' | |
| Line 18: | Line 27: | 
| The name of the type of building ("Forge","Stable","Inn",etc.) == buildings[x].positionId == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].positionId || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[0].positionId || The numbers below indicate the .positionId (city.building[x].positionId) (The Town Hall is in position -1) == buildings[x].status == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].status || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[0].status || 0 = building complete 1 = upgrading 2 = demolishing == buildings[x].endTime == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].endTime || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[1].endTime || returns the time in UNIX timestamp format indicating when building will be finished upgrading or demolishing (returns 0 if it is not being worked on) == buildings[x].startTime == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].startTime || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[1].startTime || returns the time in UNIX timestamp format indicating when building began being upgraded or demolished (returns 0 if it is not being worked on) == buildings[x].typeId == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].typeId || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[1].typeId || The numerical code for the [[buildingType]] == buildings[x].level == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[x].level || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings[1].level || level of the building == buildings.length == ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start; " tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings.length || ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em; ">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">city.buildings.length || Total number of buildings in the current city  | 
{{http://i.imgur.com/IRtmGbf.png}} {{http://i.imgur.com/r1Voz7t.png}} | 
| Line 90: | Line 30: | 
| [[ObjectCity|City]] | ScriptObjects | 
Building objects can reference details about the buildings currently built or still in progress in your cities.
See also: Building Types
 See also: Building Functions 
These objects can be referenced as:
m_city.cityManager.buildings[x].property or city.buildings[x].property
m_city.cityManager.function.property or city.function.property
When referencing these objects via the Building object, the [x] can be any number from 0-73. Each city has up to 74 possible buildings on it, 32 spaces inside plus walls and town hall, and 40 spaces outside. The first building you start with is city.building[73] (The Town Hall) and each building you construct after that takes the next available number counting back to 0... (72,71,70,69,etc)
When referencing these objects via a function, please see BuildingFunctions. For example, city.getBuildingByTypeId(25).level would tell you the level of the academy.
Property  | 
  Type  | 
  Description  | 
name  | 
  String  | 
  The name of the type of building ("Forge","Stable","Inn",etc.)  | 
positionId  | 
  int  | 
  The number indicating the position id of the building. Town Hall is in position -1. See images below for each position id.  | 
status  | 
  int  | 
  The active status of the building. 0 = complete, 1 = upgrading, 2 = demolishing.  | 
endTime  | 
  int  | 
  Returns the time in UNIX timestamp format indicating when building will be finished upgrading or demolishing. Returns 0 if not being worked on.  | 
startTime  | 
  int  | 
  Returns the time in UNIX timestamp format indicating when building began upgrading or demolishing. Returns 0 if not being worked on.  | 
typeId  | 
  int  | 
  Returns the numerical code for the BuildingTypes  | 
level  | 
  int  | 
  Returns the level of the building.  | 
length  | 
  int  | 
  Returns the total number of buildings in the city.  | 
Position IDs for Building
 
 

![[+]](/moin_static/explorer/img/toggle1.png)

![[-]](/moin_static/explorer/img/toggle0.png)
