{"__v":18,"_id":"550a42a342fff40d00ae6022","category":{"__v":5,"_id":"55094050961f17170070abbd","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["550942e2368a5617004146d8","550a3bca42fff40d00ae600c","550a42a342fff40d00ae6022","550a854f635c660d005280b8","554f0dfacbb3510d00a5738a"],"reference":false,"createdAt":"2015-03-18T09:07:28.587Z","from_sync":false,"order":2,"slug":"player-village","title":"Player Village"},"project":"543b9b0065bf840e00b473d5","user":"543b9aa865bf840e00b473d1","version":{"__v":11,"_id":"543b9b0065bf840e00b473d8","project":"543b9b0065bf840e00b473d5","createdAt":"2014-10-13T09:27:28.467Z","releaseDate":"2014-10-13T09:27:28.467Z","categories":["543b9b0065bf840e00b473d9","543b9ef065bf840e00b473e0","54890012f291f61400c02d36","54890902f291f61400c02d3e","54890c43f291f61400c02d44","54890d71c178b40b00aa3086","5508125c0c4d8c19008a5f83","55094050961f17170070abbd","550945111c38c50d006118ad","550a4c2e42fff40d00ae6049","55221c074801a40d00a77610"],"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2015-03-19T03:29:39.864Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"order":3,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Part 2 of 2 for Adding Buildings\",\n  \"body\": \"Read the Replace Buildings documentation first for how to add your building sprites.\"\n}\n[/block]\nThis XML file contains the settings for every building included in the shop. We've included one example below, the Wizard Academy item. Here's how it looks in the game:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/Cj7OEKl4Rdaw6Qh62qYG\",\n        \"prefills-ui-with-game-data.jpg\",\n        \"720\",\n        \"480\",\n        \"#6bb428\",\n        \"\"\n      ],\n      \"caption\": \"Name, Description, and ResCost variables are used in this image\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Buildings.xml Example\"\n}\n[/block]\nThe following is an excerpt from the building.xml file included in the kit. This excerpt is for the Wizard Academy building. Read the comments next to every item to learn more about the settings.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Building>\\n  \\n  <!-- ##### General Settings ###### -->\\n  \\n  \\t<!-- ID of the building, right now there are 11 examples -->\\n    <ID>1</ID>\\n  \\n  \\t<!-- Building text when selecting the building -->\\n    <Name>Wizard Academy</Name>   \\n    <Description>This is the home of a wizard. A master wizard, not just like the apprentices.\\n    </Description>\\n  \\n  \\n<!-- ##### Special Feature Settings ###### -->\\n  \\n  \\t<!-- Special object classification -->\\n    <Type>Generation</Type>\\n  \\n  \\t<!-- The number of buildings that could be built at the same time-->\\n    <BuilderPop>0</BuilderPop>\\n  \\n  \\t<!-- The number to be added to the max population-->\\n    <PopBonus>10</PopBonus>\\n  \\n  \\t<!-- The amount of the resource generated per second-->\\n    <ProdPerSec>0</ProdPerSec>\\n  \\n  \\t<!-- The total amount of resource storage added by that building-->\\n    <StoreCap>0</StoreCap>\\n  \\n  \\t<!-- Max number of buildings allowed-->\\n    <MaxCap>1</MaxCap>\\n    \\n  \\n<!-- ##### Construction Settings ###### -->\\n  \\n  \\t<!-- The time (in minutes) needed to create the building-->\\n    <Time>15</Time>\\n  \\n  \\t<!-- Experience awarded for the completion of an object-->\\n    <XpAward>650</XpAward>\\n  \\n  \\t<!-- Which resource is needed to complete this kind of building-->\\n    <GoldBased>true</GoldBased>\\n  \\n  \\t<!-- Amount of resource necessary to create the building-->\\n    <ResCost>10000</ResCost>\\n  \\n  \\t<!-- The category where the object is available on the store-->\\n    <StoreCategory>Buildings</StoreCategory>\\n  \\n  \\t<!-- The object that the player has to create before he can create this object-->   \\n    <ObjPrereq>0</ObjPrereq> \\n  \\n  \\t<!-- The XP level needed to create the x building type (x is a number from 1 to 5.)-->\\n    <Cap1Prereq>0</Cap1Prereq>\\n    <Cap2Prereq>0</Cap2Prereq>\\n    <Cap3Prereq>0</Cap3Prereq>\\n    <Cap4Prereq>0</Cap4Prereq>\\n    <Cap5Prereq>0</Cap5Prereq>  \\n  \\n  \\n  \\n<!-- ##### Upgrades ###### -->\\n<!-- ##### Note: We've only setup the building.xml for upgrades ###### -->\\n<!-- ##### And added a building options button in the UI ###### -->\\n<!-- ##### Design your own script if you wish to use this feature in your game ###### -->\\n  \\n  \\t<!-- The level required to upgrade a type of building (x is the level of the building)-->  \\n    <Up2LevelReq>0</Up2LevelReq>\\n  \\n  \\t<!-- The objects required to upgrade a type of building (x is the level of the building)-->    \\n    <Up2ObjReq>5.7</Up2ObjReq>\\n  \\n  \\t<!-- The amount of resources to be spent to upgrade the building-->\\n    <Up2Cost>150000</Up2Cost>\\n  \\n  \\t<!-- The amount of time (in minutes) necessary to upgrade the building--> \\n    <Up2Time>2880</Up2Time>\\n  \\n  \\t<!-- XP awarded for the upgrade of an object-->\\n    <Up2XpAward>1245</Up2XpAward>\\n  \\n  \\t<!-- The store capacity of the upgraded building (its not cumulative with the previous levels)-->\\n    <Lev2StoreCap>0</Lev2StoreCap>\\n  \\n  \\t<!-- The amount of the resource generated per second of the upgraded building (its not cumulative with the previous levels)-->\\n    <Lev2Prod>0</Lev2Prod>\\n  \\n  \\t<!-- The number to be added to the max population granted by the upgraded building (its not cumulative with the previous levels)--> \\n    <Lev2PopBonus>20</Lev2PopBonus>\\n  \\n  \\n  \\n    \\n<!-- ##### An Additional Upgrade Example (see notes above) ###### -->\\n  \\n    <Up3LevReq>0</Up3LevReq>\\n    <Up3ObjReq>5.16</Up3ObjReq>\\n    <Up3Cost>2000000</Up3Cost>\\n    <Up3Time>10080</Up3Time>    \\n    <Up3XpAward>1850</Up3XpAward>\\n    <Lev3StoreCap>0</Lev3StoreCap>\\n    <Lev3Prod>0</Lev3Prod>\\n    <Lev3PopBonus>30</Lev3PopBonus>\\n  \\n  </Building> \",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"All building data is stored in easily-editable xml files.","slug":"buildingxml","type":"basic","title":"Building.xml"}

Building.xml

All building data is stored in easily-editable xml files.

[block:callout] { "type": "success", "title": "Part 2 of 2 for Adding Buildings", "body": "Read the Replace Buildings documentation first for how to add your building sprites." } [/block] This XML file contains the settings for every building included in the shop. We've included one example below, the Wizard Academy item. Here's how it looks in the game: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/Cj7OEKl4Rdaw6Qh62qYG", "prefills-ui-with-game-data.jpg", "720", "480", "#6bb428", "" ], "caption": "Name, Description, and ResCost variables are used in this image" } ] } [/block] [block:api-header] { "type": "basic", "title": "Buildings.xml Example" } [/block] The following is an excerpt from the building.xml file included in the kit. This excerpt is for the Wizard Academy building. Read the comments next to every item to learn more about the settings. [block:code] { "codes": [ { "code": "<Building>\n \n <!-- ##### General Settings ###### -->\n \n \t<!-- ID of the building, right now there are 11 examples -->\n <ID>1</ID>\n \n \t<!-- Building text when selecting the building -->\n <Name>Wizard Academy</Name> \n <Description>This is the home of a wizard. A master wizard, not just like the apprentices.\n </Description>\n \n \n<!-- ##### Special Feature Settings ###### -->\n \n \t<!-- Special object classification -->\n <Type>Generation</Type>\n \n \t<!-- The number of buildings that could be built at the same time-->\n <BuilderPop>0</BuilderPop>\n \n \t<!-- The number to be added to the max population-->\n <PopBonus>10</PopBonus>\n \n \t<!-- The amount of the resource generated per second-->\n <ProdPerSec>0</ProdPerSec>\n \n \t<!-- The total amount of resource storage added by that building-->\n <StoreCap>0</StoreCap>\n \n \t<!-- Max number of buildings allowed-->\n <MaxCap>1</MaxCap>\n \n \n<!-- ##### Construction Settings ###### -->\n \n \t<!-- The time (in minutes) needed to create the building-->\n <Time>15</Time>\n \n \t<!-- Experience awarded for the completion of an object-->\n <XpAward>650</XpAward>\n \n \t<!-- Which resource is needed to complete this kind of building-->\n <GoldBased>true</GoldBased>\n \n \t<!-- Amount of resource necessary to create the building-->\n <ResCost>10000</ResCost>\n \n \t<!-- The category where the object is available on the store-->\n <StoreCategory>Buildings</StoreCategory>\n \n \t<!-- The object that the player has to create before he can create this object--> \n <ObjPrereq>0</ObjPrereq> \n \n \t<!-- The XP level needed to create the x building type (x is a number from 1 to 5.)-->\n <Cap1Prereq>0</Cap1Prereq>\n <Cap2Prereq>0</Cap2Prereq>\n <Cap3Prereq>0</Cap3Prereq>\n <Cap4Prereq>0</Cap4Prereq>\n <Cap5Prereq>0</Cap5Prereq> \n \n \n \n<!-- ##### Upgrades ###### -->\n<!-- ##### Note: We've only setup the building.xml for upgrades ###### -->\n<!-- ##### And added a building options button in the UI ###### -->\n<!-- ##### Design your own script if you wish to use this feature in your game ###### -->\n \n \t<!-- The level required to upgrade a type of building (x is the level of the building)--> \n <Up2LevelReq>0</Up2LevelReq>\n \n \t<!-- The objects required to upgrade a type of building (x is the level of the building)--> \n <Up2ObjReq>5.7</Up2ObjReq>\n \n \t<!-- The amount of resources to be spent to upgrade the building-->\n <Up2Cost>150000</Up2Cost>\n \n \t<!-- The amount of time (in minutes) necessary to upgrade the building--> \n <Up2Time>2880</Up2Time>\n \n \t<!-- XP awarded for the upgrade of an object-->\n <Up2XpAward>1245</Up2XpAward>\n \n \t<!-- The store capacity of the upgraded building (its not cumulative with the previous levels)-->\n <Lev2StoreCap>0</Lev2StoreCap>\n \n \t<!-- The amount of the resource generated per second of the upgraded building (its not cumulative with the previous levels)-->\n <Lev2Prod>0</Lev2Prod>\n \n \t<!-- The number to be added to the max population granted by the upgraded building (its not cumulative with the previous levels)--> \n <Lev2PopBonus>20</Lev2PopBonus>\n \n \n \n \n<!-- ##### An Additional Upgrade Example (see notes above) ###### -->\n \n <Up3LevReq>0</Up3LevReq>\n <Up3ObjReq>5.16</Up3ObjReq>\n <Up3Cost>2000000</Up3Cost>\n <Up3Time>10080</Up3Time> \n <Up3XpAward>1850</Up3XpAward>\n <Lev3StoreCap>0</Lev3StoreCap>\n <Lev3Prod>0</Lev3Prod>\n <Lev3PopBonus>30</Lev3PopBonus>\n \n </Building> ", "language": "xml" } ] } [/block]