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# Babylonian (Newton) method of finding square roots by Yard1 # Feel free to use and modify provided credits are given # # Finding the square root of 10. # set_variable = { sr_arg_number = 10 } # Put 10 into the argument variable # square_root_number = yes # Run the effect # set_variable = { out = sr_ret_number } # Set your out variable to the return variable # Square roots a number (sr_arg_number), returns value in sr_ret_number. square_root_babylonian = {
9/16/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