Well, say you have 100 events that you are firing from an on_action, with all of them sharing (part of) the trigger conditions. If you specify those trigger conditions in the on_action, you are evaluating them once per character instead of once per character per event in the list.
For optimal use. I'd suggest this:
Change the syntax of on_actions in the following way:
Code:
<on_action_tag>
events = {
tag = xxx #an string to tag the list. Lists with the same tag in different files should be merged together.
common_triggers = {
<conditions common to all events in the list. This is checked agains every potential target before evaluating each event individually>
}
#events ids in the list, as in current version
}
#more events = {} clauses, with different (possibly none) common_triggers. Each is is handled separately
random_events = {
tag = xxx #an string to tag the list. Lists with the same tag in different files should be merged together.
common_triggers = {
<conditions common to all events in the list. This is checked agains every potential target before evaluating each event individually>
}
#events ids in the list, weighted as in vanilla
}
#more random_events = {} clauses, with different (possibly none) common_triggers. Each is is handled separately
}
The weights in random_events list are independent. i.e. a character can get one event from each list at a time.
This incorporate
@Zarathustra_the 's suggestion as well as allowing for more fine_grained control of random_events.
Edit: on further reflection, common_triggers would be of little use in random_events, since every character gets only one of them at a time, instead of all of them. Still would be a pretty good improvement for events = {} and to have separated pools of random events for the same on_action.
@Divine what do you think?