Results 1 to 2 of 2

Thread: Apply Effect Bundle to Region HELP!

  1. #1

    Default Apply Effect Bundle to Region HELP!

    Hi all!

    Having trouble with this line:


    scripting.game_interface:apply_effect_bundle_to_region("etruscan_velzna_unrest","rom_italia_etruria",4) -> It doesn't trigger and breaks the script.


    My effect_bundle applies to "this_region" and my effect in the bundle to "this_region_province".

    I tried with vanilla payloads and still no luck. CA Attila guide says (bundle_key, region_key, turns) so... it should work. Can't find it used anywhere , unfortunately.

    Does any one of you know how to correctly use this command?

  2. #2

    Icon1 Re: Apply Effect Bundle to Region HELP!

    apply_effect_bundle_to_region does NOT work.

    Instead we must use: apply_effect_bundle_to_characters_force("etruscan_velzna_unrest",cqi,bundle_turns)

    (bundle_key, region CQI, turns the bundle will be active (-1 for indefinite))

    The way to get the CQI:
    I'm getting the cqi from the colonel in the region (garrison leader) that I want. So I apply the bundle to his force.



    Here's the code I'm using to get the CQI of a certain region:



    Spoiler Alert, click show to read: 
    function getRegioncqi(region_key)


    local faction_key = scripting.game_interface:model():world():region_manager():region_by_key(region_key):owning_faction():name()
    local characterlist_length = scripting.game_interface:model():world():faction_by_key(faction_key):character_list():num_items()
    local RegionCqi = 0

    for i=0, characterlist_length,1 do
    local hasresidence = scripting.game_interface:model():world():faction_by_key(faction_key):character_list():item_at(i):has_garrison_residence()
    local iscolonel = scripting.game_interface:model():world():faction_by_key(faction_key):character_list():item_at(i):character_type("colonel")


    if hasresidence == true and iscolonel == true then
    local char_region = scripting.game_interface:model():world():faction_by_key(faction_key):character_list():item_at(i):region():name()


    if char_region == region_key then
    local RegionCqi = scripting.game_interface:model():world():faction_by_key(faction_key):character_list():item_at(i):cqi()
    return RegionCqi
    end


    end


    end


    return RegionCqi


    end


    And on my code I got these line to apply the bundle:

    Spoiler Alert, click show to read: 

    local bundle_turns = 6
    local region_key = "rom_italia_etruria"
    local cqi = getRegioncqi(region_key)
    scripting.game_interface:apply_effect_bundle_to_characters_force("etruscan_velzna_unrest",cqi,bundle_turns)



    Hope this is helpful for any of you guys!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •