Page 4 of 4 FirstFirst 1234
Results 61 to 73 of 73

Thread: Problem with "add_settlement_turmoil" command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,494

    Default Re: Problem with "add_settlement_turmoil" command

    Guys, so I've rewritten the script in such a way:
    Code:
       monitor_event SettlementSelected TrueCondition
    
    		if I_EventCounter faction_turn_poland == 1 				
    			if not I_IsFactionAIControlled poland
    
    
    				if I_TurnNumber == 0 									; if player doesn't select any settlement, there should be a simple fall-back solution introduced
    				and I_EventCounter POLAND0_STARTING_INFO < 1
    					;------------------------------------- log POLAND	
    					disable_cursor
    					hide_ui
    					zoom_strat_camera 1
    					campaign_wait 0.2
    					move_strat_camera 214, 216
    					campaign_wait 1
    					ui_flash_stop
    					show_ui
    					enable_cursor
    					campaign_wait 0.2
    					historic_event POLAND0_STARTING_INFO
    				end_if
    
    
    				if I_TurnNumber == 1 									; if player doesn't select any settlement, there should be a simple fall-back solution introduced
    				and I_EventCounter POLAND1_REFORMS_INFO < 1
    					;------------------------------------- log POLAND	
    					disable_cursor
    					hide_ui
    					zoom_strat_camera 1
    					campaign_wait 0.2
    					move_strat_camera 214, 216
    					campaign_wait 1
    					ui_flash_stop
    					show_ui
    					enable_cursor
    					campaign_wait 0.2
    					historic_event POLAND1_REFORMS_INFO
    				end_if
    
    
    				if I_TurnNumber > 1 									; if player doesn't select any settlement, there should be a simple fall-back solution introduced
    				and I_EventCounter INFO_SPHERES_OF_INFLUENCE < 1				
    					;------------------------------------- log POLAND	
    					disable_cursor
    					hide_ui
    					zoom_strat_camera 1
    					campaign_wait 0.2
    					move_strat_camera 219, 212
    					point_at_settlement Krakow
    					campaign_wait 1
    					move_strat_camera 199, 214
    					point_at_settlement Wroclaw
    					campaign_wait 1
    					move_strat_camera 194, 222
    					point_at_settlement Poznan
    					campaign_wait 1
    					move_strat_camera 207, 236
    					point_at_settlement Gdansk
    					campaign_wait 1
    					move_strat_camera 226, 224
    					point_at_settlement Plock
    					campaign_wait 1
    					move_strat_camera 214, 216			
    					campaign_wait 1
    					ui_flash_stop
    					show_ui
    					enable_cursor
    					campaign_wait 0.2
    					historic_event INFO_SPHERES_OF_INFLUENCE
    					terminate_monitor			
    				end_if
    				
    			end_if
            end_if
    I've started the game a few times. The outcome is very strange. Sometimes, all the three parts will fire as they're coded: the first one when I click on a settlement in turn 1, the second - click on a settlement in turn 2, and the third - click on a settlement in turn 3.
    But: many times it's true only for the first and second cases, while the third fires sometime time earlier, at the beginning of the player's turn: once the Slave turn is over, I see the camera moving and the settlements highlighted, then the information window popping out (actually, the window info on offering a general pops-out first so the map is not fully visible - the pop-out window is).
    And also many times it was true only for the first case, with the second and third as just described.

    So the monitor is at times triggered without selecting settlement by me. Something must have fired the monitor earlier. What it is?

  2. #2

    Default Re: Problem with "add_settlement_turmoil" command

    Are you using the 'select_settlement' or 'e_select_settlement' commands anywhere in script? That's my only guess, somehow the SettlementSelected event is happening without user input.

  3. #3
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,494

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Callistonian View Post
    Are you using the 'select_settlement' or 'e_select_settlement' commands anywhere in script? That's my only guess, somehow the SettlementSelected event is happening without user input.
    not in a single place in the script.txt
    I've got only a few similar to "monitor_event SettlementSelected SettlementName Santiago"

    I'll try using "monitor_event SettlementSelected SettlementIsLocal" - maybe this would help.
    EDIT: it didn't.

    It looks like sometimes a settlement is selected by the engine at the beginning of the player's move (after PreFaction, but before you start doing something). Could it be an AI spy being in a settlement (not a player's for Poland doesn't have such)?

    --------------------------------------

    Nevertheless, I wonder why both EBII and 1618 do not use monitor "SettlementSelected", hmmm.
    Maybe there's a fundamental problem with this event?

    The I've seen in another script
    monitor_event SettlementSelected I_SettlementSelected Jerusalem
    and not I_SettlementOwner Jerusalem = normans
    So one use SettlementName but I_SettlementSelected ?
    Last edited by Jurand of Cracow; March 13, 2022 at 07:16 AM.

  4. #4

    Default Re: Problem with "add_settlement_turmoil" command

    Ruling out those script commands, it must be something else selecting those settlements without user input. Settlements don't get selected by default at the start of a human faction's turn. I tested your script from post #61 in my mod and it works as expected but with the important caveat that my mod currently has all recruitment (including spies) disabled.

    It certainly looks like the settlement gets selected when the AI puts a spy in it, but I'm trying to remember if that happens right when the spy enters during the AI's turn or at the start of your turn. Doesn't that also happen when you kill the spy? If these events happen at the start of the player's turn, and it does trigger SettlementSelected, then that would explain everything. It would explain why you get different results on different test runs because the state of the map is slightly different each time and the AI is making a different decision whether or not to send in a spy.

    ----

    Again, there's never a reason to use I_ conditions as event conditions. That script should be:

    Code:
    monitor_event SettlementSelected TrueCondition
       if I_SettlementSelected Jerusalem
       and not I_SettlementOwner Jerusalem = normans
    ...
    which gives the same results.

  5. #5

    Default Re: Problem with "add_settlement_turmoil" command

    When a turn ends and a settlement is selected, then SettlementSelected fires at (/around) the beginning of the next turn.

    Nevertheless, I wonder why both EBII and 1618 do not use monitor "SettlementSelected", hmmm.
    I use it in eb2 without problems.

  6. #6

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Erken View Post
    When a turn ends and a settlement is selected, then SettlementSelected fires at (/around) the beginning of the next turn.
    This is probably the correct answer. If you leave a settlement selected when you end the turn, it will still be selected at the start of the next turn. Presumably, it doesn't stay selected during the AI turns, but gets re-selected sometime around the beginning of the next player turn. I didn't realize this because my mod's campaign is in hotseat and this settlement re-selection only happens in single player campaign mode. This explains why Jurand is seeing different results on different test runs - sometimes he left a settlement selected at the end of the turn and sometimes he didn't.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Problem with "add_settlement_turmoil" command

    We never had the need for that event in 1648.










  8. #8

    Default Re: Problem with "add_settlement_turmoil" command

    Hi, I see this is a correct thread to post a problem with the turmoil command:

    I use this script in y mod to make a settlement have a little rebellion.

    Code:
        monitor_event FactionTurnStart FactionType papal_states
            and I_TurnNumber = 2  ;10;(1256 DC)
            and I_SettlementOwner Acre = papal_states
            and I_CompareCounter saint_sabas = 0
    
    
            set_counter saint_sabas 1
    
    
            add_events
                event fire    
                date 0
                position 199, 152       ; Acre
            end_add_events
    
    
            console_command add_money papal_states -3000
            console_command add_population Acre -1000        
            console_command set_building_health Acre castle_port c_port 50
            console_command add_settlement_turmoil Acre 10
    
    
            historic_event SAINT_SABAS
    
    
            terminate_monitor
        end_monitor
    and when turn start, basically the smoke appear, the population decrease but the money and the damage commands dont work properly, this is my error log:

    Code:
    18:27:31.201 [game.script] [error] Script execution error for <console_command>, at line 65, in mods/TSTW/data/world/maps/campaign/custom/the_mongol_invasion/campaign_script.txt: add_money papal_states -3000
    err: faction type not recognised
    
    
    18:27:31.201 [game.script] [error] Script execution error for <console_command>, at line 68, in mods/TSTW/data/world/maps/campaign/custom/the_mongol_invasion/campaign_script.txt: 
    add_settlement_turmoil Acre 10
    err: command not recognised (use ? for help).
    To make more strange my building the castle port, is 100% damaged not 50%, someone can help me?

    See more about Tierra Santa TW and other projects in Discord
    Join the official Discord server of the mod: https://discord.gg/u6VFKgDzpX
    Download TSTW here: https://www.moddb.com/mods/tierra-santa-tw-mod
    Rise of Quetzal TW (WIP) in https://www.moddb.com/mods/rise-of-quetzal-tw

  9. #9
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,494

    Default Re: Problem with "add_settlement_turmoil" command

    I think it's "add_settlement_turmoil" without "console_command" (but maybe both can go?)
    Then there might be another command giving Acre that "turmoil" - and if it happens later, it will overwrite the previous.

    Same with money - perhaps doesn't need "console_command".

    for the building damage I use "console_command set_building_health Acre core_castle_building 10", ie only the building branch name, without specifying the concrete one.

  10. #10

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Jurand of Cracow View Post
    I think it's "add_settlement_turmoil" without "console_command" (but maybe both can go?)
    Then there might be another command giving Acre that "turmoil" - and if it happens later, it will overwrite the previous.

    Same with money - perhaps doesn't need "console_command".

    for the building damage I use "console_command set_building_health Acre core_castle_building 10", ie only the building branch name, without specifying the concrete one.
    Hi Jurand,

    Thanks for your help, I try to change the script:

    Code:
        monitor_event FactionTurnStart FactionType papal_states
            and I_TurnNumber = 2  ;10;(1256 DC)
            and I_SettlementOwner Acre = papal_states
            and I_CompareCounter saint_sabas = 0
    
    
            set_counter saint_sabas 1
    
    
            add_events
                event fire    
                date 0
                position 199, 152       ; Acre
            end_add_events
    
    
            add_money papal_states -3000
            console_command add_population Acre -1000        
            console_command set_building_health Acre castle_port 25
            console_command set_building_health Acre core_castle_building 75
            console_command add_settlement_turmoil 5
    
    
            historic_event SAINT_SABAS
    
    
            terminate_monitor
        end_monitor
    Spoiler Alert, click show to read: 




    add_money papal_states -3000 <----------------------------------WORK
    console_command add_population Acre -1000 <----------------------------------WORK
    console_command set_building_health Acre castle_port 25 <----------------------------------WORK
    console_command set_building_health Acre core_castle_building 75 <----------------------------------WORK
    console_command add_settlement_turmoil 5 <----------------------------------DONT WORK

    Log error says:

    Code:
    20:09:28.179 [game.script] [error] Script execution error for <console_command>, at line 69, in mods/TSTW/data/world/maps/campaign/custom/the_mongol_invasion/campaign_script.txt: 
    add_settlement_turmoil 5
    err: command not recognised (use ? for help).
    Maybe the turns or turmoil are so low? dont understand why not working the code line.
    Last edited by Werety; March 15, 2022 at 02:23 PM.

    See more about Tierra Santa TW and other projects in Discord
    Join the official Discord server of the mod: https://discord.gg/u6VFKgDzpX
    Download TSTW here: https://www.moddb.com/mods/tierra-santa-tw-mod
    Rise of Quetzal TW (WIP) in https://www.moddb.com/mods/rise-of-quetzal-tw

  11. #11

    Default Re: Problem with "add_settlement_turmoil" command

    Just remove console_command, add_settlement_turmoil is a normal command. The settlement name is also lacking, it should be:
    Code:
    add_settlement_turmoil Acre 5
    Last edited by Erken; March 15, 2022 at 02:46 PM.

  12. #12

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Erken View Post
    Just remove console_command, add_settlement_turmoil is a normal command. The settlement name is also lacking, it should be:
    Code:
    add_settlement_turmoil Acre 5
    Now works apparently, well, log error dont say anything strange, I suppose the turmoil expand for 5 turns and make a little of noise, but dont see a lot of change, maybe I write some bad? How can redux more the public order?

    See more about Tierra Santa TW and other projects in Discord
    Join the official Discord server of the mod: https://discord.gg/u6VFKgDzpX
    Download TSTW here: https://www.moddb.com/mods/tierra-santa-tw-mod
    Rise of Quetzal TW (WIP) in https://www.moddb.com/mods/rise-of-quetzal-tw

Page 4 of 4 FirstFirst 1234

Posting Permissions

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