Page 2 of 7 FirstFirst 1234567 LastLast
Results 21 to 40 of 132

Thread: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

  1. #21

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    I finally figured out how to use the battle win functionality, and to check for who is in the others territory. Which means I can make factions lose if they are going to conquer new territory, but still perform normally at home. I so I redid the entire script from the bottom up, and replaced the attrition and movement features with battle lose functionality, that takes effect before a faction becomes too big.

    Quote Originally Posted by Maetharin View Post
    Very intriguing, do you plan on further expanding functionalities?
    F.e. by comparing the relative strength of factions so they seek peace?
    I found that comparing faction strength does not work to intention. Think of the following scenario: faction A has 3 regions, and we do not want it to expand beyond that, so we tell it that it cant attack smaller factions. So it cant attack it's neighbor faction B, which has 2 regions. But now faction B conquers a region from another two-region faction, which it may fight against because it is of equal size. Now faction A can attack faction B, because they are of equal size, so faction A has 4 regions, above its limit. If we were to continue this, they can "swing" to any size. Which is why this approach doesnt work. The AI will always expand as much as I allow them, and that very fast. The only thing we can do is tell each faction how big it can be in absolute terms.
    Last edited by CIaagent11; November 12, 2017 at 12:56 PM.

  2. #22
    Litharion's Avatar Artifex
    Join Date
    Sep 2013
    Location
    Germany
    Posts
    2,622

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Thing is the possibilities to effectively influence the AIs diplomatic actions via script are very limited in Rome 2.

    Interesting might be to change the CAI personalities for example make them less aggressive after they have reached a certain threshold.

    force_change_cai_faction_personality

  3. #23

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Thanks for the suggestion, I will look into it. It would make sense to start out with low aggression and raise it as the campaign moves on. But I have no idea how to work with the force_change_cai_faction_personality command, and I had no luck finding out what the possible values are.

    *

    I would recommend people who are using this to download the latest version, I've eradicated some bugs that more or less broke the battle bonuses and silently updated via mediafire.

  4. #24
    Litharion's Avatar Artifex
    Join Date
    Sep 2013
    Location
    Germany
    Posts
    2,622

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Quote Originally Posted by CIaagent11 View Post
    Thanks for the suggestion, I will look into it. It would make sense to start out with low aggression and raise it as the campaign moves on. But I have no idea how to work with the force_change_cai_faction_personality command, and I had no luck finding out what the possible values are.

    *

    I would recommend people who are using this to download the latest version, I've eradicated some bugs that more or less broke the battle bonuses and silently updated via mediafire.

    force_change_cai_faction_personality(faction:name(), "cai_personalities_table_key");

  5. #25

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    I have idea about Peace Treaty Script.
    Between minor faction 2~5 years random Peace Treaty (like 30%, 40% 50% chance) - it represent petty war among minors
    Between major faction 5~20 years random. It represent hegemonic war.
    Between Majaor vs minor 5~10 years random. It represent conquest

  6. #26

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Thanks for the suggestion. You mean a random peace between factions at random intervals? The peace wouldn't last long. They just go to war again as soon as they can, if they hate each others. The AI routine basically goes "if not at war, randomly declare war on a faction you hate". The AI will always be as virulently expansive as you let it. If you stop it from expanding into one direction, it will just go around and expand in whatever direction it can according to that set of new rules.
    To make factions have peace over several years, it would be necessary to save that faction combination in a variable in the savegame. It would be a boondoggle to implement and not really do much.

  7. #27

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    not peace between factions at random intervals. it could be 2 years war or 5 years war. (ex minor faction) by cheking X% chance of cease fire.

  8. #28

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    I recommend everyone to update. All versions prior to now had a bug that crashed the script when a character did not have a region.

  9. #29

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Here I have a screenshot where the Apulii, already again or still spread so much ... Like the Sequani. These invade regions where they are not supposed to be. I will continue playing the game with the new version, and let's see what else happens. It is round 68.

    Last edited by Sedulus; November 19, 2017 at 06:53 AM.

  10. #30

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Must be because they expanded while you had the version with the region log bug. Seems the Apulii precisely expanded within the area the peace treaties allows them to be in. Just the pending battle part wasn't working. Don't expect that to change now, I think nobody around them can go to war with them.

    If this version doesn't work, then I don't know what will. I eradicated the bugs now. It works well in my test campaign, and the logs all respond what they're supposed to. I'll post a screenshot later.

    It seems the power of the win_next_autoresolve_battle isn't infinite though. Apparently sometimes the strengths are just too mismatched for the autoresolve scripts to turn that into a victory. I can't do anything about that. For example in my last campaign, Massilia was lost to the Volcae, even though the log said that the script ran to the end and gave a win bonus to to Massilia. That seems to be rare though.
    Also, the check whether factions are in enemy territory is still wonky. Because in_enemy_territory only updates on the next turn, so they can go conquer stuff if they reach the enemy within the same turn of being in their own territory. I've tried to work around that, but it's not perfect.

    You can check major_log.txt in your Rome 2 folder. If you can find the battle where things went wrong, you can check whether the script was runnign to the end. If it says "finished autoresolve bonuses" at the end of a pending battle paragraph, then it didn't crash.

  11. #31

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Then I will have to start again or a new game after all.
    This file does not exist in my folder.

  12. #32

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    It does, because the script creates it. Go to C:\Program Files (x86)\Steam\steamapps\common\Total War Rome II\major_log.txt

  13. #33

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    The peace wouldn't last long. They just go to war again as soon as they can, if they hate each others. The AI routine basically goes "if not at war, randomly declare war on a faction you hate".
    Is there any way to add relation bonus when they make peace treaty?

  14. #34

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    I thought about it. The DeI team uses this line to make Rome and Carthage enemies:
    scripting.game_interface:cai_strategic_stance_manager_promote_specified_stance_towards_target_faction("rom_carthage", "rom_rome", "CAI_STRATEGIC_STANCE_BITTER_ENEMIES")
    So I assume there must be a way to use the same line to make factions friends. Unfortunately I do not know what the other cai stances than BITTER_ENEMIES are; the Attila scripting guide doesn't tell us, and I had no luck finding anything when searching for it.

  15. #35

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Quote Originally Posted by Litharion View Post
    force_change_cai_faction_personality(faction:name(), "cai_personalities_table_key");
    I see, thanks. Unfortunately I don't know which ones are allowed for which factions. And I don't know which of those would make them more or less aggressive. The options seem rather limited. I can see that for example gaul minor seems to have a few options, from friendly to warlike. But others do not.

  16. #36

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    Quote Originally Posted by CIaagent11 View Post
    It does, because the script creates it. Go to C:\Program Files (x86)\Steam\steamapps\common\Total War Rome II\major_log.txt
    Seriously, this file does not exist for me.

  17. #37

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    News from the front...
    Somehow this still does not really work for me. The Eblani and also before the Demetae landed in Spain. See the screenshot.
    I noticed that I had an alliance with both of them, but I did not ask for help. The AI independently declared war on Carthage. One would have to forbid the AI to declare haphazard wars. In my current game, Carthage is at war with the half card. Factions from Britain, with Illyrer, with Knossos and I still know everything. It is one thing to declare war on a faction, but what else can send armies there? The Breuci have at one time 4 regions ripped off by the Lusitani not to mention. If there were not every now and then revolts where it would be "normalize" halfway, it would look bad. And as it looks like, not much happens at the Lusitani and the Breuci.
    What comes to mind when I looked at the script again. Could not you tell the fractions about the script when to attack who? That works with the reforms and with the money too. Only as an idea ...

    Last edited by Sedulus; November 25, 2017 at 10:55 AM.

  18. #38

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    I put up a new file, try that. But I dont think it changes much. Other than that, the battle effects just sometimes dont take effect. It would probably be way easier to just tell the AI to be less aggressive via cai policies, but I don't know how to mod that.

  19. #39

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    And what have you changed in the file now?

  20. #40

    Default Re: [Submod] Peace Treaty Script (Realistic Expansion) *testers appreciated*

    The check whether pending battle combatants are in enemy territory works now, even if they have been there for just one turn, meaning that bonuses get applied properly. Other than that some rewriting that makes the code prettier, but doesn't really change functionality so much. Oh, and there is an attrition functionality now for factions that are overexpanded by more than one settlement. There is no harm in updating, t is perfectly save game compatible.

Page 2 of 7 FirstFirst 1234567 LastLast

Tags for this Thread

Posting Permissions

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