Results 1 to 3 of 3

Thread: Trouble with protectorates.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Icon5 Trouble with protectorates.

    I've been trying to get the protectorates to be handed over to the main factions if the player isn't actually playing one of the protectorates himself, but every single scripting file version I've tried to use does not work.

    Here are examples of the codes that are NOT working:

    local function OnFactionTurnStart(context)
    if conditions.TurnNumber(context) == 1 then
    if conditions.FactionName("cherokee", context) and conditions.FactionIsHuman("cherokee", context) then
    scripting.game_interface:trigger_custom_mission("britain_protectorate", "cherokee", "capture_city", 0, "Acadia", "", "main_mission_capture_city_text", "main_protectorate_new_spain_reward", 2000, "", context)
    end
    elseif conditions.TurnNumber(context) == 2 then
    if conditions.FactionName("britain", context) and conditions.FactionIsHuman("britain", context) then
    scripting.game_interface:trigger_custom_mission("britain_protectorate", "britain", "protectorate_region_capture", 0, "georgia_usa+cherokee_territory+new_france", "", "mission_text_text_main_protectorate_thirteen_colonies_text", "mission_text_text_main_protectorate_thirteen_colonies_reward", 0, "thirteen_colonies", context)
    elseif conditions.FactionName("spain", context) and conditions.FactionIsHuman("spain", context) then
    scripting.game_interface:trigger_custom_mission("spain_protectorate", "spain", "protectorate_region_capture", 0, "trinidad_tobago+tejas+curacao", "", "mission_text_text_main_protectorate_new_spain_text", "mission_text_text_main_protectorate_new_spain_reward", 0, "new_spain", context)
    elseif conditions.FactionName("france", context) and conditions.FactionIsHuman("france", context) then
    scripting.game_interface:trigger_custom_mission("france_protectorate", "france", "protectorate_region_capture", 0, "michigan_territory+algonquin_territory+cherokee_territory", "", "mission_text_text_main_protectorate_louisiana_text", "mission_text_text_main_protectorate_louisiana_reward", 0, "louisiana", context)
    end
    elseif conditions.TurnNumber(context) == 5 then
    scripting.game_interface:enable_auto_generated_missions(true)
    end

    if conditions.FactionName("britain", context) and not conditions.FactionIsHuman("britain", context) then
    scripting.game_interface:grant_faction_handover("britain", "thirteen_colonies", 6, 15, context)
    elseif conditions.FactionName("spain", context) and not conditions.FactionIsHuman("spain", context) then
    scripting.game_interface:grant_faction_handover("spain", "new_spain", 6, 15, context)
    elseif conditions.FactionName("france", context) and not conditions.FactionIsHuman("france", context) then
    scripting.game_interface:grant_faction_handover("france", "louisiana", 6, 15, context)
    end
    end


    Another one:

    local function OnFactionTurnStart(context)
    if conditions.TurnNumber(context) == 3 then
    scripting.game_interface:enable_auto_generated_missions(true)
    end

    if conditions.FactionName("britain", context) then
    scripting.game_interface:grant_faction_handover("britain", "thirteen_colonies", 1, 1, context)
    elseif conditions.FactionName("spain", context) then
    scripting.game_interface:grant_faction_handover("spain", "new_spain", 1, 1, context)
    elseif conditions.FactionName("france", context) then
    scripting.game_interface:grant_faction_handover("france", "louisiana", 1, 1, context)
    end
    end


    And another:

    local function OnFactionTurnStart(context)
    if conditions.TurnNumber(context) == 1 then
    if conditions.FactionName("cherokee", context) and conditions.FactionIsHuman("cherokee", context) then
    scripting.game_interface:trigger_custom_mission("britain_protectorate", "cherokee", "capture_city", 0, "Acadia", "", "main_mission_capture_city_text", "main_protectorate_new_spain_reward", 2000, "", context)
    end
    end


    None of these scripts seem to be working at all (I know they don't necessarily do what I wanted them to do, I was just trying them out to see if they worked).

    Any ideas on why these scripts aren't working?

  2. #2

    Default Re: Trouble with protectorates.

    sorry i cant help you here,

    i do know however that people have had success usingthe original scripts of new spain etc, and simply replacing the faction names

    although as your already doing very compcated things, i'll assume ive been a pillock and apolgise for wasting you time

    The Cap

  3. #3

    Default Re: Trouble with protectorates.

    It's fine....I've just been trying different forms of scripts.

    Some I picked up whole cloth from mod files, others I modified on my own, they just don't seem to work at all.

    Maybe some of my mods are interfering with this in some way. I know I do have a bunch of those, so one is bound to be causing some interference. I just thought mods couldn't interfere with scripting (unless they actually modify the scripting.lua file), but I may be wrong there.

    It's not the end of the world or anything...I just wanted to have the protectorates join me in my campaigns as Britain, Spain and France.

Posting Permissions

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