Creating Traits? Negative Traits?

TheManFromMars

Warlord
Joined
Oct 25, 2010
Messages
102
Hi

I am trying to create a new trait, 'Afraid of the Dark'.
This trait would reduce enemy unit movement and sight to 1 when in the boundaries of the civ with the trait. The trait would also add +25 unhappiness from war for a civ at war with the civ with the trait. Overpowered? Probably, but I haven't finalized it yet, but I need at least one of those two things to happen.

I'm aware of how to 'build' a trait using various attributes available. However this is not my issue. I cannot find a working list of the traits. Kael alluded to looking in the Schema to see what was available, and the trait.xml. The Trait.xml doesn't seem to help at all, it keeps relying on various referenced attributes, to which I cannot locate anywhere else. All I can find is reference after to reference to other references! This is very frustrating. I can't figure out where certain attributes may be located. For example defining a that a land units gain +1 movement is established by a tag like

<UnitMovementBonus1>UNITCOMBAT_MELEE</UnitMovementBonus>

I know that isn't right, I just can't find where <UnitMovementBonus1> might be defined, you have other like <YieldCropBonus> or whatever. I know that for example hills give a +1 sight bonus (I think) so there must be some sort of attribute outthere that defines <UnitSightBonus1>TERRAIN_HILLS</UnitSightBonus> - now something similar to that would be what I'm after. Or being able to locate the war unhappiness attributes etc.

Maybe I'm just tying myself in knots, but I can't imagine i'm the only one wanting to create such traits, not just +1 Gold on X resource (nothing wrong with that, but something a bit more unusual/creative may be nice.) I'm not asking for a hand out, but simply any help or information would be good, especially from someone who has tried it.

It should in theory be relatively easy and the possibilies vast, but it all depends on being able to define/create attributes or creatively alter pre-existing ones.

Any help most welcome.
 
I can answer part, but not all, of this. Let me start by saying that generally this is something that several people are wondering about, see the thread here and my own thread here. Here's what I (think I) know so far, and hopefully some kind and wise person will flesh out the rest for all of us.

When you're designing your traits (or policies, or whatever) in XML, you are currently stuck with what's defined in the schema. So in your trait, you can use the table
Code:
	<Table name="Trait_MovesChangeUnitCombats">
		<Column name="TraitType" type="text" reference="Traits(Type)"/>
		<Column name="UnitCombatType" type="text" reference="UnitCombatInfos(Type)"/>
		<Column name="MovesChange" type="int"/>
	</Table>
to change the movement type for certain units for a given leader. The second bit you want to do is more complicated though, because it's not in the given schema.

Here is info on how to create a new schema using SQL. Following those instructions you can create an attribute like OtherCivsWarWeariness or whatever. BUT! It won't do anything. It's just an attribute to the trait, just a number. And here's where I think a lot of people trying to break a little further from vanilla ciV (myself included) are stuck.

I know it will take more than XML or SQL. Some things can be done using lua. Using it you can call a bunch of info from the game and make some changes to the game's variables. Here's a big list of calls you can make. But it's mostly undocumented, and this is where my (limited) understanding of ciV modding goes from mildly sure to completely fuzzy. Hopefully some sort of gameplay lua tutorial will show up some so we can all be enlightened.
 
I suspect it isn't possible then, for now.

As pointed out by others you can link the traits.xml to something in new in the schema but that has to point somewhere (i doubt it's lua) and I suspect it is pointed into somewhere we cannot go for now. It seems a little stupid, and counter intuitive, Civ 4 had far easier and more direct modding of this kind of thing - however, this game is designed to be both modable, fluid and cross compatible, something Civ 4 wasn't, so I'm not      ing. No doubt some bright spark in time will relsase ad 'trait editing' GUI friendly tool etc etc. Just one of those things about modding early.

For the time being 'new traits' as long as they use existing column referenced attributes still seem fine, it just means we won't see anything 'totally new' or cool for the time being.

I reckon this'll get fixed/done soon enough though as a fair number of people seem interseted.

Thanks for you help anyways mate.
 
Back
Top Bottom