krt0143 Posted September 12, 2023 Report Share Posted September 12, 2023 Where does 0 A.D. define what structures units can build - or not? (for instance the fact champion units don't build anything, others do?) I've looked and looked and didn't find anything, yet it has to be somewhere... I've made a brand new structure (copy of the roman Army Camp), and it works just fine in the game (if I place it in a map using the editor), but my builder units don't know how to build it: It doesn't appear in their list. I guess I have to declare it somewhere as "buildable" first, isn't it. Where? (I've put a "<Civ>brit</Civ>" line inside the structure's "<Identity>" tag, that's all I could think of, but apparently this isn't enough.) Quote Link to comment Share on other sites More sharing options...
s0600204 Posted September 12, 2023 Report Share Posted September 12, 2023 (edited) What you're looking for is the Builder component (<Builder></Builder>). Notably, the following mixin file, which is included into the definition of every unit that can build buildings: https://code.wildfiregames.com/source/0ad/browse/ps/trunk/binaries/data/mods/public/simulation/templates/mixins/builder.xml Note that this does provide civ-specificity: if your new structure template is named, say, brit/camp_example.xml, then adding it to the above file as structures/{civ}/camp_example will cause it to only appear in the build list of Britannic builders (builder units belonging to other civs - e.g. in-game allies - will be able to assist with construction once the foundation has been laid). The absence of, say, a mace/camp_example.xml template is silently ignored. That said, Athenian builders have an additional mixin for Athenian-only buildings: https://code.wildfiregames.com/source/0ad/browse/ps/trunk/binaries/data/mods/public/simulation/templates/mixins/civ/athen.xml You can also add it to specific unit templates, like how the Roman Army Camp is listed at the top of the "Basic"-rank variant of the Roman units that can build it: https://code.wildfiregames.com/source/0ad/browse/ps/trunk/binaries/data/mods/public/simulation/templates/units/rome/infantry_swordsman_b.xml Edited September 12, 2023 by s0600204 Clarify a point. Quote Link to comment Share on other sites More sharing options...
krt0143 Posted September 12, 2023 Author Report Share Posted September 12, 2023 Thank you for the quick reply! 14 minutes ago, s0600204 said: /simulation/templates/mixins/builder.xml !!! How could I have missed it?... 11 minutes ago, s0600204 said: add it to specific unit templates, like how the Roman Army Camp is listed Yes, that sounds better for this specific case. Thanks, I'm back modding... Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted September 12, 2023 Report Share Posted September 12, 2023 22 minutes ago, s0600204 said: only Britannic builders will be able to build it. That means laying the foundation? I occasionally helped my ally building a structure, is that still possible with all buildings? 1 Quote Link to comment Share on other sites More sharing options...
krt0143 Posted September 12, 2023 Author Report Share Posted September 12, 2023 Unrelated but won't spam the forum with new threads: It worked, I got my little palisade fort, and asked it to train a unit. It spawned an error like "WARNING: Trainer without Production Queue found: 13699." but apparently still started training that unit (according to the icon on top right of the screen). There is no queue shown for the building though. This is the relevant tag in the building.xml: <Trainer> <Entities datatype="tokens"> units/{civ}/infantry_spearman_b units/{civ}/infantry_pikeman_b units/{civ}/infantry_maceman_b units/{civ}/infantry_axeman_b units/{civ}/infantry_swordsman_b units/{civ}/infantry_javelineer_b units/{civ}/infantry_slinger_b units/{civ}/infantry_archer_b units/{civ}/cavalry_javelineer_b </Entities> </Trainer> Pretty much vanilla, I don't see why it bugs. Quote Link to comment Share on other sites More sharing options...
s0600204 Posted September 12, 2023 Report Share Posted September 12, 2023 (edited) 27 minutes ago, Gurken Khan said: That means laying the foundation? I occasionally helped my ally building a structure, is that still possible with all buildings? Yes; corrected. @krt0143, add an empty <ProductionQueue/> element to your template. Edited September 12, 2023 by s0600204 Add a response to OP. 1 Quote Link to comment Share on other sites More sharing options...
krt0143 Posted September 12, 2023 Author Report Share Posted September 12, 2023 15 minutes ago, s0600204 said: add an empty <ProductionQueue/> element to your template. Okay thanks, did that! 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.