Need help making a new trait

LutariFan

Chieftain
Joined
Jul 31, 2012
Messages
2
Goo day.

As the title states, I need some help. I'm not that good at Lua and SQL, but I'm a fast learner, and I'm willing to learn whatever's needed. I'm currently trying to create an Atlantis Civ, and I want the Trait to be like this:

Aquatic Legacy: Triples Yields from water tiles.

However, I'm not the best at modding... :sad:

So yea. I could use a bit of help. I'm using Kael's modding guide, but I can't find the answer there...
 
I don't know if there is a way through traits only (I never looked at that table) but you could create an invisible technology or building (I don't remember which one is needed to modify terrains yields) and add it/built it through LUA for the player with that trait.
 
I don't know if there is a way through traits only (I never looked at that table) but you could create an invisible technology or building (I don't remember which one is needed to modify terrains yields) and add it/built it through LUA for the player with that trait.

Well, there is the YieldChanges type in the Traits Table, and I can believe I can make the trait triple yields, but I need it to do so exclusively on water tiles.
 
You'll probably want to use the FreeBuilding trait to give the player a nukeImmune, NeverCapture building that can only be acquired through the trait. And then have this building use Building_SeaPlotYieldChanges, Building_LakePlotYieldChanges and Building_SeaResourceYieldChanges to add yield to whatever water tiles you want. It will be a bit trickier to exactly triple a yield though.
 
Machiavelli's method should work (it won't triple it, but you can triple the base stuff if you wanted).

I'm warning you right now: Triple yield for ocean tiles will be sorely unbalanced (thought Fish was the best resource in the game now, just wait till you "triple" it!)
 
I agree with Putmalk and Machiavelli. You're probably going to have to use "Building_SeaPlotYieldChanges, Building_LakePlotYieldChanges and Building_SeaResourceYieldChanges"

Whenever you see "Changes" like above, it's talking about a flat increase, such as +1 Gold, +1 Food, etc. To make a percentage change you're going to want something that ends with "Modifier" so you could enter 200, which means 200% change, which would be tripling it.

The thing is, there is no Building_SeaPlotYieldModifier that will allow you to triple those tiles. It doesn't exist, so you'll have to figure out some other way to get what you want, or close to it. So your best bet is what Machiavelli said, with the free building that makes changes in water tiles.

My related question would be, how would you go about making the building that makes the changes? If a building has no tech tied to it, it can be built from the start like a monument, right? So you'd have to make it have a prereq tech that only the civ in question has access to, wouldn't you? Or is there a way to make a building "unbuildable" that would simplify this?
 
Set the building's cost to -1.

Actually, I've found this doesn't always work (sometimes it just defaults to a 1 cost building).

There is a Building_LockedBuildingClasses XML tag, I'm not 100% sure if this disables buildings, though. You can use Civilization_BuildingClassOverrides to manually disable the new building class for every civ. Otherwise make a disabled dummy tech and place it as the pre-req for the new building.
 
Actually, I've found this doesn't always work (sometimes it just defaults to a 1 cost building).

No, I've done this for maybe 50 buildings and it always works. I have had buildings show up with 1 turn build time, but it was always due to some other mistake (wish I could remember what that was now).
 
Actually, I've found this doesn't always work (sometimes it just defaults to a 1 cost building).

The beauty of computers is that if you do the same thing over and over and over again, the same result will happen. What happened here is most likely you putting 1 instead of -1.
 
Back
Top Bottom