• 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.

SirBlackAxe

General
18 Badges
Aug 13, 2021
2.205
5.521
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Crusader Kings III Referal
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
EDIT: Found the problem within 10 minutes of making this post. Never mind!

I just started getting "Script Error: Invalid scripted effect:" errors with some of my recently created scripted effects, and I'm completely stumped as to what's causing them. The error log isn't giving me anything to work with except the lines lines calling the effects (if they aren't called by anything I don't get errors for them) and CWTools isn't detecting any errors.

[17:05:06][metascript.cpp:148]: Compiling source for failed for missing args: DISTRICT, BUILDING1, BUILDING2

[17:05:06][metascript.cpp:148]: Compiling source for failed for missing args: DISTRICT, BUILDING1, BUILDING2, BUILDING3

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t2_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1482

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t3_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1496

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t3_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1511

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_building_conversion_effect_servitor at file: common/decisions/02_special_decisions.txt line: 1527

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t2_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1729

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t3_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1743

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_t3_building_conversion_effect at file: common/decisions/02_special_decisions.txt line: 1758

[17:05:06][effect_impl.cpp:831]: Script Error: Invalid scripted effect: ecu_building_conversion_effect_servitor at file: common/decisions/02_special_decisions.txt line: 1774

Bash:
ecu_t3_building_conversion_effect = {
    log = "SBA: Used ecu_t3_building_conversion_effect on \\[This.GetName]"
    while = { # T3 converts 1 to 1
        limit = {
            has_district = district_arcology_housing
            has_building = $BUILDING3$
            # [[!BUILDING3 ] always = no ]
        }
        remove_district = district_arcology_housing
        remove_building = $BUILDING3$
        add_district = $DISTRICT$
    }
    if = {
        limit = {
            has_district = district_arcology_housing
            OR = {
                has_building = $BUILDING1$
                has_building = $BUILDING2$
            }
        }
        ecu_t2_building_conversion_effect = {
            DISTRICT = $DISTRICT$
            BUILDING1 = $BUILDING1$
            BUILDING2 = $BUILDING2$
        }
    }
}

ecu_t2_building_conversion_effect = {
    log = "SBA: Used ecu_t2_building_conversion_effect on \\[This.GetName]"
    while = { # T2 converts 3 to 2
        limit = {
            num_districts = { type = district_arcology_housing value >= 2 }
            num_buildings = { type = $BUILDING2$ value >= 3 }
        }
        remove_building = $BUILDING2$
        while = {
            count = 2
            remove_district = district_arcology_housing
            remove_building = $BUILDING2$
            add_district = $DISTRICT$
        }
    }
    if = { # 2x T2 = T1 + district
        limit = {
            has_district = district_arcology_housing
            num_buildings = { type = $BUILDING2$ value >= 2 }
        }
        while = {
            count = 2
            remove_building = $BUILDING2$
        }
        remove_district = district_arcology_housing
        add_district = $DISTRICT$
        add_building = $BUILDING1$
    }
    while = { # T2 + T1 = district
        limit = {
            has_district = district_arcology_housing
            has_building = $BUILDING2$
            has_building = $BUILDING1$
        }
        remove_district = district_arcology_housing
        remove_building = $BUILDING2$
        remove_building = $BUILDING1$
        add_district = $DISTRICT$
    }
    while = { # T1 = 3 to 1
        limit = {
            has_district = district_arcology_housing
            num_buildings = { type = $BUILDING1$ value >= 3 }
        }
        while = {
            count = 3
            remove_building = $BUILDING1$
        }
        remove_district = district_arcology_housing
        add_district = $DISTRICT$
    }
}

ecu_building_conversion_effect_servitor = {
    log = "SBA: Used ecu_building_conversion_effect_servitor on \\[This.GetName]"
    while = { # T2 converts 3 to 2
        limit = {
            free_district_slots >= 2
            num_buildings = { type = building_organic_paradise value >= 3 }
        }
        remove_building = building_organic_paradise
        while = {
            count = 2
            remove_building = building_organic_paradise
            add_district = district_arcology_organic_housing
        }
    }
    if = { # 2x T2 = T1 + district
        limit = {
            free_district_slots >= 1
            num_buildings = { type = building_organic_paradise value >= 2 }
        }
        while = {
            count = 2
            remove_building = building_organic_paradise
        }
        add_district = district_arcology_organic_housing
        add_building = building_organic_sanctuary
    }
    while = { # T2 + T1 = district
        limit = {
            free_district_slots >= 1
            has_building = building_organic_paradise
            has_building = building_organic_sanctuary
        }
        remove_building = building_organic_paradise
        remove_building = building_organic_sanctuary
        add_district = district_arcology_organic_housing
    }
    while = { # T1 = 3 to 1
        limit = {
            free_district_slots >= 1
            num_buildings = { type = building_organic_sanctuary value >= 3 }
        }
        while = {
            count = 3
            remove_building = building_organic_sanctuary
        }
        add_district = district_arcology_organic_housing
    }

    # want 1.5 artisan drones per trophy district
    # get 6 artisan drones per factory district
    export_trigger_value_to_variable = {
        trigger = num_districts
        parameters = { type = district_arcology_organic_housing }
        variable = swap_districts_variable
    }
    divide_variable = { which = split_districts_variable value = 4 }
    ceiling_variable = split_districts_variable
    while = {
        count = swap_districts_variable
        if = {
            limit = { has_district = district_arcology_housing }
            remove_district = district_arcology_housing
        }
        if = {
            limit = { free_district_slots >= 1 }
            add_district = district_arcology_civilian_industry
        }
    }
    clear_variable = swap_districts_variable
}
These failing effects are called like this in the effect block of decision_arcology_project:
Bash:
            if = {
                limit = {
                    OR = {
                        has_building = building_holo_theatres
                        has_building = building_hyper_entertainment_forum
                    }
                }
                ecu_t2_building_conversion_effect = {
                    DISTRICT = district_arcology_leisure
                    BUILDING1 = building_holo_theatres
                    BUILDING2 = building_hyper_entertainment_forum
                }
            }

Here's some more invalid effects:
Bash:
# Arcology Project
decision_arcology_project = {
[...]
    effect = {
        # Make city-planet
        custom_tooltip = decision_arcology_project_effects
        hidden_effect = {
            # clear_deposits = yes # Removed
            sba_clear_natural_deposits_effect = yes # Added
Bash:
sba_clear_natural_deposits_effect = {
    every_deposit = {
        limit = {
            NOR = {
                is_deposit_type = d_the_zone
                is_deposit_type = d_toy_factory_complex
                is_deposit_type = d_odd_factory
                is_deposit_type = d_ancient_particle_accelerator
                is_deposit_type = d_underground_vault
                is_deposit_type = d_underground_vault_2
                is_deposit_type = d_processing_pens
                is_deposit_type = d_space_time_anomaly
                is_deposit_type = d_portal_research_zone
                is_deposit_type = d_numas_breath
                is_deposit_type = d_sentinels
                is_deposit_type = d_sentinels_metal
                is_deposit_type = d_sentinels_monument
                is_deposit_type = d_hab_lonely_bot_deposit
                is_deposit_type = d_hab_lonely_bot_deposit_2
                is_deposit_type = d_hab_lonely_bot_deposit_3
                is_deposit_type = d_dragon_monument
                is_deposit_type = d_stellarite_trophy
                is_deposit_type = d_mutation_vats
                is_deposit_type = d_disco_planet
                is_deposit_type = d_disco_planet2
                is_deposit_type = d_impossiblecorrie
                is_deposit_type = d_bluelotus
                is_deposit_type = d_bluelotus2
                is_deposit_type = d_ruin_bluelotus
                is_deposit_type = d_crater_bluelotus
                is_deposit_type = d_federation_hegemony_monument_1
                is_deposit_type = d_federation_hegemony_monument_2
            }
        }
        log = "sba_clear_natural_deposits_effect removed \\[This.GetName] from \\[Prev.GetName]"
        remove_deposit = yes
    }
    remove_modifier = "natural_beauty"
    remove_modifier = "lush_planet"
    remove_modifier = "paradise_made"
    remove_modifier = "bleak_planet"
    remove_modifier = "dangerous_wildlife"
    remove_modifier = "hazardous_weather"
    remove_modifier = "wild_storms"
    # remove_modifier = "irradiated_planet"
    remove_modifier = "second_home"
    remove_modifier = "asteroid_impacts"
}
Which is modeled after the effects in action.68 which clears certain deposits and modifiers after terraforming:
Bash:
# Clear deposits after some terraforming actions
planet_event = {
    id = action.68
    is_triggered_only = yes
    hide_window = yes

    immediate = {
        if = {
            limit = {
                is_planet_class = pc_machine
            }
            #clear_deposits = yes
            every_deposit = {
                limit = {
                    NOR = { # rare non-event deposits should not be cleared
                        is_deposit_type = d_dust_caverns
                        is_deposit_type = d_dust_desert
                        is_deposit_type = d_bubbling_swamp
                        is_deposit_type = d_fuming_bog
                        is_deposit_type = d_crystalline_caverns
                        is_deposit_type = d_crystal_forest
                        is_deposit_type = d_crystal_reef
                        is_deposit_type = d_betharian_deposit
                        is_deposit_type = d_alien_pets_deposit
                    }
                }
                remove_deposit = yes
            }
            remove_modifier = "natural_beauty"
            remove_modifier = "atmospheric_aphrodisiac"
            remove_modifier = "atmospheric_hallucinogen"
            remove_modifier = "lush_planet"
            remove_modifier = "paradise_made"

This effect also fails:
Bash:
sba_create_awoken_robots = {
    create_species = {
        name = "NAME_Awoken_Robot"
        plural = "NAME_Awoken_Robots"
        class = ROBOT
        namelist = FUN3
        portrait = "default_robot"
        traits = {
            trait = "trait_mechanical"
            trait = "trait_robot_logic_engines"
            trait = "trait_robot_high_maintenance"
        }
        effect = {
            if = {
                limit = { host_has_dlc = "Synthetic Dawn Story Pack" }
                change_species_portrait = sd_fun_robot
            }
        }
    }
    set_built_species = last_created_species
}
Despite being nearly identical to the vanilla
Bash:
create_fe_servant_robots = {
    create_species = {
        name = "NAME_Synthetic"
        plural = "NAME_Synthetics"
        class = ROBOT
        namelist = this
        portrait = "default_robot"
        traits = {
            trait = "trait_mechanical"
            trait = "trait_robot_luxurious"
            trait = "trait_robot_domestic_protocols"
        }

        effect = {
            if = {
                limit = {
                    prev = { use_robot_portrait_sd_hum_robot = yes }
                }
                change_species_portrait = sd_hum_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_mam_robot = yes }
                }
                change_species_portrait = sd_mam_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_rep_robot = yes }
                }
                change_species_portrait = sd_rep_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_avi_robot = yes }
                }
                change_species_portrait = sd_avi_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_art_robot = yes }
                }
                change_species_portrait = sd_art_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_mol_robot = yes }
                }
                change_species_portrait = sd_mol_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_fun_robot = yes }
                }
                change_species_portrait = sd_fun_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_pla_robot = yes }
                }
                change_species_portrait = sd_pla_robot
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_lit_robot = yes }
                }
                change_species_portrait = lith_machine
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_nec_robot = yes }
                }
                change_species_portrait = nec_machine
            }
            else_if = {
                limit = {
                    prev = { use_robot_portrait_sd_aqu_robot = yes }
                }
                change_species_portrait = aqu_machine
            }
        }
    }

    set_built_species = last_created_species
}

Does anyone have an inkling of what the problem is?
 
Last edited: