Jump to content

Questions about technologies and the buildings that allow them.


Recommended Posts

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. 

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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 by Philip the Swaggerless
Update
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 by Philip the Swaggerless
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...