





🌟 Special thanks to our amazing supporters:
✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]
Hello there it's me C0RAX. It's time for another feature dev diary and this week we are going to look at military industrial organisations (MIOs). Now we talked about the concepts of the MIOs in the Dev corner in may but since then we have done a lot of work taking onboard internal and community feedback and from that work we have changed lots of things. This means that some of the things we talked about previously in the dev corner won't be true anymore. That's enough prefacing so let's get into it, let's see what the finished MIOs look like. So to reiterate what we went over in the last dev corner here is what we identified and how we wanted to improve it. Firstly we have the current model of companies in HOI. Currently we have to provide static modifiers and sometimes change them via scripted decisions or focus rewards, this makes them very un-interactive and mostly something you click once and then forget about, it's just another modifier on your country. By creating a more organic system to upgrade your design companies you the player can now decide what these upgrades are and tailor them to fit your playstyle. Additionally we can now reward the player for using a design company as opposed to simply having you save up a resource and click a button, rewarding you for putting effort into them. From this we had an intent and goals established.
equipment_type = { mio_cat_eq_all_light_tank mio_cat_eq_all_medium_tank }
research_categories = { mio_cat_tech_light_armor_and_modules mio_cat_tech_medium_armor_and_modules }
This acts to tell the MIO what equipment it will be affecting with traits and which tech categories it will be applicable to. Here we are using a new type of collection for MIOs equipment categories; these are script defined sets of equipment types that allow you to reference all of them with a single token instead of having to declare each one individually for every instance.
initial_trait = {
name = generic_mio_initial_trait_standardized_production
equipment_bonus = {
armor_value = -0.05
defense =-0.05
}
production_bonus = {
production_cost_factor = -0.1
}
}
Next we are defining the initial trait that is modifiers that the MIO starts with, these can affect the equipment modifiers, production modifiers or MIO modifiers like fund gain or research bonus speed.
trait = {
token = generic_mio_trait_simplified_suspension
name = generic_mio_trait_simplified_suspension
icon = GFX_generic_mio_trait_icon_reliability
position = { x=1 y=0 }
equipment_bonus = {
reliability = 0.05
}
}
trait = {
token = generic_mio_trait_crew_ergonomics
name = generic_mio_trait_crew_ergonomics
icon = GFX_generic_mio_trait_icon_maximum_speed
position = { x=4 y=0 }
relative_position_id = generic_mio_trait_simplified_suspension
equipment_bonus = {
maximum_speed = 0.02
defense = 0.02
}
}
trait = {
token = generic_mio_trait_improved_tracks
name = generic_mio_trait_improved_tracks
icon = GFX_generic_mio_trait_icon_maximum_speed
position = { x=0 y=2 }
relative_position_id = generic_mio_trait_simplified_suspension
any_parent = { generic_mio_trait_simplified_suspension }
equipment_bonus = {
reliability = 0.05
maximum_speed = 0.05
}
}
Now we are defining the traits we can declare where they exist on the trait grid and if they have any parents that they connect to and what parents are needed for the trait to be accessible. As above we have the any_parent trigger. We can also do things like mutual exclusivity and other things expected from hoi4s trees.
When creating traits we don't always have to affect everything, we can limit a trait to only affect specific equipment. By using the limit_to_equipment_type we can select an equipment type that MUST be contained in the equipment_type categories defined.
tree_header_text = {
text = mio_header_tank_construction
x = 3
}
Finally for normal MIO setup we have headers, these are text entries that you can position on the grid. They will always be above a trait on the same grid location and are fixpoints numbers so can go between grids.
Now that works great for a new MIO but now let's talk about taking an existing one and expanding on it to make it a bit more unique without having to duplicate this for every MIO.
include = generic_medium_tank_organization
This include line will take all the script from the defined MIO and use it for this new MIO; we can now modify this include as well. We can simply declare non trait values normally and they will override just like with parenting in other parts of hoi4s scripting. However for traits since they are a tree they need to have some explicit commands.
add_trait = {
token = ENG_mio_trait_expanded_turret_capacity
name = ENG_mio_trait_expanded_turret_capacity
icon = GFX_generic_mio_department_icon_tank_medium_tank_engine
special_trait_background = yes
position = { x=1 y=1 }
relative_position_id = generic_mio_trait_all_round_cupola
any_parent = { generic_mio_trait_all_round_cupola }
limit_to_equipment_type = { mio_cat_eq_all_medium_tank }
equipment_bonus = {
reliability = 0.05
armor_value = 0.05
breakthrough = 0.05
}
}
Here we can see we have used the add trait line to add another tree to the tree just for this MIO, we are even able here to give it a parent by using the token for a trait declared in the included MIO. in addition to add we can also remove_trait and override_trait if we wish.
The final part I'll talk about for trees is the allowed and available blocks. Allowed & available works just like any other in the game. We can lock MIOs for any reason. So if you want to stop a trait from being available because of a decision or national focus you can do this. And allows you to lock MIOs to specific countries but is only run on load as with other allowed blocks.
The finally part of MIOs is policies
mio_policy_land_cutting_corners = {
icon = GFX_mio_policy_cutting_corners
allowed = {
OR = {
has_mio_equipment_type = armor
has_mio_equipment_type = motorized
has_mio_equipment_type = mechanized
has_mio_equipment_type = anti_tank
has_mio_equipment_type = flame
has_mio_equipment_type = anti_air
has_mio_equipment_type = artillery
has_mio_equipment_type = rocket
has_mio_equipment_type = infantry
}
}
available = { has_mio_size > 5}
equipment_bonus = {
same_as_mio = {
build_cost_ic = -0.1
reliability = -0.05
soft_attack = -0.05
hard_attack = -0.05
armor_value = -0.05
}
}
}
This is a policy in script. It's very simple to implement but we have a few special things for MIOs. Has_mio_equipment_type is the trigger used to ask if the MIO has a specific unit type defined in equipment_type = {.... so this is very useful for making sure policies are only allowed or available for the mios you want. Finally we have same_as_mio this dynamically makes the stat bonus apply to whatever equipment was defined for equipment_type = {.... So we don't need to worry if the armour bonus we add with a policy is targeted against the correct equipment or cover them all, so long as we are allowing them correctly we just add the modifiers under same_as_mio.
That's a quick round up of most of the core parts of MIOs from a modding standpoint but feel free to ask questions if there's something still unclear.
That's everything for this week as always feel free to ask questions about this feature and I'll do my best to answer them. Next week we will be looking at the International Market feature. I hope to see you there. C0RAX Out.
[ 2023-09-27 13:01:32 CET ] [ Original post ]
[ 6081 ]
[ 1481 ]
[ 4227 ]