• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

WarStalkeR

Sergeant
78 Badges
May 9, 2016
96
20
  • Crusader Kings II
  • Stellaris: Galaxy Edition
  • Stellaris
  • Stellaris: Synthetic Dawn
  • Victoria 2: A House Divided
  • Teleglitch: Die More Edition
  • Supreme Ruler 2020
  • Sword of the Stars II
  • Rome Gold
  • Victoria: Revolutions
  • Age of Wonders III
  • March of the Eagles
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Ancient Space
  • Steel Division: Normand 44 - Second Wave
  • Leviathan: Warships
  • Magicka
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Age of Wonders
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • Crusader Kings Complete
  • BATTLETECH
  • Surviving Mars
  • Stellaris: Nemesis
  • Tyranny - Bastards Wound
  • Age of Wonders: Shadow Magic
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Knights of Pen and Paper 2
  • Cities: Skylines - After Dark
  • Pillars of Eternity
  • Cities: Skylines
  • Rome: Vae Victis
  • Victoria 2
  • Europa Universalis III Complete
  • Majesty 2
I've created this event (it looks like this after I fell to the depth modding despair):
Code:
planet_event = {
    id = ffu_il_buildinginit.1
    hide_window = yes
    is_triggered_only = yes
   
    immediate = {
        random_tile = {
            limit = {
                NOT = { has_global_flag = enrichment_in_progress_01 }
                has_building = building_enrichment_project_01
                has_building_construction = no
            }
            set_global_flag = enrichment_in_progress_01
        }
        if = {
            limit = {
                has_global_flag = enrichment_in_progress_01
            }
            remove_global_flag = enrichment_in_progress_01
            planet_event = { id = ffu_il_buildinginit.101 }
        }
    }
}
and it is triggered from here:
Code:
on_building_complete = {
    events = {
        tutorial.14
        tutorial.140
        ffu_il_buildinginit.1
        ffu_il_buildinginit.2
        ffu_il_buildinginit.3
    }
}
The problem is that event is triggered only once per tile, when structure is complete. Events "ffu_il_buildinginit.2" and "ffu_il_buildinginit.3" are exactly same copies of the "ffu_il_buildinginit.1" but with changed numbers. Adding similar trigger to the "ffu_il_buildinginit.101" has very same effect: this event is triggered only once from Tile and never again from same tile. This is how "ffu_il_buildinginit.101" looks:
Code:
planet_event = {
    id = ffu_il_buildinginit.101
    title = ffu_il_buildinginit.101.name
    desc = ffu_il_buildinginit.101.desc
    picture = GFX_evt_enrichment_project
    show_sound = event_construction
    #location = from
   
    #fire_only_once = no
    is_triggered_only = yes
   
    #trigger = {
    #    NOT = {
    #        has_planet_flag = enrichment_in_progress
    #    }
    #    owner = {
    #        is_ai = no
    #    }
    #    from = {
    #        has_building = building_enrichment_project_01
    #        has_building_construction = no
    #    }
    #}
   
    #immediate = {
    #    set_planet_flag = enrichment_in_progress
    #}
   
    option = {
        name = enrichment_project_deposit_minerals
        custom_tooltip = enrichment_project_deposit_minerals_desc_v1
        hidden_effect = {
            #remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01
                    has_building_construction = no
                }
                remove_building = yes
                add_deposit = d_mineral_deposit
            }
        }
    }
   
    option = {
        name = enrichment_project_close
        custom_tooltip = enrichment_project_close_desc
        hidden_effect = {
            #remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01
                    has_building_construction = no
                }
                remove_building = yes
            }
            owner = {
                add_minerals = 1875
                add_energy = 935
                add_influence = 35
            }
        }
    }
}
What am I doing wrong with this event? Why I can trigger it again from the same Tile? Thanks.
 
It's very strange. If I trigger event via "on_building_upgraded" trigger, I can use "ffu_il_buildinginit.101" as much as I want on same tile. But if I use "on_building_complete" trigger, I can use "ffu_il_buildinginit.100" event only once. Even though syntax is correct and there are no errors in the error.log.
Code:
planet_event = {
    id = ffu_il_buildinginit.100
    title = ffu_il_buildinginit.101.name
    desc = ffu_il_buildinginit.101.desc
    picture = GFX_evt_enrichment_project
    show_sound = event_construction
    location = root
   
    #fire_only_once = no
    is_triggered_only = yes
   
    trigger = {
        NOT = { has_planet_flag = enrichment_in_progress }
        owner = { is_ai = no }
        from = {
            has_building = building_enrichment_project_01
        }
    }
   
    immediate = {
        set_planet_flag = enrichment_in_progress
    }
   
    option = {
        name = enrichment_project_deposit_minerals
        custom_tooltip = enrichment_project_deposit_minerals_desc_v1
        hidden_effect = {
            remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01
                }
                remove_building = yes
                add_deposit = d_mineral_deposit
            }
        }
    }
   
    option = {
        name = enrichment_project_close
        custom_tooltip = enrichment_project_close_desc
        hidden_effect = {
            remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01
                }
                remove_building = yes
            }
            owner = {
                add_minerals = 1875
                add_energy = 935
                add_influence = 35
            }
        }
    }
}
Code:
planet_event = {
    id = ffu_il_buildinginit.101
    title = ffu_il_buildinginit.101.name
    desc = ffu_il_buildinginit.101.desc
    picture = GFX_evt_enrichment_project
    show_sound = event_construction
    location = root
   
    #fire_only_once = no
    is_triggered_only = yes
   
    trigger = {
        NOT = { has_planet_flag = enrichment_in_progress }
        owner = { is_ai = no }
        from = {
            has_building = building_enrichment_project_01_init
            has_prev_building = building_enrichment_project_01
        }
    }
   
    immediate = {
        set_planet_flag = enrichment_in_progress
    }
   
    option = {
        name = enrichment_project_deposit_minerals
        custom_tooltip = enrichment_project_deposit_minerals_desc_v1
        hidden_effect = {
            remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01_init
                    has_prev_building = building_enrichment_project_01
                }
                remove_building = yes
                add_deposit = d_mineral_deposit
            }
        }
    }
   
    option = {
        name = enrichment_project_close
        custom_tooltip = enrichment_project_close_desc
        hidden_effect = {
            remove_planet_flag = enrichment_in_progress
            random_tile = {
                limit = {
                    has_building = building_enrichment_project_01_init
                    has_prev_building = building_enrichment_project_01
                }
                remove_building = yes
            }
            owner = {
                add_minerals = 1875
                add_energy = 935
                add_influence = 35
            }
        }
    }
}
What am I doing wrong? Thanks.