# The choice is made based on a weighted random, but the first weight that evaluates to >= 100 will be automatically chosen my_animation = { # Name of the animation, this is the name events and gui scripts reference. If no item has a weight > 0 no item will be selected male = { # Animations are scripted for each portrait type, all types needs to be scripted default = { head = "idle" torso = "idle" } # Default animation used if no item has a weight > 0, or if it is used in a non scripted environment ## How to handle portrait_modifiers at this top level, in relation to animation variants # (default) no: portrait_modifiers at top level are _copied_ animation variants, if they have no portrait_modifiers (or packs) defined # yes: for each portrait_modifiers at this top level, we _add_ their overrides to all portrait_modifiers of all animation variants force = yes/no portrait_modifier = { # Triggered portrait modifier for when this animation is picked. The first one satisfying the trigger will be picked. trigger = { age > 30 } custom_beards = awesome_beard # One or multiple portrait modifier overrides clothes = basic_clothes ..... } portrait_modifier = ... portrait_modifier_pack = # Add all of modifiers from the pack with name . Packs are defined in `*.animationpack` files. # Add a portrait modifier set. All modifier sets are applied independently when this animation is selected. (the first valid modifier in each is applied) portrait_modifier_set = { portrait_modifier = ... # Portrait modifiers for the current variant (same syntax as for the default animation). If none are specified, the default animation ones will be used. portrait_modifier = ... portrait_modifier_pack = # Add all of modifiers from the pack with name . Packs are defined in `*.animationpack` files. } portrait_modifier_set = { ... } # Animation variant (possibly weighted) evil = { # Item, specifies animations to be used if this one is choosen by the weighted random animation = { head = "evil" torso = "evil" } portrait_modifier = ... # Portrait modifiers for the current variant (same syntax as for the default animation). If none are specified, the default animation ones will be used. portrait_modifier = ... portrait_modifier_pack = # Add all of modifiers from the pack with name . Packs are defined in `*.animationpack` files. # Add a portrait modifier set. All modifier sets are applied independently when this animation is selected. (the first valid modifier in each is applied) portrait_modifier_set = { portrait_modifier = ... # Portrait modifiers for the current variant (same syntax as for the default animation). If none are specified, the default animation ones will be used. portrait_modifier = ... portrait_modifier_pack = # Add all of modifiers from the pack with name . Packs are defined in `*.animationpack` files. } portrait_modifier_set = { ... } weight = { # This is where the weight is calculated base = 1 # The final weigth is calculated like this: # weight = base # for each modifier # weight *= modifier factor # weight += modifier add modifier = { add = 10 has_trait = evil } modifier = { factor = 0 has_proffession = programmer } } } } boy = { default = { head = "idle_boy" torso = "idle_boy" } } female = { default = { head = "idle" torso = "idle" } } girl = female }