Results 1 to 5 of 5

Thread: Conditions to inherit the colonies

Hybrid View

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

    Default Conditions to inherit the colonies

    in data/campaigns/main/scripting.lua

    If I were to make it so that I inherit the colonies regardless of objectives met in turn 108, would this be the correct code?

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


    Would I need to restart my campaign? Also on "("britain", "thirteen_colonies", 6, 15, context)", what is the '6', '15' and 'context'?

  2. #2
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Conditions to inherit the colonies

    Quote Originally Posted by Scorpius_Brutii View Post
    in data/campaigns/main/scripting.lua

    If I were to make it so that I inherit the colonies regardless of objectives met in turn 108, would this be the correct code?

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


    Would I need to restart my campaign? Also on "("britain", "thirteen_colonies", 6, 15, context)", what is the '6', '15' and 'context'?
    Almost.

    context is event context for beginning-of-turn event, which holds all details like faction name, turn number etc., and conditions.XXX(YYY, context) is just nice interface to it. You need to pass it around to almost everything.

    scripting.game_interface:grant_faction_handover seems to preschedule handover, and 6-15 seem to be turns after current.

    So this means, on turn 108, put handover on random turn between 108+6 and 108+15.

    I don't remember exactly, but you need something like 0, 0 on turn 108, or 1, 1 or turn 107 to get what you want.

  3. #3

    Default Re: Conditions to inherit the colonies

    Tried as you suggested, no pie not inheriting them. Or does the script require me to restart my campaign?

  4. #4
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Conditions to inherit the colonies

    I think you should be able to change it before turn 108. Maybe pick some earlier date for testing first, and start campaign a few times?

  5. #5

    Default Re: Conditions to inherit the colonies

    Quote Originally Posted by taw View Post
    I think you should be able to change it before turn 108. Maybe pick some earlier date for testing first, and start campaign a few times?

    Any Idea why It's Turn 108 ?

Posting Permissions

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