{"__v":3,"_id":"550ce9026c0b4c0d00fd42fd","category":{"__v":14,"_id":"54890d71c178b40b00aa3086","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["548a63d41bd6c40b00f77728","548a6fbab77bb70b00ac8bf2","548adcb7b77bb70b00ac8c9d","548add501bd6c40b00f777d2","548ae445b77bb70b00ac8cad","548aef1bb77bb70b00ac8ccb","548af4b41bd6c40b00f777fc","548eb9d5e52d2b0b001b9a28","5508449ba42e812500b711f3","550a8eed42fff40d00ae60e3","550ce8fd6c0b4c0d00fd42fb","550ce9026c0b4c0d00fd42fd","550d840f11e8d00d00b80383","550e7e7f8387ac0d00ed9e1a"],"reference":false,"createdAt":"2014-12-11T03:20:17.529Z","from_sync":false,"order":5,"slug":"game-settings","title":"Game Settings"},"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-21T03:44:02.937Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"order":6,"body":"XP levels are increased when various buildings are constructed on the map. Training units also increases the XP level (they are read from Buildings/Units XML)\n\nThe info available in XML is partially integrated in our game - there are more then enough examples to do anything. The basic principle and building wiring is already there - you can use this to manage XP in your game. \n\nThe progress bar and numbers are already there and working - you don't need to add anything to the UI. Just play the game, build things and keep an eye on the XP progress bar.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/2eN1LJ3TxSJZsPXAbnhQ\",\n        \"experience.jpg\",\n        \"800\",\n        \"600\",\n        \"#7dae15\",\n        \"\"\n      ],\n      \"caption\": \"Player XP total\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/zoNdbHVqTWOj0Q6vhsj7\",\n        \"building-finished.jpg\",\n        \"800\",\n        \"600\",\n        \"#7dae16\",\n        \"\"\n      ],\n      \"caption\": \"A new building adds to the player's XP\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"XP Capping\"\n}\n[/block]\nThere is a maximum experience level possible, used to size the progress bar. The cap is the maximum amount. The details are processed in the Stats.cs script. Each building or unit adds to the progress bar, up to a point. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n// For units:\\n// Add the XP award from training a unit to the player XP stats\\n((Stats)stats).experience += int.Parse (units [currentSelection] [\\\"XpAward\\\"]);\\n\\n// Checks if the amount is greater than the total XP possible. \\n// If it is, reset to the total XP possible.\\nif(((Stats)stats).experience>((Stats)stats).maxExperience)\\n((Stats)stats).experience=((Stats)stats).maxExperience;\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]","excerpt":"A short reference guide to XP earned in the game","slug":"xp","type":"basic","title":"XP"}

XP

A short reference guide to XP earned in the game

XP levels are increased when various buildings are constructed on the map. Training units also increases the XP level (they are read from Buildings/Units XML) The info available in XML is partially integrated in our game - there are more then enough examples to do anything. The basic principle and building wiring is already there - you can use this to manage XP in your game. The progress bar and numbers are already there and working - you don't need to add anything to the UI. Just play the game, build things and keep an eye on the XP progress bar. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/2eN1LJ3TxSJZsPXAbnhQ", "experience.jpg", "800", "600", "#7dae15", "" ], "caption": "Player XP total" } ] } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/zoNdbHVqTWOj0Q6vhsj7", "building-finished.jpg", "800", "600", "#7dae16", "" ], "caption": "A new building adds to the player's XP" } ] } [/block] [block:api-header] { "type": "basic", "title": "XP Capping" } [/block] There is a maximum experience level possible, used to size the progress bar. The cap is the maximum amount. The details are processed in the Stats.cs script. Each building or unit adds to the progress bar, up to a point. [block:code] { "codes": [ { "code": "\n// For units:\n// Add the XP award from training a unit to the player XP stats\n((Stats)stats).experience += int.Parse (units [currentSelection] [\"XpAward\"]);\n\n// Checks if the amount is greater than the total XP possible. \n// If it is, reset to the total XP possible.\nif(((Stats)stats).experience>((Stats)stats).maxExperience)\n((Stats)stats).experience=((Stats)stats).maxExperience;", "language": "cplusplus" } ] } [/block]