Alright, I seem to remember explaining this at some point. Deja vu and all that. But here goes, Anenu:
step one. Define your trait in /common/traits/MyTraits (or whatever you want to name the new file). Look at the vanilla traits to see what to do. Here is a trait that I made for my mod:
Code:
stigmata = {
church_opinion = 10
same_opinion = 5
monthly_character_piety = 0.25
sex_appeal_opinion = -5
}
step two. Make an icon for your new trait. Find an image or something you like by searching on google or wikipedia. if this is for a public mod (that you plan to release), do NOT include images that are not either your own creation or in the public domain. Anything on wikipedia is fine unless you want to draw your own. You need to resize your image to 24 pixels by 24 pixels. Save it to /gfx/traits as a *.dds file. No other format will do. Use photoshop if your computer has it or download freeware, either GIMP or my preference Paint.NET.
For 'stigmata', I used this image and drew in a red spot of blood to give St. Francis the wounds of Christ.
I know that the original image has a ring, but keep in mind that on screen it is a very small image, so should be clear but without too much detail.
step three. You need to modify /interface/traits.gfx for the game to recognize your trait. If you want for it to display. Otherwise the effects will be there but the trait icon will not display. Example:
Code:
spriteType = {
name = "GFX_trait_stigmata"
texturefile = "gfx/traits/stigmata.tga"
noOfFrames = 1
norefcount = yes
effectFile = "gfx/FX/buttonstate.lua"
}
Please note that traits.gfx has a
closing bracket at the end of the file. This closer must be there or bad things will happen. So keep that bracket under your last entry.
If all goes well, you will have a new trait to play with. To test it, insert <add_trait = MyTrait> into an existing character that is playable in 1066.
Ah, yes, step four. Localisation. You need to create a new localisation file or add to one of the pre-existing ones your trait's name and desc. For example:
Code:
stigmata;Stigmata;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
stigmata_desc;This character bears wounds resembling the five wounds that Christ received on the day of His crucifixion. These marks commonly denote an individual with a close personal relationship with Our Lord and Savior, which may win him or her the awe of other pious persons.;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
Voila! It is done. A new trait is created, and you can now assign it to historical characters or grant it by event. I would look at ash001's Friends and Foes mod for the most advanced modding on traits and their effects. You can also add more effects like those in the vanilla trait file, like congenital, personality, lifestyle, etc. Good luck!
