Results 1 to 11 of 11

Thread: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Baleur's Avatar Biarchus
    Join Date
    Sep 2004
    Location
    South Sweden
    Posts
    624

    Default Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Why havent i done this before? lol
    I was just messing around in the scripting.lua, and eventually i just went ahead and deleted the entire american protectorates script that either gives the player a mission to take control of the colonies, or just hands them over to the AI.

    This
    Spoiler Alert, click show to read: 
    local function OnFactionTurnStart(context)
    if 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) and not conditions.FactionIsHuman("thirteen_colonies", 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) and not conditions.FactionIsHuman("new_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) and not conditions.FactionIsHuman("louisiana", context) then
    scripting.game_interface:grant_faction_handover("france", "louisiana", 6, 15, context)
    end
    end


    To this
    Spoiler Alert, click show to read: 
    local function OnFactionTurnStart(context)
    if conditions.TurnNumber(context) == 5 then
    scripting.game_interface:enable_auto_generated_missions(true)
    end
    end



    To my utter surprise, after spamming 5-10 turns as Spain just to check if it was working properly, all hell broke loose..
    It's like the AI nations (on H/H) lost their inhibitions.

    1. United Provinces declares war, blockades a port.
    2. Morocco conquers Gibraltar.
    3. After some time, Gibraltar rebels, lol a nice independent buffer there now.
    3. Louisi-friggin-ana declares war on me, the Cherokee joins them, and conquers Florida..
    4. After some time, Florida rebels as well, another independent
    5. France breaks up their alliance with me.
    6. The Barbary States conquers Gibraltar.
    7. Sweden declares war on Austria.
    8. Inuit Nations conquer Newfoundland O_o
    9. The Pueblo Nations declare war on New Spain, i decline to join the war.
    10. Pueblo Nations epic fail, New Spain pushes them back, now hostile towards me for declining to help them, alliance and trade routes broken.

    Phew..
    I dont know, maby its just a placebo thing, but thats alot of stuff happening within 5 years. I suppose there could be some real actual reason behind it, like that the big nations France, Britain and Spain no longer get even bigger, due to not getting the protectorates handed over to them.
    Which i suppose may allow smaller nations to gather up courage to attack them, either the protectorates in the americas or the main nations in europe. Seems to be the case anyway.

  2. #2
    Foederatus
    Join Date
    May 2009
    Location
    Toronto, Ontario, Canada
    Posts
    38

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    You could also add this in to have the game start with the protectorates under the control of the owners, since those countries weren't really protectorates, but colonies:


    if conditions.TurnNumber(context) == 1 and conditions.FactionIsHuman(context) then
    scripting.game_interface:grant_faction_handover("britain", "thirteen_colonies", 0, 0, context)
    scripting.game_interface:grant_faction_handover("spain", "new_spain", 0, 0, context)
    scripting.game_interface:grant_faction_handover("france", "louisiana", 0, 0, context)
    end



    Having 3 superpowers in the game really puts the AI into action.

    You can also add "local events = require "data.events" to the top of the page (with the similar commands) and then add in a command to change treasuries (you can make the pirates more powerful, make the mughal empire collapse more slowly, and make other changes to your tastes.)

    events.FactionTurnStart[#events.FactionTurnStart+1] =
    function (context)
    if conditions.TurnNumber(context) == 1 and conditions.FactionName("britain", context) then
    effect.adjust_treasury(9000, context)
    end
    if conditions.TurnNumber(context) == 1 and conditions.FactionName("spain", context) then
    effect.adjust_treasury(8000, context)
    end
    if conditions.TurnNumber(context) == 1 and conditions.FactionName("france", context) then
    effect.adjust_treasury(7500, context)
    end
    if conditions.TurnNumber(context) == 1 and conditions.FactionName("mughal", context) then
    effect.adjust_treasury(4000, context)
    end
    end


    This is the script I have going to add the colony treasury to the owner, and give the mughals a little boost.

  3. #3
    Shabby_Ronin's Avatar Primicerius
    Join Date
    Mar 2008
    Location
    Ohio, United States
    Posts
    3,249

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Baleur, would you be so kind as to write how to do it here or in the mods section or PM me with instructions. I am afraid to just try it myself., or email me a copy of the file?

    thanks
    "...I'll look for something else. We're surrounded by water. Why are we eating knob?"

  4. #4
    Legio's Avatar EMPRESS OF ALL THINGS
    Moderator Emeritus Content Emeritus

    Join Date
    Mar 2008
    Location
    Chlοėtopia
    Posts
    43,774

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Moved to modding workshop.

  5. #5
    Baleur's Avatar Biarchus
    Join Date
    Sep 2004
    Location
    South Sweden
    Posts
    624

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    TheStinger well in my game, having 6 minipowers instead of 3 superpowers makes the AI more active, as i wrote in my post. Why you recommended me to add the handover script that i deleted is beyond me =P

    Shabby_Ronin just open the scripting.lua file in notepad, located in empire total war\data\campaigns\main or Steam\steamapps\common\empire total war\data\campaigns\main
    As long as you make a copy of the file first, you can mess around as much as you want with it =)

  6. #6

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    thing i find is that one campaign can go crazy... the next.. nothing..

    in a recent test campaign poland basically took over austria.

    other campaigns the natives go crazy in the americas...

    a different one austria took over a bunch of ottoman territory, while prussia crushed poland and coulrand and saxony.


    I find the AI completely random sometimes...

  7. #7
    Shabby_Ronin's Avatar Primicerius
    Join Date
    Mar 2008
    Location
    Ohio, United States
    Posts
    3,249

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Thanks Baleur, I'm gonna try that...I haven't personally modded my files since RTW, so it makes me nervous...and I always forget to make copies when I fiddle with things. Gonna remember this time though.
    "...I'll look for something else. We're surrounded by water. Why are we eating knob?"

  8. #8

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Quote Originally Posted by Baleur View Post
    Why havent i done this before? lol
    I was just messing around in the scripting.lua, and eventually i just went ahead and deleted the entire american protectorates script that either gives the player a mission to take control of the colonies, or just hands them over to the AI.

    To my utter surprise, after spamming 5-10 turns as Spain just to check if it was working properly, all hell broke loose..
    It's like the AI nations (on H/H) lost their inhibitions.

    1. United Provinces declares war, blockades a port.
    2. Morocco conquers Gibraltar.
    3. After some time, Gibraltar rebels, lol a nice independent buffer there now.
    3. Louisi-friggin-ana declares war on me, the Cherokee joins them, and conquers Florida..
    4. After some time, Florida rebels as well, another independent
    5. France breaks up their alliance with me.
    6. The Barbary States conquers Gibraltar.
    7. Sweden declares war on Austria.
    8. Inuit Nations conquer Newfoundland O_o
    9. The Pueblo Nations declare war on New Spain, i decline to join the war.
    10. Pueblo Nations epic fail, New Spain pushes them back, now hostile towards me for declining to help them, alliance and trade routes broken.

    Phew..
    I dont know, maby its just a placebo thing, but thats alot of stuff happening within 5 years. I suppose there could be some real actual reason behind it, like that the big nations France, Britain and Spain no longer get even bigger, due to not getting the protectorates handed over to them.
    Which i suppose may allow smaller nations to gather up courage to attack them, either the protectorates in the americas or the main nations in europe. Seems to be the case anyway.

    Just out of curiosity, do you run Vanilla Campaign AI, or any modded one?

  9. #9
    Baleur's Avatar Biarchus
    Join Date
    Sep 2004
    Location
    South Sweden
    Posts
    624

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Vanilla AI, i only have visual mods (flagmods or smokemods etc)

  10. #10

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    where is this scripting.lua

  11. #11

    Default Re: Removed 13 Colonies, Louisiana, New Spain handover scripts. The world came to life!

    Quote Originally Posted by 16sh4a View Post
    where is this scripting.lua
    data/campaign/main

Posting Permissions

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