Kaiserreich / Kaiserreich-4-Bug-Reports

Issue tracker for Kaiserreich for Hearts of Iron 4
110 stars 40 forks source link

BRA - Change MTTH events to directly fired #12663

Closed ghost closed 3 years ago

ghost commented 3 years ago

Quick questions HOI4 version: 1.10.3 Kaiserreich version: Dev master 22.12.20

Describe the change you would like: I would like to suggest to change the mtth triggers for the following events: bra.75,

Explain the reasoning behind this change: from my understanding that MTTH trigger is worse preformece wise, then directly fired events, and thus I would like to suggest some changes to these events, in the hopes that it will reduce their preformence cost without harming their functionality.

Additional context or comments:

The list:

and in the event keep the trigger:

    trigger = {
        has_elected_government = yes
        OR = {
            AND = {
                NOT = {
                    country_exists = PSA
                }
                NOT = {
                    country_exists = USA
                }
                country_exists = CSA
            }
            AND = {
                NOT = {
                    country_exists = PSA
                }
                NOT = {
                    country_exists = USA
                }
                country_exists = TEX
            }
        }
    }
trigger = {
        tag = BRA
        has_government = market_liberal
    }

    mean_time_to_happen = {
        months = 12
    }

Suggested Replecment code: Just fire this directly from on_goverment_change in the on_actions_latin_america file-

    on_government_change = {
        effect = {      
                              if = {
                limit = {
                    tag = BRA
                    has_government = market_liberal
                }
                country_event = { id = bra.352 days = 180 random = 540 }
            }

while keeping the following trigger in the event

trigger = {
        has_government = market_liberal
    }
- **Event ID:** bra.516
**Current MTTH trigger**:   
trigger = {
    tag = BRA
    has_socialist_government = yes
    has_war_with = GER
    OR = {
        is_in_faction_with = FRA
        is_in_faction_with = ENG
    }
}

mean_time_to_happen = {
    months = 1
}
**Suggested Replecment code**: fire it from the on_war on action, like suggestion for bra.508
on_war = {
    effect = {
        if = {
            limit = {
                OR = {
                    AND = {
                        tag = BRA
                        FROM = { tag = GER }
                        }
                    AND = {
                        tag = GER
                        FROM = { tag = BRA }
                        }
                }
                country_event = { id = bra.516 days = 15 random = 45 }
            }
        }
while keeping this trigger in the event: 
trigger = {
    has_socialist_government = yes
    OR = {
        is_in_faction_with = FRA
        is_in_faction_with = ENG
    }
}

- **Event ID:** bra.701
**Current MTTH trigger**:   

trigger = { tag = BRA has_global_flag = second_weltkrieg_has_started NOT = { has_government = national_populist } }

mean_time_to_happen = {
    years = 1
}
**Suggested Replecment code**: fire it directly from event ai_event.201- like this:
`country_event = { id = bra.701 days = 180  random = 540 }`
while keeping this trigger in the event: 

trigger = { NOT = { has_government = national_populist } }


- **Event ID:** bra.752
**Current MTTH trigger**:
trigger = {
    tag = BRA
    has_country_flag = BRA_volunteers_POR
    OR = {
        NOT = {
            country_exists = POR
        }
        POR = {
            has_war = no
        }
    }
}

mean_time_to_happen = {
    months = 1
}
**Suggested Replecment code**: Fire it from an on_peace in the on_actions_Portugal file-    

on_peace = { effect = { if = { limit = { tag = POR } BRA = { country_event = { id = bra.701 days = 180 random = 540 } } } } }

while keeping the following trigger in the event    

trigger = { has_country_flag = BRA_volunteers_POR }

Alpinia commented 3 years ago

All done.