Add requirements for pioneer?

I would like to add a city size requirement for building pioneers as I am somewhat of a perfectionist and don't create a lot of cities right off the bat. Suffice to say, I typically don't have a lot of territory.

I would like to make a lvl 4 city a requirement for building pioneers. I think this is justified as settlements will work toward their own survival and establish themselves before creating more settlements.

So basically, how can I create a requirement for a unit?

2,139 views 6 replies
Reply #1 Top

You could try the tags for required city lvl for this. Look at the various buildings to find an semi appropriate tag and see if it works with base units. However, I am not sure if this will work as no other unit works like this. You could also tie the pioneer to a building of some kind which requires the city level you want. However, it may not work since a pioneer is a starting unit type for every race.

Now, I will point out that this kind of change may have undesirable effects from AI opponents. The AI who has a desire to expand normally spends its resources on pioneers and expansion bases. Without this, the AI will probably spend all of its resources trying to kill you.



Reply #2 Top

Make a custom building, make it require lvl 4 city to build... basically, a Pioneer Training Center or w/e.

Then edit the Pioneer unit and add:

        <Prereq>
            <Type>BuildingRequirement</Type>
            <Attribute>PioneerTrainingCenter</Attribute>
        </Prereq>

 

Also edit the Pioneer Pack and remove it from the design options.

 

 

Note that the AI will most likely never expand if you do this.

Reply #3 Top

I believe you can directly reference the cityhub internalname in your BuildingRequirement.

Reply #4 Top

I thought about that, but then I'm not sure how multiple BuildingReq would work (as you'll also have to list them for hub 4, 5 for both factions).

Reply #5 Top

Good point. Instead, add a Special Resource Type to the affected cityhub levels. Then reference and demand that resource type in the pioneer unit. See diplomacy units and diplomacy improvements as an example.

Edit: This may not work for accessories, ie it might not work for custom-made pioneers.

 

Reply #6 Top

instead of making the unit have a prereq make the pioneers pack have the prereq found in coreaccessories.xml

that way anything made with that pack has to wait until prereq.

 

i'd be very interested to see what the AI does here