New Building/Unit Prereqs

Jorge2288

Chieftain
Joined
Nov 17, 2011
Messages
10
Hello all,

I am trying to add some new unique unit classes, units and buildings to my new civilization.

I would like a unique palace that unlocks the ability to build a regional capital.

It would be sweet if building this regional capital in your other cities allowed you to build my unique unit classes.

I was hoping this would be a way to restrict my new unit classes only to civilizations capable of building these new buildings.

So I want the capital, my new palace to allow me to build regional capitals that will make my special units buildable.

Can I set a buildingclass_prereq that will require the capital palace to be built once in the capital, and THEN require a regional capital IN THE CITY?

It looks as though I can, but I haven't gotten around to the code yet. Figured I'd check the forums to be sure.

Any other suggestions on how to accomplish the spirit of this little mod would be much appreciated.

Thanks all!
 
Just realized this should have been posted in the main forum.

Sorry Moderators... it's early over here.

Is there a way I can move this thread myself? Otherwise, thanks in advance for moving it.
 
Just realized this should have been posted in the main forum.

Sorry Moderators... it's early over here.

Is there a way I can move this thread myself? Otherwise, thanks in advance for moving it.

Moderator Action: -> thread moved.
In case you have that problem again, don't hesitate to directly tell us about your problem. Just hit the "report post" button (the
report.gif
to the left of each post), and tell us where the problem is. It's definitely faster than asking in the thread and we will not miss it if you do it ;).
 
Thanks for the tips Mr. Moderator, I will report it next time.

Additionally, wanted to know, will setting tech cost to -1 make it unresearchable, and even unselectable as a free tech?

Trying to implement a gifted free technology to my people.
 
Hello all,

I am trying to add some new unique unit classes, units and buildings to my new civilization.

I would like a unique palace that unlocks the ability to build a regional capital.

It would be sweet if building this regional capital in your other cities allowed you to build my unique unit classes.

I was hoping this would be a way to restrict my new unit classes only to civilizations capable of building these new buildings.

So I want the capital, my new palace to allow me to build regional capitals that will make my special units buildable.

Can I set a buildingclass_prereq that will require the capital palace to be built once in the capital, and THEN require a regional capital IN THE CITY?

It looks as though I can, but I haven't gotten around to the code yet. Figured I'd check the forums to be sure.

Any other suggestions on how to accomplish the spirit of this little mod would be much appreciated.

Thanks all!

This is confusing. What I'm gathering from this is:

Unique Palace allows you to build a Regional Capital throughout the empire.

Regional Capital allows you to build units in that city.

My first thought was this is impossible, but then I remembered about national wonders. Check the National Wonders. They should have a prereqbuilding value of -1. Change that to 1 (this will require you to have that capital in order to construct that building). You set that prereqbuilding to your new palace (which you should construct like any other unique asset, it maintains the Class BUILDINGCLASS_PALACE but has a unique Type). Then, you create your units, and then prereqbuilding them to your "regional capital". That will make them available.

I don't understand what this "regional" capital stuff is. You can't move your original capital unless your capital gets destroyed, otherwise you'll mess up the domination victory. No, you can have it as just a regular building that provides Capital bonuses (+3 Production, Food, +1 Culture, etc.)

Either way, set the flavor for the "regional capital" high so the AI prioritizes them because they will need them to be built in order to get access to their special units. You might want to make that building very cheap, at most 75 :c5production: like a Barracks so that it doesn't gimp your civilization to construct them.

Additionally, wanted to know, will setting tech cost to -1 make it unresearchable, and even unselectable as a free tech?

Not going to work; if anything civilizations will start with them if you start a game in a future era, and if you make the tech in a future era, then you start the game in that era no matter what you do.

Besides, what's the point of a free tech for a civ if nobody else can research it?
 
Wow, thanks for the great tips, and the timeliness of your response.

Your name is well known to me, I have read countless numbers of your posts over the years. I respect your work a great deal.
I am aspiring to improve as a modder, and have been at it as an amateur since 2004. Probably been reading civfanatics for close to that long as well. I even spent years without a membership to this lovely site considering all the content that was available without a membership was satiating for quite some time.

Anyhow, I guess I should provide a little background about my mod so far.

I am adding a cyborg civilization, and eventually there will be many cyborg civilizations. Each of which is going to be super powerful relative to regular civs. The idea is to combine civilizations and then alter them to be ultra powerful and unique civilizations led by cyborgs.

I am writing civilopedia entries for the units, history of each civilization, etc. There will be a story, and explanations for all the bonuses I'm throwing in. For instance, my people get combat bonuses within three tiles of forts due to the fact that they are within range of the hive consciousness transmitter (Terran Hive Node) planted in the ground by the fort. Bla bla sci fi bla...

The point of those specific questions was that I want a "regional capital" in each city that allows me to build unitclasses that are supposed to only be available to my cyborg civilizations. This is in order to prevent regular, vanilla civs from acquiring cyborg units.

So, in summary it should work as such:

Game starts, you build the Terran capital city, Metayrgos, and this city starts with the National Capital building, the Terran Hive Center, a unique version of the palace building.

Now that your city and its National Capital have been established the next city built should be able to build a Regional Capital, or Terran Hive Node.

The Terran Hive Nodes will do a number of things, but most importantly they will allow the construction of the cyborg unitclasses.

Thank you so much for your help!

P.S. Would also greatly appreciate any ideas about the concept and suggestions on how to implement these ideas into Civ V. The concept being that of a civilization controlled by a triumvirate of three self-engineered dimension hopping cyborgs. A civilization that functions as a hive consciousness...

Then whatever other splinter cyborg civilizations we can create...

How did they become cyborgs having been born in the late twentieth century?
Where did they originate?
How did they achieve their illuminati-like anonymity throughout the course of history?
The point of departure being the survival and subsequent flourishing of a Carthaginian settler fleet blown off course from the Horn of Africa to the Maya in South America. These Carthaginian philosopher, scientists, engineers, artists and general citizens escape the wrath of the Romans and vow never to emerge from seclusion.

Eventually they discover a math equation (or something better if you can think of it) which when solved by a processor sophisticated enough to run variables through such an equation, opens a "Turing Gate" to 1936 alternate dimension Spain.

From there the Carthaginian (Now "Terran") people, having previously made themselves nanoenhanced auto-circulating cyborgs, find that they can travel through the gate to the same place in time and space again and again, and it is the same no matter the actions they took during their first run in the alternate dimension.

Essentially it is a "groundhog dimension," where the cyborgs travel to 1936 Spain and back to the same spot where they departed from at will.
 
If you want to have specific unit classes that only certain civilizations can build, you can try creating the unit classes and creating the units like normal, but use <Unit_ClassOverrides> (or whatever the table is called) and give each civilization that you don't want to build that unit a NULL replacement.

E.G. Barbarians and CSs have <Building_ClassOverrides> that remove wonders, by essentially replacing the Building_Class with a NULL Building Type.

You should double check this, but I think your code would look something like this.

<Unit_ClassOverrides>
<Row>
<UnitClass_Type>UNIT_CLASS_UNIT_YOU_MADE_UP</UnitClass_Type>
<!--Now you set the unit type to nothing -->
<UnitType></UnitType>
</Row>
</Unit_ClassOverrides>

And then you put that code into the code for every civilization you don't want to build that UnitClass.
 
Completely unnecessary using his method of implementation, as a whole table Unit_BuildingClassRequireds exists for his method. He just sets the palace and the "regional capital" as unique buildings, then the units require the regional capital as the required building class. Problem solved.
 
That is a lot better. But wouldn't that only allow you to build your units in that one specific city? If that's what the modder wants, then that's fine.

Also, if the regional capital is a national wonder, and then the city it was built in gets captured, isn't it the case that the regional capital won't be able to be built again? I thought Firaxis implemented this after the Oxford University exploit.
 
That is a lot better. But wouldn't that only allow you to build your units in that one specific city? If that's what the modder wants, then that's fine.

Also, if the regional capital is a national wonder, and then the city it was built in gets captured, isn't it the case that the regional capital won't be able to be built again? I thought Firaxis implemented this after the Oxford University exploit.

A building is only defined as National Wonder if MaxPlayerInstances is 1.

I'm saying that under Building_PrereqBuildingClasses he could write

Code:
<Row>
			<BuildingType>BUILDING_REGIONAL_CAPITAL</BuildingType
                        <BuildingClassType>BUILDINGCLASS_SPECIAL_PALACE</BuildingClassType>
			<NumBuildingNeeded>1</NumBuildingNeeded>
		</Row>

And that will allow him to build that regional capital in his buildings.
 
Thanks again for the input, folks.

So, Putmalk, doing that will make my buildings and units only available to the civilization I pick, or will all civilizations have these features?
 
Thanks for the tips Mr. Moderator, I will report it next time.

Additionally, wanted to know, will setting tech cost to -1 make it unresearchable, and even unselectable as a free tech?

Trying to implement a gifted free technology to my people.

In case you haven't figured this out yet, here's a way to do it:

1. In the Technologies table, set <Disable> to "true" for the tech
2. In the Civilization_FreeTechs table, grant your civ the free tech as usual

You can test it out by starting a game as your civ - the tech tree should show it as researched. Try starting one as another civ and it should show up, but with the "locked" status.

[EDIT] This can be useful if you want to create entirely new buildings that are unique to your custom civ (i.e., that other civs CANNOT build). There's a table called Building_TechAndPrereqs that adds tech prereqs to buildings (the Buildings table only has room for one tech prereq). Unfortunately, there doesn't seem to be an equivalent for Units.
 
Back
Top Bottom