Victoria 3

Victoria 3

Grey's Subject Interaction Suite
Dimi 15 Sep @ 12:30pm
Increase convoy distribution spam debug
I am not very familiar with the vicky 3 modding, so my solution may be incorrect, but it appears to work for me.

In regards to the AI loop of establishing and breaking the increase convoys pact. I did some tweaking of the script and ended up on a solution that doesn't do it, while still appearing to work correctly.


Below is the modified AI block for `yMoG_S10_offer_convoy_contributions.txt`
The main changes were:
- changing most of the `scope:actor` to `scope:target_country` inside the relationship and attitude checks.
- Adding a will_propose block that is the inverse of will_break, so the propose score doesn't fire during very bad relations.
- Adding a -1000 modifier if the excess capacity will be left under 10% margin, after the pact.

ai = { evaluation_chance = { value = 10 } propose_score = { ### Base Value value = 300 if = { limit = { excess_convoy_surplus_percent <= 0.4 # Must maintain at least 10% surplus after giving away 30% } add = -1000 } ### Attitude Impact if = { limit = { has_attitude = { who = scope:target_country attitude = aloof } } add = -100 } if = { limit = { has_attitude = { who = scope:target_country attitude = defiant } } add = -300 } if = { limit = { has_attitude = { who = scope:target_country attitude = rebellious } } add = -500 } ### Liberty Desire Impact if = { limit = { liberty_desire > 85 } add = -350 } else_if = { limit = { liberty_desire > 75 } add = -300 } else_if = { limit = { liberty_desire > 65 } add = -250 } else_if = { limit = { liberty_desire > 55 } add = -200 } else_if = { limit = { liberty_desire > 45 } add = -150 } else_if = { limit = { liberty_desire > 35 } add = -100 } else_if = { limit = { liberty_desire > 25 } add = -50 } ### Relations Impact if = { limit = { "relations(scope:target_country)" >= relations_threshold:friendly } add = 100 } else_if = { limit = { "relations(scope:target_country)" >= relations_threshold:amicable } add = 50 } else_if = { limit = { "relations(scope:target_country)" >= relations_threshold:cordial } add = 0 } else_if = { limit = { "relations(scope:target_country)" >= relations_threshold:neutral } add = -50 } else_if = { limit = { "relations(scope:target_country)" <= relations_threshold:poor } add = -100 } else_if = { limit = { "relations(scope:target_country)" <= relations_threshold:cold } add = -150 } else_if = { limit = { "relations(scope:target_country)" <= relations_threshold:hostile } add = -200 } } will_propose = { excess_convoy_surplus_percent > 0.4 # Has enough convoys to give away "relations(scope:target_country)" >= relations_threshold:hostile NOR = { has_attitude = { who = scope:target_country attitude = rebellious } has_attitude = { who = scope:target_country attitude = defiant } } liberty_desire <= 85 } will_break = { OR = { has_attitude = { who = scope:target_country attitude = rebellious } liberty_desire > 85 "relations(scope:target_country)" <= relations_threshold:hostile } } }


It shouldn't do anything differently from the original, but I also modified the `MoG_12_convoys.txt` a bit during the process I was tweaking things. Here is the modified code for reference, if it is needed.

# We are using this to identify when a country can afford to give away 30% of its convoy production. # Percentage difference between total convoys available and total convoys required, without accounting for Offer Convoys pact. excess_convoy_surplus_percent = { # Country's own requirements add = { add = num_convoys_required min = 1 } # Total number of convoys the country is sending to the market add = { # Country's convoy contribution to marked owner (if the offer convoys pact is active, it will be inflated by 30%) add = { add = modifier:country_convoy_contribution_to_market_owner_add # Correction for inflated convoys modifier value by offer convoys. if = { limit = { num_diplomatic_pacts = { type = occ_offer_convoys value >= 1 } } add = -0.3 } } multiply = num_convoys_available } # Calculate total usage of convoys as a percentage 0-1 divide = { add = num_convoys_available # Result is 0.7 or lower if has enough to give away. min = 1 } # We have currently calculated **usage** as a % multiply = -1 add = 1 # (1-usage)=[surplus as proportion of total] (which must be >0.3) }
Last edited by Dimi; 15 Sep @ 12:32pm
< >
Showing 1-3 of 3 comments
MasterOfGrey  [developer] 15 Sep @ 7:18pm 
Thank you! I'll have a look through this and work things out. :)
MasterOfGrey  [developer] 15 Sep @ 9:12pm 
Well you definitely broke the script value, so I'm impressed you got it to behave otherwise...

The will_propose is kinda hamfisted - but you're right in that it should have a will_propose block...

Yeah ok, pretty much the only reason this works is because of the relations fix to use "relations(scope:target_country)", which was my bad, and then you've limited it to the point where they have masses of excess convoys...
Dimi 16 Sep @ 3:19pm 
Welp, figures it broke something. Couldn't actually get a clear view on the script values while the game was running, if that is even possible, so it was mostly trial and error.

Hope it helps as starting point tho.
< >
Showing 1-3 of 3 comments
Per page: 1530 50