Results 1 to 5 of 5

Thread: Moving generals between factions

  1. #1

    Default Moving generals between factions

    Hello.

    Can anyone please tell me if there is a way to give a faction's generals/armies/characters overall to another faction via script? I am aware that there is a "give_everything_to_faction" command but, though I haven't tested it yet, I assume it transfers everything from a faction to another, instead of allowing me to decide which things are tranferred.

    My goal is to make one specific general and one city switch factions (with their armies, if possible). What is the best way to accomplish this? What do you suggest?

  2. #2
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Moving generals between factions

    I think you should ask the question in this section of the forum: https://www.twcenter.net/forums/foru...-and-Scripting.

    Reading this the Baron's Alliance script comes to mind.

  3. #3

    Default Re: Moving generals between factions

    If the "to" faction is the human-controlled faction in a single player campaign, then you can simply use 'console_command capture_settlement settlement_name'. Any units that were formerly in the settlement will pop outside to the south. If the "to" faction is AI-controlled, then you can still use capture_settlement with a bit of scripting but only if your campaign is in hotseat mode (need to use the 'control' console command which only works in hotseat). If the "to" faction is AI-controlled and the campaign is in single player mode, then your best bet is probably to emerge a dummy faction at a settlement with low public order and then use give_everything. Aside from needing a dummy faction, the main limitation with this method is that you're not 100% guaranteed to transfer the correct region, but it's pretty unlikely for the script to transfer the wrong region. There are other ways to transfer regions between factions (e.g. forced diplomacy, shadow revolts) but they're probably not what you're looking for.

    As for transferring the character, you may be able to get them to revolt to a shadow faction by giving them 0 Loyalty and everyone else 10 Loyalty and perhaps temporarily reducing the faction leader authority to 1 or something like that. But I think this will be very approximate and I'm not actually sure that individual characters will revolt to shadow factions instead of slave (Jadli knows more about this). I would suggest that the easiest way to transfer a character between factions is to not transfer him at all but simply to kill him or send him off the map and then spawn a replacement with the same name, portrait, BG, traits, etc. for the "to" faction. You can even assign him the correct age by checking the turn number or a counter that's tracking how long since the original character spawned. The issue with this is that you have to pick arbitrary coordinates on the map to spawn the replacement character unless you somehow know precisely where the original character was standing beforehand. As with transferring regions, there are technically more mechanisms for transferring characters (e.g. cardinal promotion) but I don't think they will help you.

  4. #4

    Default Re: Moving generals between factions

    Quote Originally Posted by Callistonian View Post
    If the "to" faction is the human-controlled faction in a single player campaign, then you can simply use 'console_command capture_settlement settlement_name'. Any units that were formerly in the settlement will pop outside to the south. If the "to" faction is AI-controlled, then you can still use capture_settlement with a bit of scripting but only if your campaign is in hotseat mode (need to use the 'control' console command which only works in hotseat). If the "to" faction is AI-controlled and the campaign is in single player mode, then your best bet is probably to emerge a dummy faction at a settlement with low public order and then use give_everything. Aside from needing a dummy faction, the main limitation with this method is that you're not 100% guaranteed to transfer the correct region, but it's pretty unlikely for the script to transfer the wrong region. There are other ways to transfer regions between factions (e.g. forced diplomacy, shadow revolts) but they're probably not what you're looking for.

    As for transferring the character, you may be able to get them to revolt to a shadow faction by giving them 0 Loyalty and everyone else 10 Loyalty and perhaps temporarily reducing the faction leader authority to 1 or something like that. But I think this will be very approximate and I'm not actually sure that individual characters will revolt to shadow factions instead of slave (Jadli knows more about this). I would suggest that the easiest way to transfer a character between factions is to not transfer him at all but simply to kill him or send him off the map and then spawn a replacement with the same name, portrait, BG, traits, etc. for the "to" faction. You can even assign him the correct age by checking the turn number or a counter that's tracking how long since the original character spawned. The issue with this is that you have to pick arbitrary coordinates on the map to spawn the replacement character unless you somehow know precisely where the original character was standing beforehand. As with transferring regions, there are technically more mechanisms for transferring characters (e.g. cardinal promotion) but I don't think they will help you.
    Thank you very much for the detailed suggestions. I'll try and see which suits me better. I'll probably need to use capture_settlement command and respawn the general to the correct faction. Age won't be a problem because this is supposed to happen at a fixed point in time, so his age is known beforehand.
    Last edited by es157; May 14, 2021 at 07:10 AM.

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Moving generals between factions

    Sending a character off map and then respawning him for a another faction will preserve traits\anc\age - caveat is that you need to know the name. And it has never been tried before so no guarantee that it will actually work. You most certainly will need to use a label to make sure there is no mix up.










Posting Permissions

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