i've found a way to "fix" the annoying behaviour of summoned units dying as soon as the summoner disengages from combat - be it only for a split second to switch targets or to go for a lair after disposing off its militia.
1. increase control_range and operational_range using a new template in data\templates\template_organization_k2.tgi, use this template for summoned companies in data\units\...\...
2. remove the summoned flag from the summoned property in data\properties\properties_intrinsic.tgi
3. create a copy of the above property (new_summoned), add summoned as required property and change the berserk flag to summoned again (we need the functionality of this flag)
Code: › [Property Template=SharedProperty]
{
IDS = summoned
name = "#properties_intrinsic_summoned_name"
icon = /Properties/%s/PropertyIcons/IconPropertySummoned.png
[Modifier Template=FlagModifier]
modifier_flag = BERSERK
}
[Property Template=SharedProperty]
{
IDS = new_summoned
name = "#properties_intrinsic_summoned_name"
icon = /Properties/%s/PropertyIcons/IconPropertySummoned.png
required_properties = summoned
[Modifier Template=FlagModifier]
modifier_flag = SUMMONED
} |
4. open data\game\actor_states.tgi and add the property new_summoned to the following states: mind_moving, mind_reattaching, mind regrouping, mind_reforming, mind_resting
Code: › ;; MOVING STATE: moving
[ActorState template=ActorStateMind]
{
IDS = mind_moving
name = "#actor_states_mind_moving_name"
priority = 8
resupply = true
morale_replenish = false
formation_required = DESIRED
[Property]
property_ids = new_summoned
}
;; MOVING STATE: used by elements that have become detached from the organization
[ActorState template=ActorStateMind]
{
IDS = mind_reattaching
name = "#actor_states_mind_reattaching_name"
priority = 8
resupply = false
morale_replenish = false
formation_required = BROKEN
[Property]
property_ids = new_summoned
}
;; STANDING STATE: rebuilding the primary element
[ActorState template=ActorStateMind]
{
IDS = mind_regrouping
name = "#actor_states_mind_regrouping_name"
priority = 12
resupply = false
morale_replenish = false
formation_required = BROKEN
behavior_required = AGGRESSIVE
[Property]
property_ids = actor_state_regrouping
[Property]
property_ids = new_summoned
}
;; STANDING STATE: returning to desired formation
[ActorState template=ActorStateMind]
{
IDS = mind_reforming
name = "#actor_states_mind_reforming_name"
priority = 8
entrenchable = false
resupply = true
morale_replenish = true
formation_required = DESIRED
behavior_required = AGGRESSIVE
[Property]
property_ids = actor_state_reforming
[Property]
property_ids = new_summoned
}
;; STANDING STATE: not moving
[ActorState template=ActorStateMind]
{
IDS = mind_resting
name = "#actor_states_mind_resting_name"
priority = 4
entrenchable = true
resupply = true
morale_replenish = true
formation_required = DESIRED
behavior_required = DESIRED ;;AGGRESSIVE -pcb032204
[Property]
property_ids = actor_state_resting
[Property]
property_ids = new_summoned
} |
explanation: the original summoned property now merely adds berserk to disable moral, the increased ranges make sure that a company summoned to engage militia will also attack what this militia is defending - unaffected by actions of the company that summoned them. finally the property linked to the actor states kicks in whenever a company with the required property (summoned) is not engaged i.e. moving, resting... so that they die correctly.