• 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.
Showing developer posts only. Show all posts in this thread.
Speaking of things already in the game, is there a list of what values can be exported to variables?

If health and wealth aren't on that, I'd like to request that they be added (though I might have requested that before - I'm not sure)
This is not the place for questions, keep them in the quick questions thread. Though I to answer your question anyway the following are in:
Code:
martial
diplomacy
intrigue
stewardship
learning
base_health
demesne_efficiency
decadence
dynasty_realm_power
fertility
infamy
mercenary_siphon_factor
monthly_income
plot_power
population_factor
relative_power_to_liege
religion_authority
revolt_risk
scaled_wealth
treasury/wealth
yearly_income
age
ai_ambition
ai_greed
ai_honor
ai_rationality
ai_zeal
among_most_powerful_vassals
combat_rating
demesne_garrison_size
demesne_size
health_traits
imprisoned_days
lifestyle_traits
max_manpower
num_fitting_characters_for_title
num_of_baron_titles
num_of_buildings
num_of_children
num_of_claims
num_of_consorts
num_of_count_titles
num_of_count_titles_in_realm
num_of_duke_titles
num_of_dynasty_members
num_of_emperor_titles
num_of_empty_holdings
num_of_extra_landed_titles
num_of_feuds
num_of_friends
num_of_holy_sites
num_of_king_titles
num_of_lovers
num_of_max_settlements
num_of_plot_backers
num_of_prisoners
num_of_rivals
num_of_settlements
num_of_subrealm_castles
num_of_subrealm_cities
num_of_spouses
num_of_titles
num_of_trade_posts
num_of_traits
num_of_unique_dynasty_vassals
num_of_vassals
over_max_demesne_size
over_vassal_limit
personality_traits
piety
population
population_and_manpower
prestige
realm_diplomacy
realm_intrigue
realm_learning
realm_martial
realm_stewardship
realm_levies
realm_levies_plus_allies
max_realm_levies
realm_size
republic_total_num_of_trade_posts
ruled_years
score
unused_manpower
retinue_points_max
retinue_points_used
retinue_points_free
total_tax_value
holding_tax_value
dynastic_prestige
society_currency
So in your case you can use treasury or wealth to export the amount of gold they have.
Base health will export their natural health before modifications form traits etc. There is currently no way to export overall health but the suggestion is noted :)
 
@blackninja9939

I bumped it because I never got a response, not to bring attention back to it. I was hoping for a response, which you gave to several other people
My response means little, I am not the one implementing anything... ;)
My responses have been telling people work arounds for their requests or if they are already in game :)
Also no response does not equal not seen by anyone.
 
On a different note (and whoops double post), the wiki page is not very up to date for what is in vs not in through the different sections.

If someone has time and feels like it then going though and organising the page for what is actually in the current would be greatly appreciated and make it a lot easier for us to see look through it as currently there is a smattering of things in various request sections that have already been implemented.

If not then no worries! :)
 
Might give it a try in a couple days (will be passing four hours in a train so I need a passtime) but haven't ever contributed to any wiki ever. Are there any guideline out there on how to properly do that?
Not really that I know of, the categories on the suggestions page are all set up already it is just moving the various bullet points into the implemented in version x/future version categories that is needed to be done. As scrolling through it briefly I spotted some things that are definitely already in the game.
Any other edits to make it more readable is down to the editor really, I do not know if the wiki has any special rules for it
 
Avaibility to set a character to a certain court. Would work something like this:
1125.1.1 = {
set_court = k_france
}

Maybe even council positions and commander spots
You can already set a characters employer which does what you are asking for but on a character basis instead, unless I am missing something else you want.
For job positions or commander just do it in an effect block.
 
I am 99% sure we are on a much older GUI system than HoI4, trying to smash that new system into CK2 sounds like it would be quite difficult and time consuming.
 
Q1: Is it "difficult" to make a console command available to events? For instance, a fountain of youth event needs a way to negatively age a character. Via console that is simply: age <char_id> <int>. On that same track, we were recently gifted with the much needed cancel_pregnancy = yes effect. Opening up the console command give_birth <char_id> and making some sort of <scope> = { give_birth = yes } effect to go along with that would be incredibly useful.
You are looking at this the wrong way round in your bullet point, making console commands usable in events will not work (totally different systems) but making effect versions of a console command is perfectly fine nor particularly difficult at all.

Q2: Would it be difficult to code in resurrection mechanics?
I would envision something simple such as:
<scope_even_if_dead> = { death = no } but I have no idea how much back-end code such a thing would require. A (possibly easier?) alternative and one that is perhaps even more useful in more situations would be a "copy_character" command that creates a new character with all the stored values of the source character.
Very, we store a lot of things in what we call the life data and upon killing someone we obviously remove that life data so as to keep saves a reasonable size. We have no way to re-access that life data and we are not going to change be storing all that in saves.
Copying characters to copy their look and traits etc. would be fine as that is all preserved when someone dies anyway.


Q3: Is there anything that tracks how many unborn children a person has? If it doesn't exist already, I'm not sure if it would be worth the time to code it in since I doubt there are many who use
unsafe_impregnate in the first place. If, however, it does already exist or it is insanely easy to do, would it be difficult to expose to events?
Off the top of my head, not sure where but we will definitely track it so we can then know how many and what kids to create upon giving birth.

Q4: Can the static variables (such as those in defines) be accessed in scripts? I have asked in other places before and never received an answer
Nope, those are only referenced by the code
 
Would it be possible to get a 'force_age' or 'birth_age' setting for history/characters (and perhaps a related 'display_age' for bookmarks)? I'm working with a 1.1.1 start, and rulers defined for that start have to have a 1.1.1 start (unless I'm missing something, trying negatives did not work?), making them newborns. It'd be useful to be able to do something like...
Code:
1.1.1 = {
   birth = yes
   effect = {
       force_age = 25
    }
}

which would then make the game force that character to be 25, and treat them accordingly. Not sure how much demand there'd be overall, however :/
(A command version might also make a useful alternative to immortality, allowing a character to be made younger... But maybe that'd break the life data mentioned above?)
That would still do nothing about what you want.
if they are born in year 1 then you set them to be 25 that does not make them still born in year 1, it would push their birth date to be in the year -25 (-24 more likely as 0 will count as a year as our date class is just a wrapper for an integer I believe)
So you will still get the issues of a negative date not being supported.
 
Sorry to bother again but would my suggestion be feasible? What I meant is an opinion_modifier for not being in de_jure territory so that I can use a penalty to opinion for vassals outside of it.
Not sure, not checked out the de jure system much, is probably possible
 
Thanks for the reply. :)
Could something like an 'offset' for age work, then? Or would that require too big a change to the game?
Like "GameAge = RealAge + AgeOffset" (so a character would still be '1' in RealAge, but look 1+20 and be treated as such by anything that checks their age?
That would probably be too big of a change, age gets referenced in a lot of places in the code

A work around I've found for that is a combination of "create_character" and "inherit". It's not exactly the best (hence why I'd like a better solution), but it can work OK.

On starting the Game in a suitable era, Scope to the character, create a new character with the 'real' data you want, and then inherit+kill the historical character. If it's done right, it even works for the player character.
That will also still likely have issues I mentioned before with negative birth dates


I honestly don't understand why you are doing this anyway, just have for the purpose of your mod the year 3001 be your first year, that way you can just use pre 3000 dates for negative dates (sure you'll end up with year 0 but eh that is not really an issue). This is what we did in AGOT but with the year 8000.
There is no downside except for the fact when people see under 3000 they have to mentally think ok this is BC or the equivalent for your mod's time period, and if you just put a disclaimer for that in the game start pop up it should be easy enough to understand.
 
That makes me wonder how dates are gonna be done in Imperator. If Cds need to convert BC dates into AUC or something similar... I wouldn't want to be in their shoes.

Now, how is "age being referenced in multiple places" an issue? You just need to have a GetAge() method/accessor/whatever you call it in cpp and make the tweak there once...
Except there is definitely places that check the variable directly when they instead mean to be using GetAge, as when that method was first made it purely returned the variable without modifying the output of GetAge to be anything but the age member variable.
Combined with then having to pick and choose what places should use the masking vs which should just use the real age. Not worth the time when there is a perfectly easy workaround in the script, not ideal workaround but has no real downsides and it is used in the big mods anyway.
 
That is a good point. 10001 would work as well, with the added benefit that it is easier to people to just mentally put an 1 in front of the year, and that it is actually a calendar that exists in reality (the so-called "Human Era").

The only issue I've found with dates 10000 and over is that all buildings start off constructed, but that can be solved by using "has_game_started = yes" in the potential. And doing so doesn't break buildings being automatically present on start due to tech, either. It would be nice if that issue were fixed in the engine, though, if that is feasible. Do you know if there would be other problems with dates over 9999?
Not part of the engine that is game level.
Not looked much into that but I would assume it is less about the year being over 9999 and more that you need to fix up your tech history which would auto build buildings where possible. If that still has issues then just use a lower year
 
Unlikely to be done purely as maintaining that from our end would be a right pain and whenever we show things in the UI having something say "can hold a blot" instead of "is norse or reformed norse" is bad and uninformative.

It is not that hard to win-merge or beyond compare your mod to the vanilla patches.

Sure it is still a bit hard on mod-mod compatibility but on that front this is the least of people's problems :oops:
 
Yeah, I understand that something like "Can hold a blot" way too much of a corner case.
But any comment on my post on the previous page? Those things are much more in line with existing functionality, and the current scripted implementation is an ugly hack at best.

Currently, the Cathar/Messalian "Women may hold all councillor positions" is hardcoded into the respective scripted triggers, which is horrible for extensibility. Any mod wishing to add/remove from that that list, or to add that function to a custom religion, will need to overwrite the entire 00_scripted_triggers.txt, which is obviously beyond terrible for compatibility.
If, instead, we had the religion-level flag(s) (and the respective trigger) analogous to the existing feminist = yes/noand female_temple_holders = yes/no flags (and triggers), this would be a lot easier to extend.

Likewise, the true cognatic succession law is hardcoded to check for Basque/Zhangzhung/Sumpa culture or Cathar/Messalian/Mazdaki religion, requiring overwriting of succession_laws.txt to extend it, which is obviously anything but ideal. Also likewise, having religion/culture level flags and triggers instead would be a major improvement.
By pure definition these things are not hardcoded. They are in the script so you can override them, yes that means you have to override the entire file as we do not have key name based overrides for most things.

Adding a toggle for this into the code makes no real sense to me, why move something into the code when it has no code interactions but just goes on in the script?

Sure you will need to do com-patches with other mods, but that is better than moving functionality and checks into the code when they can easily be done in the script itself in my view at least.
 
I meant "hardcoded" as in "the script compares the religion scope to a fixed value" instead of some dynamic trigger.

And well, I just feel it would be a lot cleaner, for example, if we replaced the religion checks in can_be_marshal_trigger with a simple religion_allows_female_marshal = yes, to just do
Code:
my_custom_religion_group = {
my_custom_religion = {
    [...]
    allows_female_marshal = yes
    [...]
}
}
which would be compatible with pretty much anything ever, rather than mess with a vanilla file that might also be overridden by who-knows-how-many other mods, which is an annoyance to both the author as well as any potential user.

It would also allow me to check for this property (in an event, for example) in a way that is forward-compatible with any future or mod-added religions without even needing to know about their existence. If this flag could be set from a script, we could even easily make it a potential change in reforming or otherwise dynamically altering your religion.

But, well, if you feel that adding this feature would not be worthwhile, then I suppose there's not much I can do about that  ̄\_(ツ)_/ ̄
Would also have to have us handle any modded in council positions and minor titles that can be voter titles. So not just a quick thing, but also not something I think would have that large a pay off either.
 
Could we have an "on_become_unlanded" on_action? would be really useful.

Also this is probably a bug, custom_tooltip does not work in an artifact's effect block, but works in the active and allowed_gift blocks.
Artifacts do not have an effect block, they have a list of modifiers. allowed_gift is a specific block opening a trigger so that can take custom tooltips. But the default modifier block cannot as custom tooltip does not work anywhere with modifier lists,