As Aradan wrote, using RandomPercent in traits/ancillaries allows you to have non-integer probabilities for triggers, as in this piece here:
Code:
;------------------------------------------
Trigger harsh_lifestyle1
WhenToTest CharacterTurnEnd
Condition EndedInSettlement
and RemainingMPPercentage = 100
and SettlementBuildingExists = governors_house
and RandomPercent > 50
Affects Austere 1 Chance 2
Affects Pragmatic 1 Chance 2
Affects Stoic 1 Chance 1
You can also use it to save some lines of code: suppose that you want to trigger a certain trait B whenever a character acquires another trait A. You could either write it like this:
Code:
Trigger acquire_A
WhenToTest CharacterTurnEnd
Condition IsGeneral
and Trait A < 1
Affects A 1 Chance 20
;-----------------------------------
Trigger acquire_B
WhenToTest CharacterTurnEnd
Condition IsGeneral
and Trait A = 1
and Trait B < 1
Affects B 1 Chance 100
Or you can save some bytes writing it like this:
Code:
Trigger acquire_A_then_B
WhenToTest CharacterTurnEnd
Condition IsGeneral
and Trait A < 1
and RandomPercent > 80
Affects A 1 Chance 100
Affects B 1 Chance 100
Bookmarks