Search

Online Users

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest

Most users ever online was 29 on Sat Jul 08, 2017 8:56 pm

Registered users: Baidu [Spider] based on users active over the past 5 minutes

Videos

Summoned Company Behaviour

AI Creation, Map & Mod Making
Fri Jul 11, 2014 2:20 pm

  • by durruti

    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: Select all
    [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: Select all
    ;; 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.
    User avatar
    Chimaeros
    Site Admin
    Site Admin
     
    Posts: 470
    Joined: Wed Apr 16, 2014 8:18 am
    Location: United States


Return to Editing






Information
  • Who is online
  • Registered users: Baidu [Spider]
cron