• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Doesn't while do this @ngppgn ? I recently updated the magic system in warhammer to achieve exactly this to enable damage scaling.
 
Doesn't while do this @ngppgn ? I recently updated the magic system in warhammer to achieve exactly this to enable damage scaling.
How so? You mean creating a variable which is counted down each cicle? That'd be less succint and probably less efficient (you have to keep the variable around in memory, since we can't just clear variables.

BTW extra suggestion: a clr_variable = :~ <var name> to wholly clear variablr from an scope.
 
Could we possibly get a move_army or move_unit effect,? What it would do is from a unit scope move the select unit to a saved location scope or to a given scope. This would be really helpful for fantasy mods :D
 
Is there any chance we can get a flag to make government types other than tribals use the population mechanics? I wouldn't mind being able to do some more interesting options for some governments.
 
  • 4
Reactions:
Is there any chance we can get a flag to make government types other than tribals use the population mechanics? I wouldn't mind being able to do some more interesting options for some governments.
Seconded. The population mechanic could be useful for other types of government than nomads.
 
Last edited:
Is there any chance we can get a flag to make government types other than tribals use the population mechanics? I wouldn't mind being able to do some more interesting options for some governments.

Thirded... Though are you refering to population as in horde populations, or do tribals also have a similar mechanic?
 
Thirded... Though are you refering to population as in horde populations, or do tribals also have a similar mechanic?
The nomad mechanics are what I am referring too. Even for the Byzantine for example, being able to trigger the population mechanic rather than levies might be more appropriate for the bureaucratic state, at least at the top level.
 
@Divine, could we get the @ notation of flags also for event targets? Currently, we can do things like set_global_flag = my_flag_@ROOT, and if ROOT has id = 12345 that actually sets flag my_flag_12345. I'd want also be able to do save_(global_)event_target_as = my_target_@ROOT, and if ROOT is 12345, that would save it as (global_)event_targe:my_target_12345.

This will be very useful when you want to use global targets for localisation purpose. For example, save the founder of a dynasty as a global character and then give each descendant a "Line of [founder character]". with this adition we could do that with an arbitrary number of dyntasties, without having to do complicate things, and with arbitrary high number of targets.
 
I don't really see how you can reliably do it for event_targets not without doing dynamic or variable recalling event_targets. Your better off saving the root as a flag to the title they hold, or to an immortal jesus character or someone.
 
I don't really see how you can reliably do it for event_targets not without doing dynamic or variable recalling event_targets. Your better off saving the root as a flag to the title they hold, or to an immortal jesus character or someone.

Sure, but that feature to dynamically create event_target tags would still be useful.

Anyway, as per @Divine directions, here are some suggestions for exatra values for export_to_variable:
Character scope
base <attribute> (the value of the attribute before traits and modifiers; should include fertility and health)
num_of_hospitals
num_of_forts

Province scope
trade_value
num_of_castles
num_of_cities
num_of_temples
num_of_tribals
num_of_nomads (the last two extremely unlikely in vanilla, but might be useful for mods, and also for completeness sake).

Also, some syntactical sugar to make scripting variables and math more handy (I suggest it as additonal syntax, with the old one still usable).
set_variable = { which = x which = y (or value = n) } becomes var:x = var:y / var:x = n
change_variable = { which = x which = y (or value = n) } becomes var:x += var:y / var:x += n
substract_variable = { which = x which = y (or value = n) } becomes var:x -= var:y / var:x -= n
multiply_variable = { which = x which = y (or value = n) } becomes var:x *= vari:y / var:x *= n
divide_variable = { which = x which = y (or value = n) } becomes var:x /= var:y / var:x /= n

As you can see, this already makes things much clearer and readable. the var:<var name> syntax follows the precedent of the syntax for calling event targets.

Furthermore -and this go a bit beyond merely having briefer aliases- I'd wish to have the ability to assiciate operations, to make math event easier to write and read.

So, instead of having

var:x *= var:y
var:z = var:x

we could put merely var:z = ( var:x * var:y ). This could have another benefit: in the current system, to do that simple modification, you need to actually change the value of variable x, multiplying it by variable y, and then set z as the same value as x. I'd like to do something like this
var:x = 2
var:y = 3
var:z = 5
var:z = ( var:x * var:y )
and as a result have z take the value 6 but maintain the original values of x and y.

Also, in the meantime, a clr_variable = { which = <var name> } and has_variable = { which = <var name> } is really needed for housekeeping and sanity checks.
 
Is there any chance we can get a flag to make government types other than tribals use the population mechanics? I wouldn't mind being able to do some more interesting options for some governments.
This is really needed
 
  • 1
Reactions:
This is really needed
Ah yes I typoed there, I mean Nomads not tribals :D But yes, @Divine this one is absolutely needed, So many government types are badly represented by the levies system, giving us a mechanism to control recruitment via a system we can regulate with events while still having the bonuses of buildings would be massive :D
 
Ah yes I typoed there, I mean Nomads not tribals :D But yes, @Divine this one is absolutely needed, So many government types are badly represented by the levies system, giving us a mechanism to control recruitment via a system we can regulate with events while still having the bonuses of buildings would be massive :D

I would settle even with the ability to give troop modifiers to evemt troops (such as archers_morale and so on)
 
Could we please have the number of modifiers available for use in buildings increased? I know local_build_time and local_build_cost have already been requested, but there are some modifiers that iirc worked in past patches - garrison_growth is the main example I recall - that no longer work in current patches. I know local_revolt_risk, while showing in the building tooltip, has no real effect on provincial revolt risk. The modifier levy_reinforce_rate also works very oddly, with a 100% increase only increasing (what I assume to be from experimentation) the base rate of +11 per month, up to +16 per month, rather than the expected +22 per month.

An amazing addition would be something like:

add_garrison = 1200

to add a flat value (in this case 1200) to a holding's garrison. As it stands now, unless there's something I'm missing, there is no way to have fine control over a holding's garrison size and so if I want a unique building that increases a holding's garrison I have to add a ridiculously large garrison_size percentage, which can get annoying later in the game since I just wanted the holding to be a pain to take in the early game, and the percentage increase makes it instead impossible to take all throughout the game.

Other good modifiers to open for buildings would be, imo: global_revolt_risk, vassal_limit, city/castle/church_opinion, infidel_opinion.

As a glitch fix, demesne_size modifiers reducing the demesne size of a character can cause the demesne limit to go below zero and thus roll over to an absurd (around 65000) value. Perhaps cap demesne size minimum to 0 or 1.

EDIT: general_opinion as well would be an awesome addition, perhaps for a "wonder" type building.
 
Last edited:
  • 3
Reactions:
Can we get a flag in traits and titles that enable the character with it to command armies? Sometimes you want a character to be able to lead a flank irrespective of your commander limits. For instance, in the warhammer mod, to use combat magic we require the character to be in command of troops. This is problematic as many mages are pretty low down in martial, and a s a result they will not be a commander. Further complicating things is that the player now has to assign one of the valued commander titles to a mage to give him the ability to use that mage for fighting his war. Being able to appoint realm mages as a custom title, job or having the magic traits confirm the ability would let the player and the a.i have mages in their subunits while good martial commanders lead the flanks and determine the tactics. So @Divine could you please give me some more ways to make my magic engine even more awesome :D
 
@Divine I just saw that HoI4 1.3 is getting if = { limit = {<conditions>} <commands if limit returns true> else= { <commands if limit returns false> } }.

Could you pretty please port this over to CK2? It would be a massive improvement both in succintness and efficiency for situations that now can only be handled by "if = { limit = { <some condition> } <some effect> } if ={ limit = { NOT = {<some condition>} } <some effect> }" whch is less efficient since it requires evaluating the limit twice.
 
  • 1
Reactions:
@Divine I just saw that HoI4 1.3 is getting if = { limit = {<conditions>} <commands if limit returns true> else= { <commands if limit returns false> } }.

Could you pretty please port this over to CK2? It would be a massive improvement both in succintness and efficiency for situations that now can only be handled by "if = { limit = { <some condition> } <some effect> } if ={ limit = { NOT = {<some condition>} } <some effect> }" whch is less efficient since it requires evaluating the limit twice.
Whilst if else would be nice there are way to work around it so I woudl rather time is spent on other things we currently just cannot do. Like adding feminist = yes to a culture (pls)
You can use breaks or if you have things happening after the ifs you can just do if = { limit = { condition_a } effect_a set_character_flag = flag_a } followed by if = { limit = { NOT = { has_character_flag = flag_a } } effect_b } and then clr_character_flag = flag_a at the end of your set of ifs
 
  • 1
Reactions:
Whilst if else would be nice there are way to work around it so I woudl rather time is spent on other things we currently just cannot do. Like adding feminist = yes to a culture (pls)
You can use breaks or if you have things happening after the ifs you can just do if = { limit = { condition_a } effect_a set_character_flag = flag_a } followed by if = { limit = { NOT = { has_character_flag = flag_a } } effect_b } and then clr_character_flag = flag_a at the end of your set of ifs

You cannot use break if the if-clause is nested, since break will exit the whole immediate/option/etc.clause. But I had not thought of your solutions with flags. Smart one (or I'm am a dumb coder hahah), but still the else would be more preferrable.

(and I wouldn't mention it if it wasn't already on another clausewitz game).
 
Can we get a flag in traits and titles that enable the character with it to command armies? Sometimes you want a character to be able to lead a flank irrespective of your commander limits. For instance, in the warhammer mod, to use combat magic we require the character to be in command of troops. This is problematic as many mages are pretty low down in martial, and a s a result they will not be a commander. Further complicating things is that the player now has to assign one of the valued commander titles to a mage to give him the ability to use that mage for fighting his war. Being able to appoint realm mages as a custom title, job or having the magic traits confirm the ability would let the player and the a.i have mages in their subunits while good martial commanders lead the flanks and determine the tactics. So @Divine could you please give me some more ways to make my magic engine even more awesome :D

Do you mean a flag to influence the AI logic to nominate a character rather than another as a commander ?
Because you can already tweak the conditions for commanders via title_commander allowed_to_hold block (traits, titles, ...)