Skip to content

Commit

Permalink
Add basic validation to division_template variable - still no validat…
Browse files Browse the repository at this point in the history
…ion for create_unit effect
  • Loading branch information
Pelmen323 committed Dec 7, 2024
1 parent a9858a1 commit d930ead
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Config/effects.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ alias[effect:randomize_weather] = int
### Adds a division template to country.
## scope = country
alias[effect:division_template] = {
name = localisation_inline
name = value_set[division_template_name]
## cardinality = 0..1
division_names_group = <division_name>
## cardinality = 0..1
Expand Down Expand Up @@ -682,7 +682,7 @@ alias[effect:division_template] = {
### Adds units to a division template.
## scope = country
alias[effect:add_units_to_division_template] = {
template_name = localisation_inline
template_name = value[division_template_name]
## cardinality = 0..1
regiments = {
## cardinality = 1..25
Expand Down Expand Up @@ -2997,35 +2997,35 @@ alias[effect:cancel_border_war] = {
### Set lock status for a division template.
## scope = country
alias[effect:set_division_template_lock] = {
division_template = localisation_inline
division_template = value[division_template_name]
is_locked = bool
}

### Set cap for a division template.
## scope = country
alias[effect:set_division_template_cap] = {
division_template = localisation_inline
division_template = value[division_template_name]
division_cap = int_variable_field
}

### Remove cap for a division template.
## scope = country
alias[effect:clear_division_template_cap] = {
division_template = localisation_inline
division_template = value[division_template_name]
}

### Set division template to allow force recruiting. force_allow_recruiting defaults to true if unset
## scope = country
alias[effect:set_division_force_allow_recruiting] = {
division_template = localisation_inline
division_template = value[division_template_name]
## cardinality = 0..1
force_allow_recruiting = bool
}

### Delete a template and its units.
## scope = country
alias[effect:delete_unit_template_and_units] = {
division_template = localisation_inline
division_template = value[division_template_name]
## cardinality = 0..1
disband = bool
}
Expand Down
2 changes: 1 addition & 1 deletion Config/effects_bba.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ alias[effect:random_state_division] = {
### Change divisions in scope to selected template
## scope = unit
alias[effect:change_division_template] = {
division_template = localisation_inline
division_template = value[division_template_name]
}

### Set unit org to a specific value
Expand Down
2 changes: 1 addition & 1 deletion Config/effects_gtd.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ alias[effect:every_scientist] = {
alias[effect:create_colonial_division_template] = {
subject = scope[country] # Country tag
division_template = {
name = scalar
name = value_set[division_template_name]
## cardinality = 0..1
division_names_group = <division_name>
## cardinality = 0..1
Expand Down
4 changes: 2 additions & 2 deletions Config/effects_new.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ alias[effect:delete_unit] = {
## cardinality = 0..1
template = scalar
## cardinality = 0..1
division_template = scalar
division_template = value[division_template_name]
## cardinality = 0..1
id = variable_field
## cardinality = 0..1
Expand Down Expand Up @@ -548,7 +548,7 @@ alias[effect:add_decryption] = {
###Deletes units that uses a specific template.
## scope = { COUNTRY }
alias[effect:delete_units] = {
division_template = scalar
division_template = value[division_template_name]
## cardinality = 0..1
disband = bool
}
Expand Down
5 changes: 4 additions & 1 deletion Config/effects_nsb.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,10 @@ alias[effect:damage_units] = {
ratio = bool
### you can limit army templates
## cardinality = 0..1
template = localisation_inline
template = value[division_template_name]
### you can limit army templates
## cardinality = 0..1
division_template = value[division_template_name]
### Damage armies
## cardinality = 0..1
army = bool
Expand Down
4 changes: 2 additions & 2 deletions Config/history/oobs.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ oob = {

## cardinality = 0..inf
division_template = {
name = scalar
name = value_set[division_template_name]
## cardinality = 0..1
division_names_group = <division_name>
## cardinality = 0..1
Expand Down Expand Up @@ -76,7 +76,7 @@ oob = {
name_order = int
}
location = enum[provinces]
division_template = scalar
division_template = value[division_template_name]
### Defines a unique name for this unit's division commander
## cardinality = 0..1
unique = {
Expand Down
2 changes: 1 addition & 1 deletion Config/triggers.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ alias[trigger:num_tech_sharing_groups] = int

### Check if country has a division template of specific name.
## scope = country
alias[trigger:has_template] = scalar
alias[trigger:has_template] = value[division_template_name]

### Check if state has a specific state category.
## scope = state
Expand Down

0 comments on commit d930ead

Please sign in to comment.