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.jsonFetching info... 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 On 06/02/2025 at 6:53 PM, Emacz said: how so? Expand 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" } Expand 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 On 07/02/2025 at 12:32 AM, Emacz said: }, "requirements": { "all"[ "entity": { "class": "Village", "number": 25 }, { "class": "Town", "number": 2 }] }, Expand 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 On 07/02/2025 at 1:15 AM, 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! Expand 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 On 07/02/2025 at 1:15 AM, 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! Expand 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 On 07/02/2025 at 1:15 AM, wowgetoffyourcellphone said: "requirements": { "all": [ "entity": { "class": "Village", "number": 25 }, "entity": { "class": "Town", "number": 2 } ] }, Expand 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 Expand Quote Link to comment Share on other sites More sharing options...
Emacz Posted February 7 Author Report Share Posted February 7 On 07/02/2025 at 2:20 AM, wowgetoffyourcellphone said: I kissed the comma between Entity entries. Make sure to read the error messages. Sometimes they are helpful, specifically this line: Expand 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) On 07/02/2025 at 2:20 AM, wowgetoffyourcellphone said: I kissed the comma between Entity entries. Make sure to read the error messages. Sometimes they are helpful, specifically this line: Expand 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 On 07/02/2025 at 3:23 AM, 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. Expand xml?? its just a txt doc, json i thought? New Text Document.txtFetching info... Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 On 07/02/2025 at 3:50 AM, Emacz said: xml?? its just a txt doc, json i thought? New Text Document.txt 727 B · 0 downloads Expand 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 On 07/02/2025 at 4:02 AM, wowgetoffyourcellphone said: Gimme the entire file. Expand phase_city_spart.jsonFetching info... Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 7 Report Share Posted February 7 On 07/02/2025 at 4:08 AM, Emacz said: phase_city_spart.json 2.28 kB · 0 downloads Expand Ope! Quote Link to comment Share on other sites More sharing options...
hyperion Posted February 7 Report Share Posted February 7 On 07/02/2025 at 2:35 AM, 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. Expand I recommend to use a text editor with syntax highlighting. 2 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 7 Report Share Posted February 7 On 07/02/2025 at 6:38 AM, hyperion said: I recommend to use a text editor with syntax highlighting. Expand @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...
Emacz Posted February 7 Author Report Share Posted February 7 On 07/02/2025 at 6:38 AM, hyperion said: I recommend to use a text editor with syntax highlighting. Expand On 07/02/2025 at 10:25 AM, Atrik said: @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. Expand Ill defintely have to take a look! Otherwise i may go crazy 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.