Skip to content

Commit

Permalink
Merge pull request #191 from Kaiserreich/master
Browse files Browse the repository at this point in the history
Update Hoi4 CWTools config - address MIO and unit issues
  • Loading branch information
Pelmen323 authored Jun 25, 2024
2 parents 6d35387 + 552f2ea commit 7bfd8fc
Show file tree
Hide file tree
Showing 13 changed files with 280 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Config/common/military_industrial_organizations.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ military_industrial_organization = {
### Defines where the trait will be positioned in the tree grid. x=0 y=0 is the top left position.
### Do not reuse the same position twice.
position = {
x = float[-9..9]
x = float
y = float
}
### By default position is the absolute coordinate in the tree grid.
Expand Down
32 changes: 32 additions & 0 deletions Config/common/unit_medals.cwt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
types = {
type[unit_medal] = {
skip_root_key = unit_medals
path = "game/common/unit_medals"
path_strict = yes
}
}

## replace_scope = { root = country this = country }
unit_medal = {
## cardinality = 0..1
available = {
## cardinality = ~1..inf
alias_name[trigger] = alias_match_left[trigger]
}

frame = int
icon = <spriteType>

cost = @cost
cost = int

## cardinality = 0..1
unit_modifiers = {
alias_name[modifier] = alias_match_left[modifier]
}

## cardinality = 0..1
one_time_effect = {
alias_name[effect] = alias_match_left[effect]
}
}
46 changes: 46 additions & 0 deletions Config/effects_aat.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,52 @@ alias[effect:set_mio_task_capacity] = int_variable_field[0..inf]
## scope = military_industrial_organization
alias[effect:add_mio_task_capacity] = int_variable_field

### Executes children effects on a random Military Industrial Organisation of the country in scope, that fulfills the "limit" trigger. tooltip=key can be added to override tooltip title
## scope = country
## push_scope = military_industrial_organization
alias[effect:random_military_industrial_organization] = {
## cardinality = 0..1
limit = {
alias_name[trigger] = alias_match_left[trigger]
}
## cardinality = 0..1
tooltip = localisation
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
include_invisible = no
## cardinality = 0..1
include_invisible = yes
alias_name[effect] = alias_match_left[effect]
}

### Executes children effects on every Military Industrial Organisation (or "random_select_amount" of random MIOs if specified) of the country in scope, that fulfills the "limit" trigger. tooltip=key can be added to override tooltip title. By default the effects are only displayed once, you may display them for each matching MIO with display_individual_scopes.
## scope = country
## push_scope = military_industrial_organization
alias[effect:every_military_industrial_organization] = {
## cardinality = 0..1
limit = {
alias_name[trigger] = alias_match_left[trigger]
}
## cardinality = 0..1
tooltip = localisation
## cardinality = 0..1
random_select_amount = int
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
include_invisible = no
## cardinality = 0..1
include_invisible = yes
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
display_individual_scopes = no
## cardinality = 0..1
display_individual_scopes = yes
alias_name[effect] = alias_match_left[effect]
}

### Give market access to x
## scope = country
alias[effect:give_market_access] = enum[country_tags]
Expand Down
15 changes: 15 additions & 0 deletions Config/effects_bba.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,18 @@ alias[effect:remove_civil_war_target] = enum[country_tags]
### Destroys the currently-scoped division.
## scope = unit
alias[effect:destroy_unit] = bool

### Add history entry to a unit in scope
## scope = unit
alias[effect:add_history_entry] = {
key = localisation
subject = localisation
### Allow medal award
allow = bool
}

### Add a medal to latest history entry of a unit in scope. Check 'add_history_entry' to create a new entry
## scope = unit
alias[effect:add_unit_medal_to_latest_entry] = {
unit_medals = <unit_medal>
}
2 changes: 2 additions & 0 deletions Config/modifiers.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -1012,4 +1012,6 @@ modifiers = {
military_industrial_organization_task_capacity = military_industrial_organization
military_industrial_organization_size_up_requirement = military_industrial_organization
military_industrial_organization_funds_gain = military_industrial_organization
military_industrial_organization_policy_cost = military_industrial_organization
military_industrial_organization_policy_cooldown = military_industrial_organization
}
9 changes: 9 additions & 0 deletions Config/shared_enums.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,13 @@ enums = {
large_plane_cas_airframe_3
large_plane_cas_airframe_4
}

enum[country_scope_enum] = {
THIS
ROOT
FROM
PREV
FROM.FROM
FROM.FROM.FROM
}
}
4 changes: 4 additions & 0 deletions Config/triggers.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,10 @@ alias[trigger:<building>] = int_variable_field
## scope = country
alias[trigger:<ideology>] = variable_field

### Checks ideology popularity.
## scope = country
alias[trigger:<ideology>] = <ideology>

### Changes scope to opposing army/navy.
## scope = { unit_leader combat }
alias[trigger:opponent] = { alias_name[trigger] = alias_match_left[trigger] }
Expand Down
38 changes: 36 additions & 2 deletions Config/triggers_aat.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## scope = state
alias[trigger:is_one_state_island] = bool

### Checks if current MIO is the provided one
### Checks if the Military Industrial Organisation in scope matches the input token
## scope = military_industrial_organization
alias[trigger:is_military_industrial_organization] = <military_industrial_organization>

Expand All @@ -23,10 +23,14 @@ alias[trigger:has_mio_equipment_type] = <equipment>
## scope = military_industrial_organization
alias[trigger:has_mio_equipment_type] = <equipment_group>

### Checks if tag has specific MIO
### Checks if the Country in scope has a Military Industrial Organisation matching the input token. Can use variable as input
## scope = country
alias[trigger:has_military_industrial_organization] = <military_industrial_organization>

### Checks if the Country in scope has a Military Industrial Organisation matching the input token. Can use variable as input
## scope = country
alias[trigger:has_military_industrial_organization] = value[variable]

### Checks if MIO is available AND visible
## scope = military_industrial_organization
alias[trigger:is_mio_available] = bool
Expand Down Expand Up @@ -120,3 +124,33 @@ alias[trigger:has_mio_research_category] = <equipment.archetype_equip>
### Checks if the Military Industrial Organisation in scope has an allowed matching the input token, which is currently attached to the MIO
## scope = military_industrial_organization
alias[trigger:has_mio_policy_active] = <mio_policy>

### Checks if all Military Industrial Organisations of the Country in scope match the triggers. tooltip=key can be defined to override title
## scope = country
## push_scope = military_industrial_organization
alias[trigger:all_military_industrial_organization] = {
## cardinality = 0..1
tooltip = localisation
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
include_invisible = no
## cardinality = 0..1
include_invisible = yes
alias_name[trigger] = alias_match_left[trigger]
}

### Checks if at least one Military Industrial Organisation of the Country in scope matches the triggers. tooltip=key can be defined to override title
## scope = country
## push_scope = military_industrial_organization
alias[trigger:any_military_industrial_organization] = {
## cardinality = 0..1
tooltip = localisation
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
include_invisible = no
## cardinality = 0..1
include_invisible = yes
alias_name[trigger] = alias_match_left[trigger]
}
10 changes: 9 additions & 1 deletion Config/triggers_bba.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,12 @@ alias[trigger:pc_is_state_outside_influence_for_winner] = enum[country_tags]

### Compares the amount of turns that have passed during the peace conference with a number.
## scope = any
alias[trigger:pc_turn] = int
alias[trigger:pc_turn] = int

### Check scope unit strength status 0-1: Example unit_strength < 1
## scope = unit
alias[trigger:unit_strength] = variable_field[0..1]

### Check scope unit organization status 0-1: Example unit_organization < 1
## scope = unit
alias[trigger:unit_organization] = variable_field[0..1]
4 changes: 4 additions & 0 deletions Config/triggers_nsb.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,7 @@ alias[trigger:any_country_with_core] = {
### Check if character has specific advisor role
## scope = { character unit_leader }
alias[trigger:has_advisor_role] = enum[allowed_advisor_role]

### Check amount of supply nodes
## scope = country
alias[trigger:num_of_supply_nodes] = int_variable_field
Loading

0 comments on commit 7bfd8fc

Please sign in to comment.