Log in

View Full Version : Traits question



Andreas
12-19-2005, 17:06
Hello... Was messing around with some traits for me mod today, and I got to the point of adding some of them. What i want to do is to create a number of traits (7), which a family memeber gets one they come to age. I want to be sure that the family member gets one of them, but not more, and I want the chance to be about equal for them. The only way I can imagine is this:
Traits:


;================================================== ======
Trait Trait_One
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait1
Description Trait1_desc
EffectsDescription Trait1_effects_desc
Threshold 1

Effect X b

;================================================== ======
Trait Trait_Two
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait2
Description Trait2_desc
EffectsDescription Trait2_effects_desc
Threshold 1

Effect X c

;================================================== ======
Trait Trait_Three
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait3
Description Trait3_desc
EffectsDescription Trait3_effects_desc
Threshold 1

Effect X d

;================================================== ======
Trait Trait_Four
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait4
Description Trait4_desc
EffectsDescription Trait4_effects_desc
Threshold 1

Effect X e

;================================================== ======
Trait Trait_Five
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait5
Description Trait5_desc
EffectsDescription Trait5_effects_desc
Threshold 1

Effect X f

;================================================== ======
Trait Trait_Six
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait6
Description Trait6_desc
EffectsDescription Trait6_effects_desc
Threshold 1

Effect X g

;================================================== ======
Trait Trait_Seven
Characters family
ExcludeCultures barbarian, roman, eastern, hun, nomad

Level Trait7
Description Trait7_desc
EffectsDescription Trait7_effects_desc
Threshold 1

Effect X h

;================================================== ======


Trigggers:


;------------------------------------------
Trigger trigger_one
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and empire_west

Affects Trait_One 1 Chance 15
;------------------------------------------
Trigger trigger_two
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and empire_west

Affects Trait_Two 1 Chance 15
;------------------------------------------
Trigger trigger_three
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and not Trait Trait_Three >= 1
and empire_west

Affects Trait_Three 1 Chance 15
;------------------------------------------
Trigger trigger_four
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and not Trait Trait_Three >= 1
and not Trait Trait_Four >= 1
and empire_west

Affects Trait_Four 1 Chance 15
;------------------------------------------
Trigger trigger_five
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and not Trait Trait_Three >= 1
and not Trait Trait_Four >= 1
and not Trait Trait_Five >= 1
and empire_west

Affects Trait_Five 1 Chance 15
;------------------------------------------
Trigger trigger_six
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and not Trait Trait_Three >= 1
and not Trait Trait_Four >= 1
and not Trait Trait_Five >= 1
and not Trait Trait_Six >= 1
and empire_west

Affects Trait_Six 1 Chance 15
;------------------------------------------
Trigger trigger_seven
WhenToTest CharacterComesOfAge

Condition not Trait Trait_One >= 1
and not Trait Trait_Two >= 1
and not Trait Trait_Three >= 1
and not Trait Trait_Four >= 1
and not Trait Trait_Five >= 1
and not Trait Trait_Six >= 1
and not Trait Trait_Seven >= 1
and empire_west

Affects Trait_Seven 1 Chance 100
;------------------------------------------

Is that the easiest and most efficant way to do it? There is the slight chance that the last on will get the most true hits, and that would be sad but I can see no other way... Can you?

Of course, it would be easier if we could combine trigger for different traits... A simple random 1 to 100, and six if lines and one else would do the trick pretty easy... But we cannot do that, can we:san_sad:

Malrubius
12-19-2005, 18:15
No, we can't.

I'd increase the chance for each trigger, so the chance of getting any one trait is about equal, unless you want the last trait and the first trait to be more common than the others.

For example, the first trait has a 15% chance, but the second has only 15% chance of 85% chance, or 12.75%, and the 3rd trigger is about 11% likely to occur, the way you have it now. You'd actually want the 2nd trigger to have a chance of 17, to get comparable results. The third trigger should have a chance of about 21%, the 4th 27%, the 5th 38%, the 6th 60%, and the last 100%. It won't produce an exactly equal distribution, but it will get you pretty close.

lysarin
12-19-2005, 18:27
You could just add them as antitraits to each other. Also add a NoGoingBackLevel so the trait won't be lost if another one is gained.
And make sure you have the right exclude cultures (you have roman as an excluded culture but the trigger only allows romans, but they can't gain it unless you remove the roman culture from the trait).

Like this:



;================================================== ======
Trait Trait_One
Characters family
ExcludeCultures barbarian, eastern, hun, nomad, carthaginian
NoGoingBackLevel 1
AntiTraits Trait_Two, Trait_Three, Trait_Four, Trait_Five, Trait_Six, Trait_Seven

Level Trait1
Description Trait1_desc
EffectsDescription Trait1_effects_desc
Threshold 1

Effect X b

;================================================== ======
Trait Trait_Two
Characters family
ExcludeCultures barbarian, eastern, hun, nomad, carthaginian
NoGoingBackLevel 1
AntiTraits Trait_One, Trait_Three, Trait_Four, Trait_Five, Trait_Six, Trait_Seven

Level Trait2
Description Trait2_desc
EffectsDescription Trait2_effects_desc
Threshold 1

Effect X c


And so forth...

And the triggers (one is enough):



;------------------------------------------
Trigger trigger_one
WhenToTest CharacterComesOfAge

Condition FactionType empire_west

Affects Trait_One 1 Chance xx
Affects Trait_Two 1 Chance xx
Affects Trait_Three 1 Chance xx
Affects Trait_Four 1 Chance xx
Affects Trait_Five 1 Chance xx
Affects Trait_Six 1 Chance xx
Affects Trait_Seven 1 Chance xx



Make sure you don't misspell anything... think that's it. I'm in a hurry so I might have made a mistake... but it looks right. :san_grin:

Andreas
12-19-2005, 19:44
Thanks, great help. I know about the chances, that was just as examples.

And my western_romans aren't romans... they are easterns. (It was the esiest way really, just list new faction - old factions and switch cultures....:san_smiley: )