• 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.
Apr 1, 2023
31
9
Hello,
does anyone know of a mod that uses the effect "set_available_for_autonomous_investment" or does anyone know how to mod effects into the game?

I would like to use autonomous investments, but then ban certain buildings from being built. so I always have to tear them down when they are built. that's rubbish.

would be grateful for attention and help

I've tried a few things with chatgpt but he doesn't know what to do either.

say I wanted a mod with "unset_available_for_autonomous_investment = building type scope"

create and saved the buildings I didn't want in common/building and as a txt file.

content is only building_type = {
unset_available_for_autonomous_investment = yes
}

I also think that something is missing and it doesn't work that easily. I just have no idea how I can address the effects for the game. i.e. can write the commands in such a way that he understands them too.
 
Last edited:
set and unset both look to be used in the tutorial journal entries, but if you're looking for a more general prohibition, rather than a temporary one, you'd want to modify the building files I think.

Anyway, if you do want to use the unset_available_for_autonomous_investment, I think unset_available_for_autonomous_investment = <building_script_name> in the country's scope should do it. Otherwise you might need to do in state scope (that is something like every_owned_state).

To change the building files, you want to add the following to each building's definition
Code:
    can_build_government = {
        error_check = {
            severity = potential
            always = yes
        }
    }
    can_build_private = {
        error_check = {
            severity = potential
            always = no
        }
    }

That should allow government but not private construction. You can also set the trigger to be more complex than just always = yes/no.
 
set and unset both look to be used in the tutorial journal entries, but if you're looking for a more general prohibition, rather than a temporary one, you'd want to modify the building files I think.

Anyway, if you do want to use the unset_available_for_autonomous_investment, I think unset_available_for_autonomous_investment = <building_script_name> in the country's scope should do it. Otherwise you might need to do in state scope (that is something like every_owned_state).

To change the building files, you want to add the following to each building's definition
Code:
    can_build_government = {
        error_check = {
            severity = potential
            always = yes
        }
    }
    can_build_private = {
        error_check = {
            severity = potential
            always = no
        }
    }

That should allow government but not private construction. You can also set the trigger to be more complex than just always = yes/no.
thank you very much that was very helpful
 
I guess I need help again. I have now with the expression:

can_build_government = {
trigger = {
is_player = yes
owned_states = {
every_owned_state = {
# Here you can add more conditions for your states
}
}
}
error_check = {
severity = potential
always = yes
}
}

can_build_private = {
trigger = {
is_player = yes
owned_states = {
every_owned_state = {
# Here you can add more conditions for your states
}
}
}
error_check = {
severity = potential
always = no
}
}

but it works for all the ki too. I wanted to write it in such a way that it only applies to me as a player.

but somehow it doesn't work...

maybe there's just something wrong with the order of the expressions.


I thought it would be as simple as:

can_build_private = {
trigger = {
is_player = yes
}
error_check = {
severity = potential
always = no
}
}

to write
 
Last edited:
Ah sure, from my understanding the error_check is the trigger block, and always = yes/no the trigger that is used.

If you want anyone to build them directly, but only let AI use autonomous investment, this should work
Code:
    can_build_government = {
        error_check = {
            severity = potential
            always = yes
        }
    }
    can_build_private = {
        error_check = {
            severity = potential
            is_player = no #or is_ai = yes
        }
    }
 
thanks again for the answer. but i'm afraid it doesn't work that well. for me in the private sector it works that none of the buildings edited by me are built. but the ki should build them calmly. i.e. i don't want to have any restrictions there and stay as close as possible to the vanilla game. maybe I can poke around a little more. I've already put way too much time into this little thing XD
Ah sure, from my understanding the error_check is the trigger block, and always = yes/no the trigger that is used.

If you want anyone to build them directly, but only let AI use autonomous investment, this should work
Code:
    can_build_government = {
        error_check = {
            severity = potential
            always = yes
        }
    }
    can_build_private = {
        error_check = {
            severity = potential
            is_player = no #or is_ai = yes
        }
    }
thanks again for the answer.

but i'm afraid it doesn't work that well. for me in the private sector it works that none of the buildings edited by me are built.

but the ki should build them calmly. i.e. i don't want to have any restrictions there and stay as close as possible to the vanilla game.

maybe I can poke around a little more. I've already put way too much time into this little thing XD
 
Perhaps that trigger doesn't work there, or more likely it could be a scope issue, might need something like owner = { is_player = no }. Though I'm not sure if that would be the proper way of doing it.