Skip to content

Commit

Permalink
Merge pull request #201 from Kaiserreich/master
Browse files Browse the repository at this point in the history
Update Hoi4 CWTools config - contracts and bugfixes
  • Loading branch information
Pelmen323 authored Jul 17, 2024
2 parents 3e06501 + 30f0da8 commit 82a31ad
Show file tree
Hide file tree
Showing 18 changed files with 389 additions and 225 deletions.
6 changes: 5 additions & 1 deletion Config/common/peace_conference.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,8 @@ alias[trigger:pc_total_score] = int

### Checks if the current scope has the specified amount in current score within the peace conference.
## scope = country
alias[trigger:pc_current_score] = int
alias[trigger:pc_current_score] = int

### Check if state is claimed with a take_states action in conference for TAG. Example: pc_is_state_claimed_and_taken_by = SOV/ROOT/ROOT.FROM"
## scope = state
alias[trigger:pc_is_state_claimed_and_taken_by] = scope[country]
2 changes: 1 addition & 1 deletion Config/common/units.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ types = {

unit = {
## cardinality = 0..1
abbreviation = localisation_inline
abbreviation = scalar
### 3D map asset.
sprite = scalar
#enum[unit_sprites]
Expand Down
39 changes: 31 additions & 8 deletions Config/effects.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,26 @@ alias[effect:set_country_leader_ideology] = enum[sub_ideology]
## scope = country
alias[effect:add_country_leader_trait] = <country_leader_trait>

### Add trait to active country leader.
## scope = country
alias[effect:add_country_leader_trait] = {
trait = <country_leader_trait>
## cardinality = 0..1
ideology = <ideology>
}

### Remove trait from active country leader.
## scope = country
alias[effect:remove_country_leader_trait] = <country_leader_trait>

### Remove trait from active country leader.
## scope = country
alias[effect:remove_country_leader_trait] = {
trait = <country_leader_trait>
## cardinality = 0..1
ideology = <ideology>
}

### Set properties of a political party.
## scope = country
alias[effect:set_political_party] = {
Expand Down Expand Up @@ -828,11 +844,12 @@ alias[effect:puppet] = scope[country]
## scope = country
alias[effect:puppet] = enum[country_tags]

### Puppets specified country.
### Puppets specified country. By default, cancels the puppets existing war relations
## scope = country
alias[effect:puppet] = {
target = scope[country]
target = enum[country_tags]
## cardinality = 0..1
end_wars = bool
## cardinality = 0..1
end_civil_wars = bool
Expand Down Expand Up @@ -1222,6 +1239,8 @@ alias[effect:declare_war_on] = {
}
## cardinality = 0..1
generator = value[array]
## cardinality = 0..1
generator = scope[state]
}

# not used in vanilla or documented in wiki
Expand Down Expand Up @@ -1352,6 +1371,10 @@ alias[effect:create_wargoal] = {
## cardinality = 0..1
generator = owned_states
## cardinality = 0..1
generator = value[array]
## cardinality = 0..1
generator = scope[state]
## cardinality = 0..1
expire = date_field
## cardinality = 0..1
expire = int
Expand Down Expand Up @@ -1506,6 +1529,13 @@ alias[effect:set_rule] = {
desc = localisation
}

### Clears rule added by set_rule. In the example it will clear can_not_declare_war = yes set by set_rule: clear_rule = { can_not_declare_war = yes }
## scope = country
alias[effect:clear_rule] = {
## cardinality = 1..inf
enum[game_rules] = bool
}

### Adds rule to country's party.
## scope = country
alias[effect:set_party_rule] = {
Expand Down Expand Up @@ -2387,13 +2417,6 @@ alias[effect:modify_unit_leader_flag] = {
## scope = { unit_leader character }
alias[effect:clr_unit_leader_flag] = value[leader_flag]

### Sets the country that owns current scope general.
## scope = { character unit_leader }
alias[effect:set_nationality] = scope[country]
### Sets the country that owns current scope general.
## scope = { character unit_leader }
alias[effect:set_nationality] = enum[country_tags]

### Demotes field marshal to general.
## scope = { character unit_leader }
alias[effect:demote_leader] = yes
Expand Down
50 changes: 50 additions & 0 deletions Config/effects_aat.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,53 @@ alias[effect:give_market_access] = enum[country_tags]
### Give market access to x
## scope = country
alias[effect:give_market_access] = scope[country]

### Creates a purchase contract between the countries
## scope = any
alias[effect:create_purchase_contract] = {
seller = scope[country]
buyer = scope[country]
civilian_factories = int
## cardinality = 1..inf
equipment = {
type = enum[equipment_bonus_type]
amount = int
}
}

### Cancels the scoped purchase contract
## scope = purchase_contract
alias[effect:cancel_purchase_contract] = yes

### Executes children effects on a random purchase contract of the country in scope, that fulfills the "limit" trigger. tooltip = key need to be added to override the tooltip title
## scope = country
## push_scope = purchase_contract
alias[effect:random_purchase_contract] = {
### Override the tooltip title
## cardinality = 0..1
tooltip = localisation
## cardinality = 0..1
limit = {
alias_name[trigger] = alias_match_left[trigger]
}
alias_name[effect] = alias_match_left[effect]
}

### Executes children effects on every purchase contract (or "random_select_amount" of random purchase contracts if specified) of the country in scope, that fulfills the "limit" trigger. tooltip = key need to be added to override the tooltip title
## scope = country
## push_scope = purchase_contract
alias[effect:every_purchase_contract] = {
### Override the tooltip title
## cardinality = 0..1
tooltip = localisation
### Apply the effect to this number of randomly selected entities
## cardinality = 0..1
random_select_amount = int[1..inf]
## cardinality = 0..1
display_individual_scopes = bool
## cardinality = 0..1
limit = {
alias_name[trigger] = alias_match_left[trigger]
}
alias_name[effect] = alias_match_left[effect]
}
51 changes: 7 additions & 44 deletions Config/effects_new.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,12 @@ alias[effect:gain_xp] = variable_field
###Delete units of a country. No tooltip is generated.
## scopes = { COUNTRY }
alias[effect:delete_unit] = {
## error_if_only_match = "template" is replaced with "division_template" in docs, proceed with caution
## severity = warning
## cardinality = 0..1
template = scalar
## cardinality = 0..1
id = variable_field
## cardinality = 0..1
state = <state>
## cardinality = 0..1
state = scope[state]
## cardinality = 0..1
disband = bool
}

###Delete units of a country. No tooltip is generated.
## scopes = { COUNTRY }
alias[effect:delete_unit] = {
## cardinality = 0..1
template = scalar
## cardinality = 0..1
id = variable_field
state = <state>
state = scope[state]
## cardinality = 0..1
disband = bool
}


###Delete units of a country. No tooltip is generated.
## scopes = { COUNTRY }
alias[effect:delete_unit] = {
## cardinality = 0..1
template = scalar
division_template = scalar
## cardinality = 0..1
id = variable_field
## cardinality = 0..1
Expand Down Expand Up @@ -127,6 +102,10 @@ alias[effect:create_operative_leader] = {
female = bool
## cardinality = 0..1
skill = int
## cardinality = 0..1
gender = male
## cardinality = 0..1
gender = female
}

###Capture an operative. Can be used from a scope and a target that is either a country or a unit leader.
Expand Down Expand Up @@ -1223,22 +1202,6 @@ alias[effect:randomize_temp_variable] = {
lambda = variable_field_32
}

###Sets a temp variable to a random value.
## scopes = { any }
alias[effect:set_temp_variable_to_random] = value_set[variable]

###Sets a temp variable to a random value.
## scopes = { any }
alias[effect:set_temp_variable_to_random] = {
var = value_set[variable]
## cardinality = 0..1
min = variable_field_32
## cardinality = 0..1
max = variable_field_32
## cardinality = 0..1
integer = bool
}

###Add divisional commander xp to unit
## scopes = { any }
alias[effect:add_divisional_commander_xp] = int
100 changes: 57 additions & 43 deletions Config/effects_nsb.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,6 @@ alias[effect:add_advisor_role] = {
name = localisation
## cardinality = 0..1
desc = localisation
## replace_scope = { this = character root = country }
## cardinality = 0..1
allowed = {
## cardinality = ~1..inf
alias_name[trigger] = alias_match_left[trigger]
}
## replace_scope = { this = character root = country }
## cardinality = 0..1
visible = {
## cardinality = ~1..inf
alias_name[trigger] = alias_match_left[trigger]
}
## replace_scope = { this = character root = country }
## cardinality = 0..1
available = {
## cardinality = ~1..inf
alias_name[trigger] = alias_match_left[trigger]
}
### Sets advsior effects.
## cardinality = ~1..1
traits = {
Expand All @@ -414,22 +396,6 @@ alias[effect:add_advisor_role] = {
enum[base_factor] = variable_field
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}
## replace_scope = { this = character root = country }
## cardinality = 0..inf
on_add = {
alias_name[effect] = alias_match_left[effect]
}
## replace_scope = { this = character root = country }
## cardinality = 0..inf
on_remove = {
alias_name[effect] = alias_match_left[effect]
}
### While it is used in vanilla and doesn't throw errors, I can't get it to work reliably so I suspect there is some hard-coded strangeness going on here.
## replace_scope = { this = character root = country }
## cardinality = 0..1
do_effect = {
alias_name[trigger] = alias_match_left[trigger]
}
### Modifiers that are applied to tag while the advisor is active.
## replace_scope = { this = character root = country }
## cardinality = 0..1
Expand Down Expand Up @@ -646,8 +612,8 @@ alias[effect:remove_trait] = {
slot = value[character_advisor_slot]
}

### Transfers character from scope country to target_country
## scope = { country }
### Transfer from one country to another for the character in scope. Note that this is not related to operative nationalities added via add_nationality. Note that for operative, this will temporarily lock their slot on the country of origin
## scope = { country character unit_leader operative }
alias[effect:set_nationality] = {
target_country = scope[country]
target_country = enum[country_tags]
Expand All @@ -659,18 +625,18 @@ alias[effect:set_nationality] = {
character = scope[character]
}

### Transfers scoped character from PREV country to target
### Transfer from one country to another for the character in scope. Note that this is not related to operative nationalities added via add_nationality. Note that for operative, this will temporarily lock their slot on the country of origin
## scope = { character unit_leader operative }
alias[effect:set_nationality] = scope[country]

### Transfers scoped character from PREV country to target
### Transfer from one country to another for the character in scope. Note that this is not related to operative nationalities added via add_nationality. Note that for operative, this will temporarily lock their slot on the country of origin
## scope = { character unit_leader operative }
alias[effect:set_nationality] = {
target_country = scope[country]
target_country = enum[country_tags]
}

### Transfers scoped character from PREV country to target
### Transfer from one country to another for the character in scope. Note that this is not related to operative nationalities added via add_nationality. Note that for operative, this will temporarily lock their slot on the country of origin
## scope = { character unit_leader operative }
alias[effect:set_nationality] = enum[country_tags]

Expand Down Expand Up @@ -959,10 +925,10 @@ alias[effect:create_entity] = {
visible = <scripted_trigger>
}

### Deletes an entity
### Destroys an existing entity
### IDs are set by the create_entity effect.
## scope = any
alias[effect:set_entity_movement] = value[entity_id]
alias[effect:destroy_entity] = value[entity_id]

### Sets the position and rotation of an entity using two coordinates.
### IDs are set by the create_entity effect. Uses the the same coordinate system that the map uses.
Expand All @@ -986,7 +952,7 @@ alias[effect:set_entity_movement] = {
### Sets the position of an existing entity.
### IDs are set by the create_entity effect. Uses the the same coordinate system that the map uses.
## scope = any
alias[effect:set_entity_position ] = {
alias[effect:set_entity_position] = {
id = value[entity_id]
x = float
y = float
Expand Down Expand Up @@ -1019,4 +985,52 @@ alias[effect:set_entity_scale] = {
alias[effect:set_entity_animation] = {
id = value[entity_id]
animation = <model_animation>
}
}

### Sets a variable to the number of supply vehicles in stockpile or that are needed
## scope = country
alias[effect:get_supply_vehicles] = {
var = value_set[variable]
type = truck
type = train
### default no. If yes, gets the number of needed vehicles
## cardinality = 0..1
need = yes
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
need = no
}

### Sets a temp variable to the number of supply vehicles in stockpile or that are needed
## scope = country
alias[effect:get_supply_vehicles_temp] = {
var = value_set[variable]
type = truck
type = train
### default no. If yes, gets the number of needed vehicles
## cardinality = 0..1
need = yes
## error_if_only_match = This is the default value and can be omitted
## severity = info
## cardinality = 0..1
need = no
}

### Executes children effects on random characters that fulfills the "limit" trigger.Has to use has_ideology in limit to determine the party (with ideology group). tooltip=key can be added to override tooltip title
## scope = country
## push_scope = character
alias[effect:party_leader] = {
## cardinality = 0..1
tooltip = localisation
### Documentation suggests to use has_ideology trigger here
## cardinality = 0..1
limit = {
has_ideology = enum[sub_ideology]
}
alias_name[effect] = alias_match_left[effect]
}

### Teleport the target country's railway guns to the province to which railway guns are deployed
## scope = country
alias[effect:teleport_railway_guns_to_deploy_province] = scope[country]
Loading

0 comments on commit 82a31ad

Please sign in to comment.