How to stop units from being ejected from territory when declaring war

TC_

Chieftain
Joined
Jul 8, 2017
Messages
77
I think it's absurd that military units are removed from an opposing civs territory if you declare war against them. Would it be possible to change this through current modding access?
 
not easily, you'll have to track every unit position and restore it if needed after a declaration of war (ie a mod can't prevent them to be removed with the actual tools, but could move them back to their original position)
 
  • Like
Reactions: TC_
Sounds like a function of the game, so probably LUA that handles that?

Hasn't this been a feature of the game for years though? To prevent the user from just getting an open border, marching directly up to a capital, surrounding it and then declare/capture/win? I think it's one of those functions that reminds you "hey, this is a game and we gotta make you work for it".
 
Thanks Gedemon. I considered that as a possible solution, but was hoping there was something more simple that I wasnt seeing. That's way too much work for this issue.

Hey ambelgra - As a primarily multiplayer player, i don't like it working this way, feature or not. I think if someone is dumb enough to grant open borders and allow their cities to be surrounded, then they deserve an early exit.:) I do see how it could be used to take advantage of the AI, but that would just be one more thing in a long list.
 
They won't be ejected if they have the Modifier that lets the unit ignore closed borders. If you can somehow apply that Modifier immediately before the war declaration they'll stay put. That could be sort of tricky to pull off... possible a dummy building that is added and removed at the correct time could pull it off.

Something like this used to be part of my Combined Tweaks mod as a thing for Norway, before Rise and Fall semi-broke the ability. Here's the unit Modifier and the player-level Modifier that used to attach it to Harald.

Code:
INSERT INTO Modifiers
    (ModifierId,     ModifierType,     RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('QUO_MOD_BOATS_IGNORE_BORDERS',     'MODIFIER_PLAYER_UNIT_ADJUST_ENTER_FOREIGN_LANDS', 0, 0, NULL, NULL) ;


INSERT INTO ModifierArguments
    (ModifierId,             Name,         Type,             Value,             Extra,     SecondExtra)
VALUES    ('QUO_MOD_BOATS_IGNORE_BORDERS',     'Enter',     'ARGTYPE_IDENTITY',     '1',            NULL,     NULL) ;

-- Modifier 2 for the application
INSERT INTO Modifiers
    (ModifierId,     ModifierType,     RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('QUO_MOD_BOATS_IGNORE_BORDERS_2',     'MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER', 0, 0, NULL, 'REQUIREMENTS_UNIT_SEA_DOMAIN') ;


INSERT INTO ModifierArguments
    (ModifierId,             Name,         Type,             Value,             Extra,     SecondExtra)
VALUES    ('QUO_MOD_BOATS_IGNORE_BORDERS_2',     'ModifierId',     'ARGTYPE_IDENTITY',     'QUO_MOD_BOATS_IGNORE_BORDERS',            NULL,     NULL) ;


INSERT INTO TraitModifiers
    (TraitType,             ModifierID)
VALUES    ('TRAIT_LEADER_MELEE_COASTAL_RAIDS',    'QUO_MOD_BOATS_IGNORE_BORDERS_2') ;
 
  • Like
Reactions: TC_
Back
Top Bottom