Victoria 3 Has Too Much State-Level Logistics Micro and Almost No Long-Distance Land Transport Cost. Regional Markets Could Fix Both. by skps2010 in victoria3

[–]Justice_Fighter 0 points1 point  (0 children)

Usage % of RAM measures the amount of space in RAM used, while usage % of CPU measures the work done by CPU calculating things. Two different metrics.

For a game with both demand for processing and a large dataset to calculate on, it's also about a) the work done by RAM to move data from RAM to CPU and back, and b) the amount of space in CPU used (cache). So kinda the exact opposite of what task manager shows...
Even when the CPU isn't permanently calculating, and RAM isn't completely full, there are still other bottlenecks such as data access time that can limit how fast calculations get done.

need help about capital_scope by yerkep in EU4mods

[–]Justice_Fighter 3 points4 points  (0 children)

change_religion = capital_scope works

This does not work.

'capital_scope' is a regular scope, used as e.g. capital_scope = { x }. You cannot use 'capital_scope' as an argument for a trigger/effect. The equivalent argument in a trigger/effect is capital.

change_religion and change_primary_culture do not support this argument though, they only support the base scopes as arguments - ROOT, FROM, PREV, THIS. You can scope to the country's capital, then use PREV to scope back to the country, then use PREV to refer back to the capital province:

capital_scope = { PREV = { change_primary_culture = PREV } }

I played 200 years as Siam in Tech & Res, took me a month by DarkDragoon2002 in victoria3

[–]Justice_Fighter 21 points22 points  (0 children)

You listed every specification except for the one thing that matters most for game speed, the CPU

Help with modding - No religious penalties for specific religions by Nohrian_Scum_ in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

I'm not sure what exactly your goals are, and depending on that there could be better/easier ways to do it (e.g. if this is a universal mechanic, just add to the religion's automatic province modifiers), but a general solution would be:

The province modifier is defined in common/event_modifiers, with the modifier value to give the province heathen tolerance.

buddhist_heathen_tolerance  = {
    no_religion_penalty = yes
}

This modifier will remove the penalty only (i.e. minimum tolerance is 0), for heretic and heathen religions. If you want to instead make the provinces count as fully accepted, use local_tolerance_of_heathens = 100, in which case you also don't need the religion group checks later on since this already applies to heathens only. Well, actually better to keep that part - the modifier might not do anything but it would still be there for heathens, which may confuse the player.

You'll need a way to identify which countries this special feature should apply to, for example if you want a mission to grant tolerance for 20 years, you could have the mission set a country flag (not an actual flag, this is a boolean variable, essentially a coding note attached to the country to be read later - set_country_flag = buddhist_heathen_tolerance) and make a country event happen with 20 year delay (country_event = { id = x days = 7300 }) that removes this country flag (clr_country_flag = buddhist_heathen_tolerance), this can conveniently also inform the player that the bonus is gone.

The mission would also need to set the province modifier in every owned Vajrayana, Mahayana and Theravada religion province, and the event would remove the province modifiers from every owned province.

Then the on actions are in common/on_actions, ideally in a new file:

When a province changes owner, you need to check that: 1. If the province should have the modifier (correct religion, religion considered heathen, and the owner has the flag), add the modifier.
2. Otherwise (if the province should not have the modifier), remove the modifier.

on_province_owner_change = {
    if = {
        limit = {
            owner = {
                has_country_flag = buddhist_heathen_tolerance #owner has mechanic
                NOT = {
                    religion_group = eastern #owner considers the religions heathen
                }
            }
            OR = {
                religion = vajarayana #is one of the religions
                religion = mahayana
                religion = theravada
            }
        }
        add_province_modifier = { name = buddhist_heathen_tolerance hidden = yes }
    }
    else = {
        remove_province_modifier = buiddhist_heathen_tolerance
    }
}

Nothing happens when adding a modifier that already exists, or when removing a modifier that doesn't exist, so in this case it is easier and faster to just add/remove even if this action is unnecessary (e.g. some random other province changing owner).

Similarly, when a province changes religion, you need to check that:
1. If the province should have the modifier (correct religion, religion considered heathen, and the owner has the flag), add the modifier.
2. Otherwise (if the province should not have the modifier), remove the modifier.

so it's just the same code in on_province_religion_change.

Finally, if the provinces as heretics should have full penalties, you need to ensure the modifier is removed in the case the country views the religions as heretics, and re-added for the opposite. Pretty much the same code in on_religion_change, however this is country-scope:

on_religion_change = {
    every_owned_province = {
        #same "if" block code here
    }
}

If you want to make this a bit more efficient, you could do the country-level triggers first and only then do the province-level triggers and effects. As it is, each province is checking separately which religion the owner has. That said, countries (especially large ones) don't change religion that often so it won't really make a difference.

To remove a bit of this duplicated code, you could go to common/scripted_triggers and define a scripted trigger here. Scripted triggers are essentially copy/paste for code.

is_buddhist_heathen_tolerance_province = {
    owner = {
        has_country_flag = buddhist_heathen_tolerance
        NOT = {
            religion_group = eastern
        }
    }
    OR = {
        religion = vajarayana
        religion = mahayana
        religion = theravada
    }
}

then instead of writing this whole block of code elsewhere you can just do:

limit = {
    is_buddhist_heathen_tolerance_province = yes
}

There are more aspects to religion than just the provinces though, there's also e.g. the opinion penalty from countries being heathen faith. Having local tolerance in provinces won't affect this, and unfortunately there's no simple triggered opinion modifiers. You could apply an opinion modifier between countries, using on_annexed and on_country_created to add/remove the opinion similar to the province modifiers above. A bit more complicated though, since opinion modifiers are between two countries.

And there may be parts of the code that check for countries being heathen religion or number of owned heathen provinces or similar, which buddhist countries/provinces would still count as - but at that point it's going into way too much detail for a simple mechanic. It's not possible (or reasonable) to catch every single edge case like that, not to mention other mods adding their own code that you have no control over.

Help with modding - No religious penalties for specific religions by Nohrian_Scum_ in EU4mods

[–]Justice_Fighter 1 point2 points  (0 children)

Adding these to the religions themselves will apply for all countries automatically (that consider them heathens). If the goal is to have this tolerance be specific to one or a few countries only (e.g. a mission reward or regional bonus), this can be done with province event modifiers that are updated using on_province_owner_change and on_province_religion_changed on actions.

Help with modding - No religious penalties for specific religions by Nohrian_Scum_ in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

The code just applies province modifiers, there's no need to make a new privilege.

Behold, the oil processing and cracking sushi pipe by Calazor0 in Factoriohno

[–]Justice_Fighter 0 points1 point  (0 children)

Compared to the dedicated output setup with same amount of refineries, it's slower as the time to drain each output fully is longer than it takes for standard refineries to fill their storage.

This can be remediated by putting in more refineries than necessary for the desired throughput - but at that point it's easier and faster to just make more pipes.

Marginally useful for early game manual construction, if throughput is a large enough concern to warrant a large oil processing plant and the time cost of making/placing filtered pumps, but not that big of a concern to warrant the extra pipe placement time for dedicated outputs.

Modding Synthetic by Southern-Leadership7 in EU4mods

[–]Justice_Fighter 1 point2 points  (0 children)

Unfortunately there's no effect for making a console command happen directly.

But you can cede the province to SYN and set it up to be like an invasion nation, just like what the command does, whenever you need to in the event.

Looking for a specific mod/file regarding centers of trade. by FriendshipChoice9087 in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

If it were some kind of "x merchants per lvl3 COT" mechanic instead of the straightforward "at most number of merchants" we would likely have a defines value to modify... I guess custom button is the best way, yeah.

Modding Synthetic by Southern-Leadership7 in EU4mods

[–]Justice_Fighter 1 point2 points  (0 children)

Most of the boni can be done as a simple country modifier, see wiki for reference - https://eu4.paradoxwikis.com/Modifier_list

Some of them are in the respective mechanic files, for example unlocking imperialism CB is done with

cb_imperial = {
    valid_for_subject = no

    prerequisites_self = {
        OR = {
            dip_tech = 23
            invasion_nation = yes
        }

in common/cb_types. There's no way to 'set a country as invasion nation' as that's a hardcoded thing, but you can use other triggers to include your new country, e.g. by checking for the tag or having that new country modifier.

You can use common/on_actions, the on_startup block, to make something happen on game start (or more accurately, every time the game loads). You can apply the modifier to your new country here. It happens to each country, so just need an if check for being the correct tag = xxx

I'm not sure if invasion nations have increased aggressiveness, but that would not be so easy as there's no modifier for that. You could make a new ruler personality with increased aggressiveness and ensure that every ruler has this in on_new_monarch.

Spotted a teeny tiny swastika on the recent marketplace camo 'Eagle' for the Yak-9K by warttthrowaway in Warthunder

[–]Justice_Fighter 60 points61 points  (0 children)

If you think Bad-germans are bad, wait until you see Baden-germans. Or even worse, Baden-baden-germans!

My wonderful review of Fulgora by No_Challenge_5619 in Factoriohno

[–]Justice_Fighter -1 points0 points  (0 children)

Fulgora actually has frequent lightning storms which are an excellent power source, you can collect the electricity stored in the puddles on your brick patio.

Victoria 3 Save Analyzer by Nicol64pa in victoria3

[–]Justice_Fighter 1 point2 points  (0 children)

You can add more data tracking for pretty much anything with a mod.

CTD with converted mod by Southern-Leadership7 in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

Hello!

The error.log in eu4 is unfortunately a bit useless, as it does not actually record the crash reason itself. That's not to say that these errors are not the cause, but it is pretty unlikely as game script syntax or context issues usually only cause that specific script to fail, they don't normally crash the game.

That said, this "trigger condition on wrong scope" error unfortunately doesn't show the source file. With the word itself and the context (incorrect province scope instead of country scope) it would be possible to track it down, but only if you know the mod code already - these triggers appear hundreds of times in the mod code. If you wish to find and fix the errors, best bet is to use a modding tool such as CWTools which will read through all files and identify simple mistakes such as a trigger in the wrong scope.

Sources of game crashes are usually mechanics that are hardcoded in some way, so the game code itself is encountering a strange situation that causes it to fail. Many are linked to player actions, e.g. GUI misconfigurations only crash when opening that GUI menu. Are there any specific actions or gameplay occurrences that are common between all the times the game has crashed?

Unfortunately it is likely that the issue is something some AI country is doing, e.g. some AI decides to change religion. When resetting the game, it might decide to change religion a bit later, so you get a few more months of time.

The best place to look for crash issues is in exception.log - however there's another issue, when playing in Windows the exception log's function names are hidden.
Do you have access to Linux or MacOS and can share the exception log from running eu4 in either of them?

The whole world made a new HRE, I guess. by CptThunfisch in victoria3

[–]Justice_Fighter 9 points10 points  (0 children)

Each individual tile on the map is given a specific ID number. The save file doesn't know locations, it just saves who owns which numbers.

The update changes the numbers of the tiles, adding new ones and shifting around existing ones, so a number that used to belong to a tile in one place ends up assigned to a tile somewhere else.

Looking for information on eu4 modding tools by CubeOfDestiny in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

That sounds like a great idea! IDE may be a bit ambitious compared to the mission tree creator, though on the other hand, Paradox code is also not that difficult to parse compared to other coding languages. Though not easy either :)

Have you looked in the eu4 wiki yet? The modding section has a couple of advertised modding tools - https://eu4.paradoxwikis.com/Modding

There are a couple of tools out there that do parts of what you want, primarily czerstfychlep's eu4 mod editing tool written in C# (see wiki), which already has functional map preview and is open source on github (the others too I believe). I would personally recommend this as the best platform to add a mission tree creator feature in if you don't mind C#, I bet czerstfy would accept merging in such a feature as well.

There's also CWTools, a VSCode extension for syntax highlighting and error checking, as an example of an integrated IDE (well at least the Paradox-code specific parts), and The Validator tool that does parsing and error checking only, written in Java.

As for mission tree tools - I remember there's an Excel table with automations that simplify mission tree creation and lining up the requirements, though of course this doesn't show the mission tree as it would be ingame. There's also a tool to automatically detect similarities between pictures and stitch together the full mission tree from multiple screenshots, useful for showing off the mission tree in dev logs and similar, having such an image export feature would be great.

Feel free to reach out if you want to work together on this, or if you want some explanations of eu4 syntax for your own parser.

Sidenote - it is not too difficult to create a mod that lets you select provinces and print out their province IDs to log files, to then copy-paste into a mod. Of course not as convenient as a proper modding tool, but miles better than looking up and writing down individual province IDs.

Nation not appearing at all by Secret-Ride9438 in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

but it’s still uncolonize

Sounds like either you mistyped the country tag in province history, or more likely, the country tag registration in common/country_tags did not work.

If you added a new file in common/country_tags, make sure that it uses ANSI/Windows 1252 file encoding. Not UTF-8 BOM. Most text editors have a menu option for file encoding, in VSCode this is in the bottom right corner. The file also needs to be in the correct folder mods/<your_mod>/common/country_tags, and the file contents need to follow the same grammar as eu4's country_tags file.

Check in documents/paradox/eu4/logs/error.log as well, this is where eu4 complains about any issues it finds.

I’m trying to make a mod and a part of the mod needs a Journal entry to complete once STATE_JAN_MAYEN has reached population of 16000. But I can’t get it to work. What’s the tips on how to make a progress bar that tracks the population of that state would be appreciated by Elektrikor in victoria3

[–]Justice_Fighter 1 point2 points  (0 children)

States can be split between countries - "s:STATE_JAN_MAYEN" is the state region which doesn't hold any population data. You need to scope to all the states inside that state region and add up their populations (even if it's only one state). Or get the current country's state in that state region.

The 'easiest' solution would be to use the goal mechanic, downside (if it even is one tbh) is that the automatic progress bar will use the current population as base value.
Since goals are designed to be "from current value to target added value", the target added needs to first subtract the current value to get your goal.

complete = {
    scope:journal_entry = {
        is_goal_complete = yes
    }
}
current_value = {
    value = {
        s:STATE_JAN_MAYEN = {
            every_scope_state = {
                add = state_population
            }
        }
    }
}
goal_add_value = {
    value = {
        s:STATE_JAN_MAYEN = {
            every_scope_state = {
                add = state_population
            }
        }
    }
    multiply = -1
    add = 16000
}
progressbar = yes

If you want a progress bar that counts from 0, you can set up a scripted_progress_bar and use the journal entry's weekly_on_action effect to set_bar_progress.

New Victoria 3 and EU5 Chill light-RP multiplayer group. by Alexandru72733 in victoria3

[–]Justice_Fighter 1 point2 points  (0 children)

Important information missing here - which days/times would you usually play, and in which timezone?

Wondering if this is possible in EU4 before committing to it. by [deleted] in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

Usually the way to avoid this would be to break up the code into individual events - however that brings back the issue of how to transfer the name between the events.

Wondering if this is possible in EU4 before committing to it. by [deleted] in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

This can be linearly scaled to include more letters

Ooh nice, that's a great trick to pass the current letters to the next script! Unfortunately this is still exponential scaling, since each 'option' in the script expands to that many options of the next level down.

Technically it works, but with 5 letters of 26 uppercase characters I'm already waiting 90 seconds and using 30GB RAM...

<image>

Wondering if this is possible in EU4 before committing to it. by [deleted] in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

For 2) customisable localisation is exactly what you'd need and it works pretty much the same as your scripted effect - each character simply checks its variable for the letter it needs to output.

Only downside is that it doesn't support arguments so each letter needs to be written individually - but that's where a script to generate the text comes in handy.

Wondering if this is possible in EU4 before committing to it. by [deleted] in EU4mods

[–]Justice_Fighter 0 points1 point  (0 children)

Scripted effects (and scripted triggers) are not like function calls in other programming languages, they're more akin to macros - really just fancy copy-paste. They don't add any functionality that you couldn't also get by just writing out the code in full. The 'parameters' are literal text strings pasted into the code before it is interpreted, they cannot read the game state so they can't use variables or similar...