{"__v":8,"_id":"550a854f635c660d005280b8","category":{"__v":7,"_id":"550a4c2e42fff40d00ae6049","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["550a4d06492cbf0d00bbff79","550a870cb6fd572500a57a42","550d801711e8d00d00b80380","551e00f5a7e98017009e3ee4","551edb36c2d1ec1700b4261c","554f09c6a8c1ae0d00c5bb93","55b63d63f8105a2f00c34e33"],"reference":false,"createdAt":"2015-03-19T04:10:22.740Z","from_sync":false,"order":3,"slug":"units","title":"Units"},"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-19T08:14:07.848Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"order":2,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Part 2 of 3 for Adding Units\",\n  \"body\": \"Read the Units Menu documentation first for how to add your unit sprites to the menu. Then afterwards, read the documentation for Adding New Characters.\\n\\nStarter Kit: This file is called Creatures.xml in the Starter Kit. Pro and Complete Kits come with both Creatures.xml and Units.xml, but you only want to edit Units.xml\"\n}\n[/block]\nEvery unit in your game is managed in the fully-editable unit production menu. The Units Menu page talks about how to add new creatures this menu, and this page will introduce you to setting the cost, training time, and settings for each character.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/uB0CSDwyQGilnncMrmAk\",\n        \"constructing-units.jpg\",\n        \"800\",\n        \"399\",\n        \"#77a02d\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Units.xml Example\"\n}\n[/block]\nThe following is an excerpt from the Units.xml file included in the kit. This excerpt is for the Wizard character. Read the comments next to each item to learn more about the setting.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Unit>  \\n  \\t<!-- The ID number of the unit, used throughout the source code for identifying the quanlity of this unit you have -->\\n    <ID>1.1</ID>\\n  \\n  \\t<!-- The name of this unit -->\\n    <Name>Wizard</Name>  \\n  \\n  \\t<!-- Description shown in the store -->\\n    <Description>A lazy wizard is better than nothing.</Description>\\n  \\n  \\t<!-- General category for your troop -->\\n    <Type>Generated Creature</Type> \\n  \\n  \\t<!-- How much of the available population slots the unit occupies -->\\n    <PopUnitWeight>1</PopUnitWeight> \\n  \\n  \\t<!-- The time (in minutes) needed to create each unit -->\\n    <Time>60</Time>\\n  \\n  \\t<!-- Experience awarded for the completion of the unit -->\\n    <XpAward>300</XpAward>\\n  \\n  \\t<!-- Which resource is needed to complete this kind of unit. True for gold (or the name of your first currency, and false for the second currency which in the demo is called mana) -->\\n    <GoldBased>false</GoldBased>\\n  \\n  \\t<!-- Amount of resource necessary to create the unit -->\\n    <ResCost>5000</ResCost>\\n  \\n  \\t<!-- The category where the unit is available on the store -->\\n    <StoreCategory>Creatures</StoreCategory>\\n  \\n  \\t<!-- The building, unit, or object that the player has to create before he can create this unit -->\\n    <ObjPrereq>0</ObjPrereq>\\n  \\n</Unit>\\n              \",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"All information for your units is stored as easily-editable xml data","slug":"creaturesxml","type":"basic","title":"Units.xml"}

Units.xml

All information for your units is stored as easily-editable xml data

[block:callout] { "type": "success", "title": "Part 2 of 3 for Adding Units", "body": "Read the Units Menu documentation first for how to add your unit sprites to the menu. Then afterwards, read the documentation for Adding New Characters.\n\nStarter Kit: This file is called Creatures.xml in the Starter Kit. Pro and Complete Kits come with both Creatures.xml and Units.xml, but you only want to edit Units.xml" } [/block] Every unit in your game is managed in the fully-editable unit production menu. The Units Menu page talks about how to add new creatures this menu, and this page will introduce you to setting the cost, training time, and settings for each character. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/uB0CSDwyQGilnncMrmAk", "constructing-units.jpg", "800", "399", "#77a02d", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Units.xml Example" } [/block] The following is an excerpt from the Units.xml file included in the kit. This excerpt is for the Wizard character. Read the comments next to each item to learn more about the setting. [block:code] { "codes": [ { "code": "<Unit> \n \t<!-- The ID number of the unit, used throughout the source code for identifying the quanlity of this unit you have -->\n <ID>1.1</ID>\n \n \t<!-- The name of this unit -->\n <Name>Wizard</Name> \n \n \t<!-- Description shown in the store -->\n <Description>A lazy wizard is better than nothing.</Description>\n \n \t<!-- General category for your troop -->\n <Type>Generated Creature</Type> \n \n \t<!-- How much of the available population slots the unit occupies -->\n <PopUnitWeight>1</PopUnitWeight> \n \n \t<!-- The time (in minutes) needed to create each unit -->\n <Time>60</Time>\n \n \t<!-- Experience awarded for the completion of the unit -->\n <XpAward>300</XpAward>\n \n \t<!-- Which resource is needed to complete this kind of unit. True for gold (or the name of your first currency, and false for the second currency which in the demo is called mana) -->\n <GoldBased>false</GoldBased>\n \n \t<!-- Amount of resource necessary to create the unit -->\n <ResCost>5000</ResCost>\n \n \t<!-- The category where the unit is available on the store -->\n <StoreCategory>Creatures</StoreCategory>\n \n \t<!-- The building, unit, or object that the player has to create before he can create this unit -->\n <ObjPrereq>0</ObjPrereq>\n \n</Unit>\n ", "language": "xml" } ] } [/block]