Results 1 to 4 of 4

Thread: Scripting political influence

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Scripting political influence

    Is it possible to get the value of your political influence in a script, and then according to this value, decrease public order and the number of allowed edicts, armies, navies, agents, and increase the corruption?

    What are the files? Does it exist a list of the possible commands?


    Creator of Geomod: a tool for M2TW mapping.

  2. #2

    Default Re: Scripting political influence

    The closest thing we have to documentation is this.

    It's something, but it's not much - there's a lot of guessing involved when you have no idea of what arguments a function takes, and what they'd mean.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  3. #3
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: Scripting political influence

    You can get imperium, thats about the closest thing to what you want sadly.

    These are all of the variables you can pull from any given faction, not neccessarily everything you can get that encompases a whole factions context though:
    Spoiler Alert, click show to read: 

    Code:
            trade_value    function: 58C8B530
    
            character_list    function: 58C886F0
    
            losing_money    function: 58C85890
    
            home_region    function: 58C898F0
    
            trade_route_limit_reached    function: 58C8D110
    
            upkeep_expenditure_percent    function: 58C85910
    
            imperium_level    function: 58C85750
    
            allied_with    function: 58C8B5F0
    
            ancillary_exists    function: 58C89E50
    
            at_war    function: 58C8B430
    
            unused_international_trade_route    function: 58C8C370
    
            military_force_list    function: 58C885B0
    
            tax_level    function: 58C85830
    
            is_human    function: 58C89810
    
            model    function: 58C89790
    
            research_queue_idle    function: 58C85850
    
            trade_resource_exists    function: 58C8B5B0
    
            num_generals    function: 58C85BB0
    
            num_allies    function: 58C8B4F0
    
            treasury_percent    function: 58C85790
    
            new    function: 58C61DC8
    
            culture    function: 58C85870
    
            subculture    function: 58C85B90
    
            state_religion    function: 58C85970
    
            faction_leader    function: 58C89A10
    
            started_war_this_turn    function: 58C89C10
    
            treasury    function: 58C8D050
    
            has_food_shortage    function: 58C85A70
    
            sea_trade_route_raided    function: 58C8CE90
    
            has_faction_leader    function: 58C89AD0
    
            ended_war_this_turn    function: 58C8B450
    
            region_list    function: 58C88610
    
            has_technology    function: 58C859B0
    
            name    function: 58C898B0
    
            trade_ship_not_in_trade_node    function: 58C908B0
    
            trade_value_percent    function: 58C8D090
    
            has_home_region    function: 58C89DF0


    I'd say your next best bet would be to find a variable from the factions characters, but again you're limited in terms of politics variables:
    Spoiler Alert, click show to read: 

    Code:
            offensive_battles_fought    function: 58C88850
    
            battles_won    function: 58C887F0
    
            number_of_traits    function: 58C89090
    
            defensive_naval_battles_fought    function: 58C88DD0
    
            offensive_naval_battles_won    function: 58C88DB0
    
            action_points_remaining_percent    function: 58C879D0
    
            defensive_sieges_won    function: 58C88230
    
            is_carrying_troops    function: 58C87950
    
            age    function: 58C87B90
    
            offensive_sieges_fought    function: 58C88630
    
            garrison_residence    function: 58C87350
    
            has_ancillary    function: 58C87A90
    
            forename    function: 58C87810
    
            is_blockading    function: 58C87A30
    
            performed_action_this_turn    function: 58C87C10
    
            has_trait    function: 58C87930
    
            military_force    function: 58C87330
    
            has_garrison_residence    function: 58C872D0
    
            trait_points    function: 58C878F0
    
            turns_in_enemy_regions    function: 58C87AB0
    
            logical_position_x    function: 58C885F0
    
            is_faction_leader    function: 58C882B0
    
            logical_position_y    function: 58C887B0
    
            offensive_ambush_battles_won    function: 58C89030
    
            character_type    function: 58C87A70
    
            in_port    function: 58C87870
    
            faction    function: 58C85710
    
            battles_fought    function: 58C87A50
    
            defensive_naval_battles_won    function: 58C88DF0
    
            is_male    function: 58C87BF0
    
            has_region    function: 58C870B0
    
            get_forename    function: 58C875D0
    
            body_guard_casulties    function: 58C892F0
    
            offensive_sieges_won    function: 58C884D0
    
            turns_in_own_regions    function: 58C882D0
    
            offensive_battles_won    function: 58C887D0
    
            display_position_y    function: 58C88810
    
            region    function: 58C87530
    
            turns_at_sea    function: 58C88270
    
            routed_in_battle    function: 58C88F90
    
            model    function: 58C93F30
    
            defensive_ambush_battles_fought    function: 58C88E70
    
            cqi    function: 58C89010
    
            is_polititian    function: 58C89190
    
            in_settlement    function: 58C87910
    
            is_ambushing    function: 58C88190
    
            rank    function: 58C88510
    
            has_recruited_mercenaries    function: 58C890D0
    
            defensive_battles_fought    function: 58C888B0
    
            is_hidden    function: 58C891F0
    
            fought_in_battle    function: 58C88750
    
            is_deployed    function: 58C890F0
    
            new    function: 58C61FA8
    
            has_military_force    function: 58C872F0
    
            defensive_sieges_fought    function: 58C884B0
    
            action_points_per_turn    function: 58C87BB0
    
            has_skill    function: 58C88F30
    
            is_embedded_in_military_force    function: 58C890B0
    
            defensive_battles_won    function: 58C88910
    
            defensive_ambush_battles_won    function: 58C88E10
    
            offensive_ambush_battles_fought    function: 58C88E30
    
            won_battle    function: 58C88550
    
            is_besieging    function: 58C879B0
    
            get_surname    function: 58C878B0
    
            offensive_naval_battles_fought    function: 58C88890
    
            percentage_of_own_alliance_killed    function: 58C88730
    
            surname    function: 58C874B0
    
            display_position_x    function: 58C88690
    
            trait_level    function: 58C89110


    Then finally these are the functions you can use to actually do stuff on the campaign, you are once more.. limited.
    Spoiler Alert, click show to read: 

    Code:
    force_rebellion_in_region    function: 58C84910
    
            set_event_generation_enabled    function: 58C85270
    
            join_garrison    function: 58C84B50
    
            remove_visibility_trigger    function: 58C82650
    
            steal_user_input    function: 58C8B210
    
            enable_movement_for_faction    function: 58C84CB0
    
            make_region_seen_in_shroud    function: 58C854B0
    
            remove_time_trigger    function: 58C83490
    
            remove_custom_battlefield    function: 58C825B0
    
            force_add_ancillary    function: 58C849D0
    
            seek_exchange    function: 58C84AF0
    
            instant_set_building_health_percent    function: 58C851F0
    
            add_location_trigger    function: 58C82550
    
            add_restricted_building_level_record    function: 58C82350
    
            make_sea_region_visible_in_shroud    function: 58C8B110
    
            technology_osmosis_for_playables_enable_all    function: 58C844D0
    
            set_campaign_ai_force_all_factions_boardering_humans_to_have_invasion_behaviour    function: 58C82690
    
            leave_garrison    function: 58C84B90
    
            add_exclusion_zone    function: 58C830B0
    
            show_message_event    function: 58C84610
    
            disable_movement_for_character    function: 58C835D0
    
            remove_marker    function: 58C84AD0
    
            make_neighbouring_regions_seen_in_shroud    function: 58C8B070
    
            disable_shopping_for_ai_under_shroud    function: 58C8B230
    
            disable_end_turn    function: 58C84D10
    
            dismiss_advice_at_end_turn    function: 58C84EB0
    
            optional_extras_for_episodics    function: 58C867D0
    
            win_next_autoresolve_battle    function: 58C84F90
    
            set_non_scripted_ancillaries_disabled    function: 58C84B70
    
            take_shroud_snapshot    function: 58C8B090
    
            display_turns    function: 58C8B130
    
            show_shroud    function: 58C83510
    
            load_named_value    function: 58C8B250
    
            add_visibility_trigger    function: 58C824F0
    
            stop_user_input    function: 58C8B170
    
            disable_elections    function: 58C82590
    
            add_development_points_to_region    function: 58C854D0
    
            add_unit_model_overrides    function: 58C844F0
    
            set_public_order_of_province_for_region    function: 58C85470
    
            make_neighbouring_regions_visible_in_shroud    function: 58C8B0D0
    
            add_outline_area_trigger    function: 58C84E70
    
            register_outro_movie    function: 58C845F0
    
            scroll_camera_with_direction    function: 58C83370
    
            force_add_trait    function: 58C84810
    
            set_technology_research_disabled    function: 58C84C30
    
            set_ai_uses_human_display_speed    function: 58C85490
    
            is_new_game    function: 58C8B290
    
            advance_to_next_campaign    function: 58C83450
    
            set_map_bounds    function: 58C825F0
    
            remove_event_restricted_building_record    function: 58C85370
    
            set_ui_notification_of_victory_disabled    function: 58C84C70
    
            zero_action_points    function: 58C85030
    
            enable_ui    function: 58C858F0
    
            add_time_trigger    function: 58C83570
    
            cai_strategic_stance_manager_block_all_stances_but_that_specified_towards_target_faction    function: 58C854F0
    
            trigger_custom_mission    function: 58C830D0
    
            make_son_come_of_age    function: 58C85130
    
            force_diplomacy    function: 58C8B0F0
    
            remove_event_restricted_unit_record    function: 58C85310
    
            register_movies    function: 58C83210
    
            force_assassination_success_for_human    function: 58C84650
    
            remove_barrier    function: 58C82610
    
            cai_strategic_stance_manager_force_stance_update_between_factions    function: 58C85550
    
            save_named_value    function: 58C8B1B0
    
            restore_shroud_from_snapshot    function: 58C83550
    
            cai_strategic_stance_manager_promote_specified_stance_towards_target_faction    function: 58C85510
    
            add_building_model_override    function: 58C8B270
    
            disable_movement_for_faction    function: 58C834B0
    
            remove_building_model_override    function: 58C89C30
    
            trigger_custom_dilemma    function: 58C82FB0
    
            cai_strategic_stance_manager_clear_all_blocking_between_factions    function: 58C855D0
    
            create_force    function: 58C84CF0
    
            force_agent_action_success_for_human    function: 58C850B0
    
            remove_attack_of_opportunity_overrides    function: 58C845B0
    
            scroll_camera    function: 58C83350
    
            remove_area_trigger    function: 58C84E90
    
            grant_faction_handover    function: 58C83110
    
            add_circle_area_trigger    function: 58C84E50
    
            disable_saving_game    function: 58C84BB0
    
            kill_character    function: 58C85150
    
            remove_restricted_building_level_record    function: 58C82530
    
            set_zoom_limit    function: 58C82630
    
            remove_restricted_building_level_record_for_faction    function: 58C82570
    
            set_ignore_end_of_turn_public_order    function: 58C851B0
    
            pending_auto_show_messages    function: 58C832D0
    
            set_campaign_ai_force_all_factions_boardering_human_vassals_to_have_invasion_behaviour    function: 58C83190
    
            remove_event_restricted_unit_record_for_faction    function: 58C85390
    
            enable_auto_generated_missions    function: 58C87670
    
            move_to    function: 58C84B10
    
            force_make_trade_agreement    function: 58C84A10
    
            register_instant_movie    function: 58C84450
    
            speedup_active    function: 58C84DD0
    
            set_non_scripted_traits_disabled    function: 58C84BF0
    
            force_character_force_into_stance    function: 58C85410
    
            make_sea_region_seen_in_shroud    function: 58C8B0B0
    
            end_turn    function: 58C84D50
    
            set_general_offered_dilemma_permitted    function: 58C850F0
    
            remove_event_restricted_building_record_for_faction    function: 58C853D0
    
            cai_strategic_stance_manager_set_stance_blocking_between_factions_for_a_given_stance    function: 58C855B0
    
            cai_strategic_stance_manager_clear_all_promotions_between_factions    function: 58C85590
    
            add_settlement_model_override    function: 58C88FB0
    
            set_tax_rate    function: 58C847D0
    
            cai_strategic_stance_manager_set_stance_promotion_between_factions_for_a_given_stance    function: 58C85570
    
            cai_strategic_stance_manager_promote_specified_stance_towards_target_faction_by_number    function: 58C85530
    
            technology_osmosis_for_playables_enable_culture    function: 58C845D0
    
            make_region_visible_in_shroud    function: 58C85450
    
            award_experience_level    function: 58C84C10
    
            lock_technology    function: 58C851D0
    
            render_campaign_to_file    function: 58C853F0
    
            set_tax_disabled    function: 58C855F0
    
            add_event_restricted_building_record_for_faction    function: 58C853B0
    
            add_event_restricted_building_record    function: 58C85330
    
            add_event_restricted_unit_record_for_faction    function: 58C852F0
    
            add_event_restricted_unit_record    function: 58C852B0
    
            autosave_at_next_opportunity    function: 58C85290
    
            set_character_skill_tier_limit    function: 58C85250
    
            add_attack_of_opportunity_overrides    function: 58C843D0
    
            force_change_cai_faction_personality    function: 58C87B50
    
            exempt_region_from_tax    function: 58C84750
    
            add_custom_battlefield    function: 58C82470
    
            remove_effect_bundle    function: 58C84F10
    
            disable_shortcut    function: 58C84ED0
    
            model    function: 58C85430
    
            instantly_repair_building    function: 58C85190
    
            disable_rebellions_worldwide    function: 58C84850
    
            force_garrison_infiltration_success_for_human    function: 58C84790
    
            attack    function: 58C84A50
    
            override_ui    function: 58C85070
    
            stop_camera    function: 58C833D0
    
            remove_location_trigger    function: 58C826D0
    
            create_agent    function: 58C84F50
    
            add_marker    function: 58C84A70
    
            allow_player_to_embark_navies    function: 58C85210
    
            compare_localised_string    function: 58C83250
    
            enable_movement_for_character    function: 58C84C90
    
            add_agent_experience    function: 58C88330
    
            grant_unit    function: 58C84670
    
            set_character_experience_disabled    function: 58C85230
    
            replenish_action_points    function: 58C85010
    
            modify_next_autoresolve_battle    function: 58C84FB0
    
            dismiss_advice    function: 58C83530
    
            disable_movement_for_ai_under_shroud    function: 58C831D0
    
            new    function: 58C619C0
    
            unhide_character    function: 58C84E30
    
            instantly_dismantle_building    function: 58C84F70
    
            remove_settlement_model_override    function: 58C93FD0
    
            cancel_actions_for    function: 58C830F0
    
            apply_effect_bundle    function: 58C84EF0
    
            shown_message    function: 58C832B0
    
            treasury_mod    function: 58C84FF0
    
            force_declare_war    function: 58C84890
    
            force_make_peace    function: 58C84830
    
            hide_character    function: 58C84E10
    
            add_restricted_building_level_record_for_faction    function: 58C82390
    
            set_liberation_options_disabled    function: 58C84C50
    
            set_looting_options_disabled_for_human    function: 58C84B30
    
            force_add_skill    function: 58C84A30
    
            force_make_vassal    function: 58C87BD0
    
            toggle_speedup    function: 58C84D90


    Admitadly given all this reachable info and the fair amount of things you can do there are interesting things to be achieved through scripting, politics is sadly limited in this regard however.

  4. #4

    Default Re: Scripting political influence

    Thank you for replying. Unfortunately it seems it is not actually possible to do what I wanted to do, even remotely.

    Here are my proposals for politics improvements to CA, as I got no answer I wanted to mod it myself : http://forums.totalwar.com/showthrea...light=politics


    Creator of Geomod: a tool for M2TW mapping.

Posting Permissions

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