Philip the Swaggerless Posted March 22, 2022 Report Share Posted March 22, 2022 I assume this is impossible, but I'm checking just in case. Can one make a building that allies can select and research a technology that will apply only to them? And separate allies can also select the same building and research the same or a different technology for themselves? My idea is I want to give the Athenians an academy of philosophy that allows allies to research special technologies. Alternatively, I think I could implement this by having the academy of philosophy give an aura to allies that allows them to build a building or produce a philosopher that can research a technology. (This is possible, right?) If I do this, I worry that I'll have to have extra GUI icons in the panels for building structures or for producing the unit in the building that would produce the unit that would not be applicable must of the time, since they could only be made when there is an Athenian ally. (Is that correct? ) So I think it would be neater if there could be just one building in the Athenian player's territory that allies could research from. Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 22, 2022 Author Report Share Posted March 22, 2022 I am trying to implement my above goal by having the Greek Academy structure produce a global aura that affects an allies' CivCentre, allowing it to produce a philosopher. I am using an aura instead of a technology because as far as I know technologies can only benefit the player themselves. Based on my understanding, Auras can implement the tech modifications, such as this: ProductionQueue/Entities/_string I interpreted this to mean that I could use an aura to give the structure "CivCentre," for all my allies, the ability to produce a philosopher unit. However, after building the structure containing the aura in-game, philosophers still cannot be produced from an ally's civic center. I don't think it is an issue with the philosopher unit itself because if I just put the unit in the "trainer" of the civic center I can see it, produce it, and research it's tech. { "type": "global", "affects": [ "CivCentre" ], "affectedPlayers": ["ExclusiveAlly"], "modifications": [ { "value": "ProductionQueue/Entities/_string", "add": "units/{civ}/support_philosopher_b.xml" } ], "auraDescription" : "Allies can create a Philosopher to research Greek philosophies", "auraName": "Greek Philosophy" } Is this supposed to work? If so what am I doing wrong? I don't get any errors, it just never appears. I have also tried using "replace" instead of "add" above. Below is my code for the unit. < Spoiler <?xml version="1.0" encoding="utf-8"?> <Entity parent="template_unit_support"> <Cost> <BuildTime>15</BuildTime> <Resources> <food>50</food> </Resources> </Cost> <ProductionQueue/> <Researcher> <Technologies datatype="tokens"> philosophy_aristotelianism </Technologies> </Researcher> <Health> <Max>85</Max> </Health> <Identity> <Classes datatype="tokens">Philosopher -ConquestCritical</Classes> <VisibleClasses datatype="tokens">Philosopher</VisibleClasses> <GenericName>Philosopher</GenericName> <SelectionGroupName>template_unit_support_philosopher</SelectionGroupName> <Rank>Basic</Rank> <Tooltip>Allows the research of 1 of 5 technologies. Stand near a Greek Academy for a 20% discount of time and resource cost.</Tooltip> </Identity> <Loot> <xp>8</xp> <food>25</food> </Loot> <Promotion> <RequiredXp>150</RequiredXp> </Promotion> <Selectable> <Overlay> <Texture> <MainTexture>128x128/plus.png</MainTexture> <MainTextureMask>128x128/plus_mask.png</MainTextureMask> </Texture> </Overlay> </Selectable> <Sound> <SoundGroups> <trained>interface/alarm/alarm_create_priest.xml</trained> </SoundGroups> </Sound> <Vision> <Range>30</Range> </Vision> </Entity> Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted March 22, 2022 Report Share Posted March 22, 2022 15 minutes ago, Philip the Swaggerless said: I am using an aura instead of a technology because as far as I know technologies can only benefit the player themselves. I have no idea about the code but maybe adding a team bonus would also be a possibility. Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 22, 2022 Author Report Share Posted March 22, 2022 Just now, Gurken Khan said: I have no idea about the code but maybe adding a team bonus would also be a possibility. Well, if it is a team bonus it is still technically an aura, so I don't think that would change things. However, I want it to be contingent upon the Athenian player making an academy so I that is why I have it as a structure instead of a team bonus. Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 22, 2022 Report Share Posted March 22, 2022 Just some random guesses: * add doesn't sound right for _string, maybe append or replace * {civ} might be problematic * ProductionQueue/Entities/_string was refactored out over the years 1 Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 22, 2022 Author Report Share Posted March 22, 2022 23 minutes ago, hyperion said: Just some random guesses: * add doesn't sound right for _string, maybe append or replace * {civ} might be problematic * ProductionQueue/Entities/_string was refactored out over the years Thanks. I tried "append" and "replace," but those didn't work either. I also tried changing the production queue line to the way it appears in the xml files., "ProductionQueue/Trainer/Entities", with append, replace, add, but nothing works. I'm not experienced at this so after the first one didn't work I just tried many things. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 23, 2022 Report Share Posted March 23, 2022 Its just trainer and researcher now. Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 23, 2022 Author Report Share Posted March 23, 2022 (edited) 2 hours ago, wowgetoffyourcellphone said: Its just trainer and researcher now. Okay, I kind of figured it out... if my modification line says... "value": "Trainer/Entities/_string", "replace": "units/{civ}/support_philosopher_b", ...it works, but "replace" literally replaces all units in the civic center with the one new unit.. "add" and "append" do not work and give errors. If I replace multiple units ( "units/{civ}/support_philosopher_b units/{civ}/support_female_citizen etc..." ) that's no good because not all civic centers use the same units, and some even have heroes. If someone else knows another word that will simply add my unit without replacing existing ones let me know. Otherwise I can have it be produced from some random building that doesn't produce units...like a field... Edited March 23, 2022 by Philip the Swaggerless Update Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 23, 2022 Report Share Posted March 23, 2022 Use "tokens" instead of "replace." 1 Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 23, 2022 Author Report Share Posted March 23, 2022 11 hours ago, wowgetoffyourcellphone said: Use "tokens" instead of "replace." Oh wonderful! I am excited to get home and update it. Thank you 1 Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 24, 2022 Author Report Share Posted March 24, 2022 Tokens worked. Excellent! Now I am trying to make it so that the Philosopher can only research 1 of 5 available technologies. Do you know if there is a good way to do it? I believe it is possible with nested tech pairs, but it would be annoying for the player to have to sort through 5 different techs. My other idea was to include a modification line in the tech to make it so that once one tech was researched the others would disappear. I tried this: "value": "Researcher/Entities/_string", "replace": " ", This didn't work, and is undesirable anyways because it has to apply to all the units that the original technology "affects." The other possibility I thought of was to have negative tech requirements, but I don't know if that is even a thing. What I mean is that the tech cannot be researched of the listed techs are researched. What I tried below didn't work: "requirements": { "all": [ { "tech": " !philosophy_aristotelianism, !philosophy_platonism, !philosophy_stoicism, !philosophy_skepticism" } ] (From looking around it seems like "!" negates what comes after it? Did I mention I am nub?) If you have any good ideas I'd appreciate it again. Thanks. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 24, 2022 Report Share Posted March 24, 2022 1 hour ago, Philip the Swaggerless said: "value": "Researcher/Entities/_string", "replace": " ", This may work by listing the other techs and using a minus sign before them. See (of course) Delenda Est on how to do a lot of this. Quote Link to comment Share on other sites More sharing options...
Philip the Swaggerless Posted March 24, 2022 Author Report Share Posted March 24, 2022 (edited) Since the "affects" line of the Philosopher technologies is sometimes "structure," it won't work to include the replace feature in the actual technologies. I've decided to give the Philosopher "Shell" technologies, where after you click it it replaces all technologies with the one you clicked on. And then you just click on the icon again and researches the actual technology. "modifications": [ { "value": "Researcher/Technologies/_string", "replace": "philosophy_skepticism" } ], Edit: Better yet, I can make the real technology have "autoResearch": true, and then once the user clicks the shell tech the real tech automatically researches. Edited March 24, 2022 by Philip the Swaggerless Quote Link to comment Share on other sites More sharing options...
Freagarach Posted March 25, 2022 Report Share Posted March 25, 2022 On 24/03/2022 at 4:33 AM, Philip the Swaggerless said: The other possibility I thought of was to have negative tech requirements, but I don't know if that is even a thing. In A27: https://code.wildfiregames.com/D4514. 1 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.