Trait Creation

Qarthadast

Chieftain
Joined
Aug 2, 2011
Messages
19
Hi,
I'd like to create a new civilization. I'd like to create the following trait:

-- +1 :c5gold: for every sea :c5trade:
-- +1 :c5science: and +1 :c5production: for every coast city

What code have I to insert in the TRAIT - file?
 
I don't think it's possible to create such a trait directly. What you can do however is give the new civ a unique palace, and let that palace give a unique building to each city for free. That building can provide 1 gold on each water plot.

I can't immediately think of a way to provide the second effect. You could create a unique lighthouse which provides this yield.
 
Hi,
I'd like to create a new civilization. I'd like to create the following trait:

-- +1 :c5gold: for every sea :c5trade:
-- +1 :c5science: and +1 :c5production: for every coast city

It depends on what is available for traits. From what I can remember off the top of my head, is that what's there already has been quite specific to the vanilla Civs, rather than a more generalised approach.

So, what often sounds like a straight forward "sea plots = +1 science and +1 production" isn't necessarily doable at all.
 
@Maniac: How can I do this? For the second trait, I'm thinking about a water building which costs 0 :c5gold: (when I'm buying it). This bulding is only buildable at coast cities and provides 1 :c5production: and 1 :c5science: . Is that possible?
 
This is a tricky workaround, but you'd modify the Civilizations XML, have the UB for the new civ replace the old Palace, and that new UB grants a building in every city for free. This new building has the effects of the trait you would like, like +1 gold for every sea tile or what have you. The possibilities are endless, as long as the building supports it.

So, new civ:

UB replaces Palace (remember that this replacement should have the same stats as the palace)
New Palace UB grants a free building in every city
This free building grants the effects of the trait you want.

This is how that would be done.

Yes, you can make buildings only constructable on the coast. Look at the Lighthouse or Harbor for examples. I don't know exactly, but I think it's <Water> tag.
 
This is a tricky workaround, but you'd modify the Civilizations XML, have the UB for the new civ replace the old Palace, and that new UB grants a building in every city for free. This new building has the effects of the trait you would like, like +1 gold for every sea tile or what have you.

No need to go THAT far; there's no need to do anything to the Palace. There are two easy ways to do this:

1> Just take a building that every coastal city would have (say, the Lighthouse) and have THAT building be replaced by a UB. So this civ would, instead of a normal Lighthouse, get a "Super Lighthouse" that adds the gold, food, whatever in addition to the normal Lighthouse effect. No need to add a new building class or screw around with the Palace.
The downside is that you wouldn't get the bonus until after you'd completed a lighthouse in each coastal city, but that's minor. On the plus side, if you conquered an enemy city, their lighthouse (if it survived the capture) would automatically be replaced by your super-lighthouse, and vice versa (if they capture your city they correctly lose that extra bonus).

2> Alternatively, just create your new building class and new building type, and set <FreeStartEra>ERA_ANCIENT</FreeStartEra>. This'll give every city a free copy of this building for any game starting in that era or later... which is every game. (Note that "free copy" just means you get the building with no need to build it. You'd still have to pay any gold maintenance on the building.)
The downside to #2 is that if you capture an enemy city, it won't have this building in it, so you'd have to build it yourself. You'd also need to set <NeverCapture> on it so that someone conquering your city wouldn't get it, but this means that if you recapture the city it'll be gone. So you can't set its cost to a negative value, or else you'd never be able to make a new one.

You can mix the two approaches: make a Super-Lighthouse, and set its FreeStartEra to ERA_ANCIENT. All of your coastal cities would begin the game with one, where you wouldn't even need to wait to research the right tech (which might be a bit unbalanced in the early game), but any city you founded would get it without having to build a lighthouse. (Downside: the gold maintenance on the Lighthouse. And you'd still have to build one in captured cities if there wasn't one already.)
 
If I'd like to create an additional trait for a civ which already exist, would I do so using these methods for creating a trait for a created civ? I'd like to give each civ some minor tech modifiers. Thanks in advance.
 
If I'd like to create an additional trait for a civ which already exist, would I do so using these methods for creating a trait for a created civ? I'd like to give each civ some minor tech modifiers. Thanks in advance.

Explain in more detail, please.
 
Back
Top Bottom