Can a civic allow certain units/buildings?

Peuri

Game
Joined
Feb 11, 2005
Messages
673
Location
Not here
At the moment I am doing a bit of XML modding to enhance my personal gaming experience mostly by combining some of the awsome units and mod components that this community gives, which totally über. But today I came up with a problem. I want to add a clone unit that can only be build if the civilization has cloning vats and a certain civic that allows you to build them (because cloning is concidered immoral for some reason.) So I know how to do the cloning vats part, but I am not sure how to do the civic part.

So I'm asking that is there a way to make certain buildings or units buildable by a certain civic. And if it is, how?
Or that a certain civic is only available after building a certain wonder?
Thank you.
 
No, there isn't a tag in vanilla civ4 or warlords that allows a civic to be a prereq for a building or unit... is that what you are asking for? If it is let me know and I'll see what I can do about whipping something up for you.
 
Hold on, is that true? What about organized religion? That ought to allow units at least.
 
Well, Organized Religion just has a <SpecialBuildingsNotRequired> tag. Wheras I think the OP wants a tag like <CanBuild> and <CanTrain>. It should be fairly easy-in theory-to borrow the tags from the techinfos section of the SDK.

Aussie_Lurker.
 
Actually AL, I was thinking of adding something more like the <PrereqTech>, <PrereqBuilding>, <PrereqReligion>, etc. tags found in the CIV4UnitInfos.xml file...
 
Of course, if you wanted to be 'lazy', then it would probably be simpler just to modify the Can/CannotBuild and Can/CannotTrain sections of the relevent Python file ;). However, it wouldn't show up on the civics screen unless you also modify the various GameText XML files associated with civics!

Aussie_Lurker.
 
Aussie_Lurker said:
Of course, if you wanted to be 'lazy', then it would probably be simpler just to modify the Can/CannotBuild and Can/CannotTrain sections of the relevent Python file ;).

Well, the civics screen could be taken care of, even if you have to loop through all the unit types and check out if the new tags are used with them. I think your hand is kind of forced here anyway, since the Civ4UnitInfos.xml file is loaded after the Civ4CivicInfos.xml file. Thus, the Civ4CivicInfos.xml files can't show specifically units (of course, this isn't really a problem, since you're probably dealing with unit classes anyway, which would be fine since Civ4UnitClassInfos.xml is loaded before Civ4CivicInfos.xml).
 
Aussie_Lurker said:
Of course, if you wanted to be 'lazy', then it would probably be simpler just to modify the Can/CannotBuild and Can/CannotTrain sections of the relevent Python file ;). However, it wouldn't show up on the civics screen unless you also modify the various GameText XML files associated with civics!

Aussie_Lurker.

I used the lazy way to block buildings, techs and units I dont want. But I also added a new text field to units and techs called "Requires". Its only purpose is to display special requirements in the gametext. So anything I put in that string is displayed in game.

I love python blocking because it is so flexible, but it can be confusing for players that don't know why they cant build something. The Requires attribute fixed that for me.

You can see screenshots of the Requires string in action in the 2nd and 3rd screenshot on this post: http://forums.civfanatics.com/showpost.php?p=4542602&postcount=2
 
Actually, Kael, you might notice I put lazy in inverted commas. This was deliberate, as my own python experience has led me to believe that it is actually the more difficult of the two modding methods (between python and C++, that is). Personally, I would rather do C++ any day of the week, and feel that anyone who takes the Python route is both incredibly clever and incredibly brave ;).

Aussie_Lurker.
 
Well, I have the first part done... and it is really simple, basically you need to add the new <PrereqCivic> tag after the <PrereqReligion> tags for units. I'll do something similar for buildings.

I'll upload some screenshots later for you to see...
 
Same here... oh well
 
I'm shocked about a LOT of tags which I feel should have been in from the start. Like some of the ones I am working on (Civic effects which work like the TofA or GL, or ones which impact on Trade Route Commerce or Civic Effects which impact on the Commerces and Yields of State Religion/Non-State Religion cities) just seem like common sense to me, as would have been a Happiness bonus in ALL cities (not just the largest).

And, once again TheLopez, you manage to make me feel totally inadequate :p with the prolific nature of your modding efforts. You achieve more in a day than I can get done in a Month!!! :mischief:
Dammit man, get some sleep already! ;)
Oh and, btw, your way definitely makes a LOT more sense than mine. I guess I just have 'tunnel-vision' when it comes to CivicInfos ;).

Aussie_Lurker.
 
Aussie_Lurker said:
Well, Organized Religion just has a <SpecialBuildingsNotRequired> tag. Wheras I think the OP wants a tag like <CanBuild> and <CanTrain>. It should be fairly easy-in theory-to borrow the tags from the techinfos section of the SDK.

Aussie_Lurker.
Is it my simple programmers mind or?

This is the solution is it not?? Simply make the clone dependant on a special building that is Impossible to build? You dont need it if you are in that civic... Thus you can build clones?

Or is that just to easy?
 
namliaM said:
Is it my simple programmers mind or?

This is the solution is it not?? Simply make the clone dependant on a special building that is Impossible to build? You dont need it if you are in that civic... Thus you can build clones?

Or is that just to easy?
Nope, its not that easy... the way I solved it was to define a new tag for units <PrereqCivic>. Beyond that you need to make sure it is all seamlessly integrated into the game...

Here are the screenshots I promised for the unit civic prereqs:
Spoiler :

Unit_Civic_Prereqs_-_Jewish_Missionary.jpg


Unit_Civic_Prereqs_-_Organized_Religion.jpg


Unit_Civic_Prereqs_-_Civics.jpg



I'm going to bed now, as Aussie_Lurker suggested...

Tomorrow I'll post in the file database both a vanilla civ4 and warlords version of this mod. Then I'll work on the building civic prereqs and post both versions in the file database as well.


EDIT: I might tweak the civics screen so the text doesn't spill out the bottom of the blue round panes.
 
Actually, with a slight tweak, I could use this mod to restrict insular religions from building missionaries. Hmmmm!

Aussie_Lurker.
 
To be honest, I'd never looked closely enough at the XML to realize that this was not included, but since Civ3 had allowed government-specific buildings, I'd assumed that Civ4 allowed for civic-specific buildings too.

EDIT:

Right off the bat, I can think of two very useful buildings/units that can be created with these tags:

Secret Police HQ/Secret Police unit - could be used to root out dissent and would only be available with Police State

Inquisition HQ(?)/Inquisitor - mods for this already exist, but we could limit their appearance to Theocracy without having to use python coding.

The nice thing is that with these two bonuses, it would also be possible then to add in the obvious negatives of these two civics without rendering them unworthy of use by the player. It would simply make their purpose much more specific.



I also want to combine this with TheLopez's excellent Upgradeable Buildings modcomp so that I can have a Capitol/Senate building replace the Palace as the center of government when under Representation.


Also... I feel like I have to be a pain in the butt :p Would it be possible to have an "and" as well as "either/or" option for the civics?

For example, it would be great if we could have buildings that require two separate civics to be in place to be built, but it would also be cool if it were possible to make a building that could be built with either one civic or another...
 
Dom Pedro II said:
To be honest, I'd never looked closely enough at the XML to realize that this was not included, but since Civ3 had allowed government-specific buildings, I'd assumed that Civ4 allowed for civic-specific buildings too.
I thought so too but it doesn't...

Dom Pedro II said:
Inquisition HQ(?)/Inquisitor - mods for this already exist, but we could limit their appearance to Theocracy without having to use python coding.
Well most if not all of the code for these mods is coming from the Inquisition mod that I am working on. It was the request by Perui that spurred me to release it as a stand alone mod component.

Dom Pedro II said:
Also... I feel like I have to be a pain in the butt :p Would it be possible to have an "and" as well as "either/or" option for the civics?

For example, it would be great if we could have buildings that require two separate civics to be in place to be built, but it would also be cool if it were possible to make a building that could be built with either one civic or another...
I agree, but let me release the first version of these mods and then after I finish up the inquisition mod I'll update them so you can require multiple civics to build a building or unit.
 
Back
Top Bottom