Emacz Posted February 6 Report Share Posted February 6 Does anyone know if its possible to have p3 cost X village buildings + y town buildings? Below failed }, "requirements": { "entity": { "class": "Village", "number": 25, "class": "Town", "number": 2 } }, "require Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 6 Report Share Posted February 6 "requirements": { "entity": [{ "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] } More likely to work like this but untested. Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 6 Author Report Share Posted February 6 wouldn't u need another comma after the last } before "requirementsTooltip": ? Ill tyr both! thanks Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 6 Author Report Share Posted February 6 }, "requirements": { "entity": [{ "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] }, i did this with no errors, but it went right to p3 after p2 Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 6 Author Report Share Posted February 6 so this didnt create any erros, but as soon as i was p2, p3 was elligible.... phase_city_spart.json Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted February 6 Report Share Posted February 6 Other techs make use of "any" and "all" to specify compound requirements. I think using "all" might work here. 1 Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 6 Author Report Share Posted February 6 how so? Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 5 hours ago, Emacz said: how so? An example from DE: Quote { "supersedes": "shipyard/training_naval_shipwrights", "genericName": "Arsenal of Philon", "description": "Unlock health regeneration for your Warships.", "cost": { "stone": 500, "glory": 500 }, "requirements": { "all": [ { "tech": "phase_empire" }, { "civ": "athen" } ] }, "requirementsTooltip": "Unlocked in Empire Phase. Requires “Shipwrights.”", "icon": "arsenal_of_philon.png", "researchTime": 50, "tooltip": "Warships +1 health/second self-repair rate.", "modifications": [ { "value": "Health/RegenRate", "add": 1 } ], "affects": ["Warship"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" } Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 }, "requirements": { "entity": [{ "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] }, does the "all" replace entity? im still pretty nub at this, so i would almost need to see an exact replica and copy paste. Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 }, "requirements": { "all"[ "entity": { "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] }, Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 38 minutes ago, Emacz said: }, "requirements": { "all"[ "entity": { "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] }, You need two "entity" entries. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 "requirements": { "all": [ "entity": { "class": "Village", "number": 25 } "entity": { "class": "Town", "number": 2 } ] }, Something like this. Also, in json files, we use tabs instead of spaces. In XML files, such as actors or templates, we use two spaces in lieu of tabs. Also, "any" instead of "all" in a situation like this gives the player to either build 25 village phase structures or 2 town phase strictures, which could be interesting depending on what you're going for. Make sure to be very explicit about the requirements in your "tooltip:" section. I hope this helps! 1 Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 32 minutes ago, wowgetoffyourcellphone said: "requirements": { "all": [ "entity": { "class": "Village", "number": 25 } "entity": { "class": "Town", "number": 2 } ] }, Something like this. Also, in json files, we use tabs instead of spaces. In XML files, such as actors or templates, we use two spaces in lieu of tabs. Also, "any" instead of "all" in a situation like this gives the player to either build 25 village phase structures or 2 town phase strictures, which could be interesting depending on what you're going for. Make sure to be very explicit about the requirements in your "tooltip:" section. I hope this helps! Thanks!! One day i will understand all of this. I hope Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 40 minutes ago, wowgetoffyourcellphone said: "requirements": { "all": [ "entity": { "class": "Village", "number": 25 } "entity": { "class": "Town", "number": 2 } ] }, Something like this. Also, in json files, we use tabs instead of spaces. In XML files, such as actors or templates, we use two spaces in lieu of tabs. Also, "any" instead of "all" in a situation like this gives the player to either build 25 village phase structures or 2 town phase strictures, which could be interesting depending on what you're going for. Make sure to be very explicit about the requirements in your "tooltip:" section. I hope this helps! looks like i still mananged to mess it up <p class="error">ERROR: JavaScript error: globalscripts/ModificationTemplates.js line 15 JSON.parse: expected ',' or ']' after array element at line 16 column 12 of the JSON data ModificationTemplates@globalscripts/ModificationTemplates.js:15:33 LoadModificationTemplates@globalscripts/ModificationTemplates.js:44:31 @simulation/helpers/ModificationTemplates.js:2:1 launchGame@gamesettings/GameSettings.js:160:11 launchGame@gui/gamesetup/Controllers/GameSettingsController.js:288:18 onPress@gui/gamesetup/Pages/GameSetupPage/Panels/Buttons/StartGameButton.js:51:52</p> <p class="error">ERROR: Failed to parse 'simulation/data/technologies/phase_city_spart.json'</p> <p class="error">ERROR: JavaScript error: simulation/components/TechnologyManager.js line 215 allTechs[key] is undefined TechnologyManager.prototype.Init@simulation/components/TechnologyManager.js:215:7 PlayerManager.prototype.AddPlayer@simulation/components/PlayerManager.js:18:21 LoadPlayerSettings@simulation/helpers/Player.js:44:21</p> <p class="error">ERROR: JavaScript error: globalscripts/ModificationTemplates.js line 15 JSON.parse: expected ',' or ']' after array element at line 16 column 12 of the JSON data Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 1 hour ago, wowgetoffyourcellphone said: "requirements": { "all": [ "entity": { "class": "Village", "number": 25 }, "entity": { "class": "Town", "number": 2 } ] }, I kissed the comma between Entity entries. Make sure to read the error messages. Sometimes they are helpful, specifically this line: Quote JSON.parse: expected ',' or ']' after array element at line 16 column 12 of the JSON data Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 9 minutes ago, wowgetoffyourcellphone said: I kissed the comma between Entity entries. Make sure to read the error messages. Sometimes they are helpful, specifically this line: I ready it, but again it still so new to me. I took a look and wasnt sure. I spent like 6 hours working on 2-3 templates doing them over and over trying to figure out what was wrong. Im so inefficient at this. 1 Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 (edited) 31 minutes ago, wowgetoffyourcellphone said: I kissed the comma between Entity entries. Make sure to read the error messages. Sometimes they are helpful, specifically this line: cause now it is saying: expected ',' or ']' after array element at line 17 column 12 which would be "entity": { between the " and : and adding a space there doesnt work. JSON.parse: unexpected character at line 17 column 13 of the JSON data when i try this: requirements": { "all": [ "entity",: { "class": "Village", "number": 25 }, "entity",: { "class": "Town", "number": 2 } ] }, <p class="warning">WARNING: Unknown requirement operator: 0</p> when i try this: "requirements": { "all": [ "entity", { "class": "Village", "number": 25 }, "entity", { "class": "Town", "number": 2 } ] }, Edited February 7 by Emacz Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 You got some kind of character or space or something probably. Zip up the xml and post it and I can look at it. Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 26 minutes ago, wowgetoffyourcellphone said: You got some kind of character or space or something probably. Zip up the xml and post it and I can look at it. xml?? its just a txt doc, json i thought? New Text Document.txt Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 11 minutes ago, Emacz said: xml?? its just a txt doc, json i thought? New Text Document.txt 727 B · 0 downloads Gimme the entire file. Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 5 minutes ago, wowgetoffyourcellphone said: Gimme the entire file. phase_city_spart.json Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 31 minutes ago, Emacz said: phase_city_spart.json 2.28 kB · 0 downloads Ope! Quote Link to comment Share on other sites More sharing options...
hyperion Posted February 7 Report Share Posted February 7 3 hours ago, Emacz said: I spent like 6 hours working on 2-3 templates doing them over and over trying to figure out what was wrong. Im so inefficient at this. I recommend to use a text editor with syntax highlighting. 2 Quote Link to comment Share on other sites More sharing options...
seeh Posted February 7 Report Share Posted February 7 (edited) do have solution already? i have asked geminie: { // ... other tech properties (name, description, etc.) ... "requirements": { "all": [ { "entity": { "class": "Village", "number": 25 } }, { "entity": { "class": "Town", "number": 2 } } ] } // ... other tech properties ... } Edited February 7 by seeh 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 7 Report Share Posted February 7 3 hours ago, hyperion said: I recommend to use a text editor with syntax highlighting. @Emacz, you should do this, it will help you NOT wast time on very lame syntax mistakes. As well, modifying the templates, you will always work with objects and arrays. So it would be useful for you to memorize their structure. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.