Results 1 to 11 of 11

Thread: Starting with two characters in the same settlement

  1. #1

    Default Starting with two characters in the same settlement

    As some of you know, I'm doing a reworking on a Game of Thrones mod and therefore I'm frequently venturing into unexplored modding territory. For some time now, I have been struggling to find a way to keep two characters, namely Tommen Baratheon and Cersei Lannister, inside the city of King's Landing and unable to leave for most of the campaign.

    Most of this was easy to do. I gave them traits to remove all their movement points, placed Tommen in the city's tile and Cersei nearby. Then when the game starts, I use a script to give Cersei a few movement points and use the "move" command to make her enter King's Landing and stay there for the rest of the game.

    The problem I'm encountering is the following: using the "move" command apparently only works if I am playing as the faction whose character I want to move. If the faction is controlled by the AI, the command will do nothing and Cersei will not enter the city, even though she keeps wandering around it in circles at the AI's will. For a starter, I have checked that the city has enough empty garrison slots left.

    Now does anyone know of an alternative method to accomplish my goal that I'm not aware of? I'm 99% sure that "move_character" would not be a good solution for all the bugs it comes with when the target tile is not an open field.

  2. #2
    Gigantus's Avatar You should always listen to your inner voice! - Agreed, but which one?
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    50,343
    Blog Entries
    29

    Default Re: Starting with two characters in the same settlement

    You will have to move Cersei at CharacterTurnStart of the faction and then give her the no movement trait.

    Code:
    monitor_event CharacterTurnStart FactionType [faction]
       console_command move_character [label] [co-ordinates]
       wait 1   ; allows for the movement period
       console_command give_trait [label] [trait]
       terminate_monitor
    end_monitor




  3. #3

    Default Re: Starting with two characters in the same settlement

    Quote Originally Posted by Gigantus View Post
    You will have to move Cersei at CharacterTurnStart of the faction and then give her the no movement trait.

    Code:
    monitor_event CharacterTurnStart FactionType [faction]
       console_command move_character [label] [co-ordinates]
       wait 1   ; allows for the movement period
       console_command give_trait [label] [trait]
       terminate_monitor
    end_monitor
    But won't there be problems from using the console command?

    If I can use it, why even bother with giving the static trait through script? I could give it in descr_strat, no?

  4. #4
    Gigantus's Avatar You should always listen to your inner voice! - Agreed, but which one?
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    50,343
    Blog Entries
    29

    Default Re: Starting with two characters in the same settlement

    Some commands can only be given by using the 'console_command' prefix - it won't cause an issue in the script.
    You first have to move the character before you can give the static trait, hence you can't give it in descr_strat already.




  5. #5

    Default Re: Starting with two characters in the same settlement

    The MovementPoints attribute can only ever be between -19 & +20, so "removing all their movement points" by traits is not technically a thing, it will only ever decrease it by 95% (19 * 5%). Depending on the base movement range for a character (starting_action_points in descr_character) there might be enough left to walk a single tile per turn. The threshold should be somewhere around 200 starting_action_points, anything above that would result in characters being able to move at least one regular tile.

    You also might wanna experiment with the mp console command: console_command mp [label] -1

    Regarding the move command, it works during your turn, even for other factions, so you could do:

    Code:
    monitor_event FactionTurnStart
        move [label], 100, 100
    terminate_monitor
    end_monitor
    Last edited by Serious Potato; June 18, 2021 at 11:16 AM.

  6. #6

    Default Re: Starting with two characters in the same settlement

    Quote Originally Posted by Gigantus View Post
    Some commands can only be given by using the 'console_command' prefix - it won't cause an issue in the script.
    You first have to move the character before you can give the static trait, hence you can't give it in descr_strat already.
    No, I mean, the move_character command causes a bug when you try to move the character into a settlement. I just tried it again and got the bug again. The character doesn't enter the settlement, but rather stands on top of it as if the tile was an open field.

  7. #7

    Default Re: Starting with two characters in the same settlement

    Quote Originally Posted by Serious Potato View Post
    The MovementPoints attribute can only ever be between -19 & +20, so "removing all their movement points" by traits is not technically a thing, it will only ever decrease it by 95% (19 * 5%). Depending on the base movement range for a character (starting_action_points in descr_character) there might be enough left to walk a single tile per turn. The threshold should be somewhere around 200 starting_action_points, anything above that would result in characters being able to move at least one regular tile.

    You also might wanna experiment with the mp console command: console_command mp [label] -1

    Regarding the move command, it works during your turn, even for other factions, so you could do:

    Code:
    monitor_event FactionTurnStart
        move [label], 100, 100
    terminate_monitor
    end_monitor
    Yeah, I did notice that thingy, but it is no longer a problem since none of my characters have 200 mp in base.

    I'm fairly sure I have tried using the move command in AI factions before and failed. But I'll give it another try.

    Update: As far as my testing results go, the "move" command line does absolutely nothing to the AI factions. It only works if I am playing as the target faction. Any ideas on this?
    Last edited by es157; June 18, 2021 at 02:41 PM.

  8. #8

    Default Re: Starting with two characters in the same settlement

    So no more ideas?

  9. #9

    Default Re: Starting with two characters in the same settlement

    The move command does work on AI factions, and as far as I know you can use it at any time whether during the human's or AI's turn, but it won't do anything if there is another character in the residence already. You can only use it to move single AI characters into empty residences. You can, however, use it to move as many of the player's characters as you want into a residence so you can use the control command (in hotseat) to move multiple AI characters into residence.

    Code:
    monitor_event PreFactionTurnStart TrueCondition   ;start of turn 0
    
       if I_IsFactionAIControlled venice
          set_event_counter venice_is_ai 1
          console_commmand control venice   ;switch venice to human control
       end_if
       move cercei_label_1, x, y   ;if venice is already human, we don't need to switch control
       move tomen_label_1, x, y
       if I_EventCounter venice_is_ai == 1   ;if venice is supposed to be AI-controlled in this campaign, switch them back
          console_command control venice
       end_if
    
       ;... do whatever other campaign setup you need to do at the start of turn 0
    
       terminate_monitor
    end_monitor
    To answer some earlier questions: you definitely don't want to use move_character to move a character into residence. As you already know, they won't actually move into residence but will bug out on top and possibly become unmovable from that position. Tangential to this point - script commands and console commands are different things. For single player I guess it's fair to say that the only difference is that console commands must be prefixed with "console_command" in campaign_script, but if you want to use my solution above or otherwise ever have your mod be playable in hotseat mode, then you will find there is a big difference between script commands and console commands. Namely, most hotseaters password-lock the console which kills all console commands in script. There are script solutions for this but that's the subject of another thread.

    As for locking characters in place, I definitely recommend using the mp console command as Serious Potato said. Large settlements probably have roads or can be upgraded to have roads and road bonuses are liable to get your characters over 0 and let them start walking around the map 1 tile at a time. The mp command kills that movement entirely and can be issued continuously every CharacterTurnStart or whenever is most appropriate.
    Last edited by Callistonian; June 21, 2021 at 10:41 PM.

  10. #10

    Default Re: Starting with two characters in the same settlement

    Quote Originally Posted by Callistonian View Post
    The move command does work on AI factions, and as far as I know you can use it at any time whether during the human's or AI's turn, but it won't do anything if there is another character in the residence already. You can only use it to move single AI characters into empty residences. You can, however, use it to move as many of the player's characters as you want into a residence so you can use the control command (in hotseat) to move multiple AI characters into residence.

    Code:
    monitor_event PreFactionTurnStart TrueCondition   ;start of turn 0
    
       if I_IsFactionAIControlled venice
          set_event_counter venice_is_ai 1
          console_commmand control venice   ;switch venice to human control
       end_if
       move cercei_label_1, x, y   ;if venice is already human, we don't need to switch control
       move tomen_label_1, x, y
       if I_EventCounter venice_is_ai == 1   ;if venice is supposed to be AI-controlled in this campaign, switch them back
          console_command control venice
       end_if
    
       ;... do whatever other campaign setup you need to do at the start of turn 0
    
       terminate_monitor
    end_monitor
    To answer some earlier questions: you definitely don't want to use move_character to move a character into residence. As you already know, they won't actually move into residence but will bug out on top and possibly become unmovable from that position. Tangential to this point - script commands and console commands are different things. For single player I guess it's fair to say that the only difference is that console commands must be prefixed with "console_command" in campaign_script, but if you want to use my solution above or otherwise ever have your mod be playable in hotseat mode, then you will find there is a big difference between script commands and console commands. Namely, most hotseaters password-lock the console which kills all console commands in script. There are script solutions for this but that's the subject of another thread.

    As for locking characters in place, I definitely recommend using the mp console command as Serious Potato said. Large settlements probably have roads or can be upgraded to have roads and road bonuses are liable to get your characters over 0 and let them start walking around the map 1 tile at a time. The mp command kills that movement entirely and can be issued continuously every CharacterTurnStart or whenever is most appropriate.
    So the only possible way to have two characters start at the same settlement is using hotseat? Lol, really? Such a seemingly simple thing. Yeah, I noticed the command works fine when I am playing as the faction in question, but it does nothing when it's the AI. Going by what you said, this is probably because the city already has a garrison.

    I guess the only thing I can do is make a script that causes the character to become static once it willingly enters the city, if it ever happens.

    (Having to always use hotseat and switch factions twice in a turn for this is not very viable, so...)

    But in any case, it is good to know this so that I can drop the idea already Thanks.

  11. #11

    Default Re: Starting with two characters in the same settlement

    If you want the character to merge into the settlement at the start of the campaign, you can probably use the AI. You could try creating a dummy AI label (descr_campaign_ai_db.xml) with defend_normal or defend_deep attitudes as their only possible decision. Check if this makes them move all their characters into the nearest settlement and make sure this is reliable in a number of tests playing as number of different factions. If it works reliably, set up a script to lock the character in place using mp -1 when they end their turn in the settlement for the first time. Also, don't forget to switch the faction's AI label back to something more reasonable at some point.
    Last edited by Callistonian; June 24, 2021 at 10:28 AM.

Posting Permissions

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