I thought it might be helpful to include a few notes on how the triggers work given some of the apparent confusion.
I'll use the probably now familiar GoodFarmer trigger as my example...
Trigger governing5
WhenToTest GovernorBuildingCompleted
Condition SettlementBuildingFinished >= farms
Affects GoodFarmer 1 Chance 100
First we have the trigger's identity, governing5, which is nothing more than a convenient label to make it easier for people to locate a specific trigger. I could rename this trigger as get_badfarmer and it would have no effect on its functionality, equally I could change its name to governing1, duplicating that of another trigger, and it will have no effect - both triggers will still function correctly.
Next is the event when the trigger is tested, GovernorBuildingCompleted. Many events can be determined from the examples already available in the traits file, while others can be found in the Events, Conditions, & Commands thread. It's important to note that only CA can edit existing events or create new events, so we can only work with what is available, no amount of modding will get around this.
In the case of the GovernorBuildingCompleted event, it occurs when a building is completed in a settlement that has a governor.
Next we have the condition, SettlementBuildingFinished. Despite how many of them appear conditions are not mathematical equations. Conditions are functions that return a true or false answer given one or more parameters. Some of these parameters are variables that are automatically passed to the function, and are otherwise hidden, while others have to be specifically declared in the trigger and are thus visible and amendable.
In the case of this trigger, the condition function SettlementBuildingFinished is intended to test a building that has just been completed. It is passed a variable parameter that contains the identify of the completed building, plus two declared parameters - >= and farms - that the function tests that building against. This trigger will return true if the completed building is Land Clearance or any other higher-level farm.
All conditions for a trigger in effect have to return an answer of true for the trigger to cause any results. I say 'in effect' because we have the possibility of 'not' switches, such as and not SettlementBuildingFinished >= farms, which would mean you'd get GoodFarmer for completing anything other than a farm. The 'not' switch simply reverses the true/false answer from the function, so you'd need the function to return false for that condition if the trigger is to cause any results. Confused? You will be!
A trigger can have multiple conditions... for example if we only want Julii characters to gain GoodFarmer when they complete a farm, we'd add and FactionType romans_julii under the Condition SettlementBuildingFinished >= farms line. In the case of multiple conditions, all conditions must return true, after any 'not' switches if appropriate, for the trigger to cause any results.
Finally we have the results caused, Affects GoodFarmer 1 Chance 100 if all conditions are met. In this case the governor's GoodFarmer trait has a 100% chance of gaining 1 point. Obviously if the chance is less than 100% then it's possible that random chance will result in no points gained even if all the conditions have been met. If the points gained are enough to equal or exceed the threshold of a trait level then the character will gain the appropriate effects.
As a note up to 10 traits can be effected by any one trigger, but the trigger can be duplicated and different traits effected if more than 10 are required for the same trigger event and conditions.
Bookmarks