Disbands a percentage of the army (just the army), returning equipment and manpower to the stockpile. Useful to eg. force an AI to reduce the size of their army after a war. SOL must be replaced with a tag from your mod that never exists (a utility tag). Please note that the size is rounded up to divisions. For example, if you have 4 divisions and want to disband 1% of the army, then one division will be disbanded. This is unavoidable. Which divisions are disbanded is also completely random. Usage example: # disband 10% of the army of the current tag set_variable = { disband_fraction = 0.1 }
9/19/2020# Count Inflicted Casualties effect by Yard1 # Hopefully paradox will bless us with just a variable for that # put this in on_daily - I'd limit it to only countries that actually make use of it, as it can be a bit performance intensive - though it's not as terrible as it looks # inflicted_casualties - all inflicted casualties # inflicted_casualties_on_@TAG - inflicted casualties on original tag, eg. inflicted_casualties_on_GER count_inflicted_casualties_on_current_enemies = { set_temp_variable = { effect_root = THIS } every_enemy_country = { limit = { var:original_tag = {
8/22/2020So, you want to get on that sweet sweet targeted action, don't you? Have little flags next to the icons, code that's easier to write and maintain, dynamic targets... The whole jazz. But, just after you write one, you get that dreaded feeling, that pit in the stomach... Oh no. I can feel the game slowing down!. Well, no more! Just follow these simple practices to have your targeted decisions run as fast as possible! Please note that this short guide focuses only on the performance aspect. Limit your targets This part is the most important. You know how target_trigger works - it checks countries/states, and those that match the trigger become decision targets. However, unless you limit the possible targets, every country or state in the game will be checked, every day! If you put in expensive triggers in there, it can really slow everything down. How can we limit targets, then, so that only a certain subset of entities is checked? targets First way is to use targets = {}. You simply put in the country tags, state IDs (depending on the type of your decision) or variables inside, and target_trigger will run only on those. Common use cases:
6/14/2020# HoI4 State Land Connection Indexer by Yard1 # Provides a simple way to check if two states share a land connection # Call the scripted effect below in on_startup from a country scope (any will do, I suggest random_country) # In order to check if two states have a land connection to each other, compare their state_land_connection_index variables. If they are the same, then they have a land connection. mark_land_connected_states = { random_country = { set_variable = { global.current_state_land_connection_index = 1 } every_state = { add_to_array = { global.unchecked_land_connection_states = THIS } }
6/13/2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up