• 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.

Yard1PL

Second Lieutenant
9 Badges
Apr 6, 2016
152
54
  • Crusader Kings II
  • Europa Universalis IV
  • Cities: Skylines
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
Honestly, I am quite surprised that for all of the modability of Paradox's games, variables are almost useless. I am not talking about using them as counters, but about trying to use them to modify values such as energy, minerals etc. Because they are completely separate from those values, not only they can't be used to, for example, add X energy, but they also can't take the value of a hardcoded variable. Consider this: I am trying to make an event that gives 10% of a vassal's energy stockpile to their overlord. Had it been possible to use the variables as I mentioned, it would be very simple:
Code:
    set_variable = {
        which = "energy_temp"
        value = energy
    }
    divide_variable = {
        which = "energy_temp"
        value = 10
    }
    add_energy = -variable:energy_temp
    overlord = { add_energy = variable:energy_temp }
However, since basic mathematical operations are impossible, the only other way is to compare values until they are found. My friend wrote a special program that converted a binary tree so I could do what I wanted. The catch? It has a set upper limit - in this case, 3000. If the vassal has more than 3000, they will still only pay 300. The second problem? Size. It takes 20997 (!) lines, which equates to 530 KBs of text only to do a simple multiplication. I have not yet tested it in game, but I imagine the performance to be abysmal.

Don't get me wrong, I am not hating on Paradox or anything, and I imagine that adding such a functionality would probably need significant engine changes. However, variables as they are now are extremely limiting and preventing some very cool mechanics from appearing.

Please excuse my ranting, but I just had to say that. I hope that this issue gains consideration.
 
  • 6
Reactions:
Why don't you use broader strokes?

First of all, by the time I'm an overlord, I'm not going to notice a deposit of 10 or 20 energy. Even a hundred would be a small event - maybe 500 would be of interest. So, let's do three versions of the payment - one for 500, one for 100, and one somewhere in the middle, let's say 250.

Since you are doing 10%, that means you want three checks (>5000, > 2500 but <5000, >1000 but <2500) on vassal energy levels in the event.

Simpler, and achieves the same goals.
 
  • 1
Reactions:
That's true for all PDX games. At M&T for EU4 Demiansky is creating a very advanced population system, which utilises a lot of variables just to replicate the common values like manpower, production etc. Hopefully now that PDX is pressed not only by EU4 and CK2 community, but also Stellaris modders then they might crave in and work something out. We got a lot of goodies from Gars over years and now their team was expanded, so we have to press for more tools.
 
  • 1
Reactions:
Why don't you use broader strokes?

First of all, by the time I'm an overlord, I'm not going to notice a deposit of 10 or 20 energy. Even a hundred would be a small event - maybe 500 would be of interest. So, let's do three versions of the payment - one for 500, one for 100, and one somewhere in the middle, let's say 250.
Since you are doing 10%, that means you want three checks (>5000, > 2500 but <5000, >1000 but <2500) on vassal energy levels in the event.
Simpler, and achieves the same goals.

The thing is that the problem is with the limiting design of the game, not with what I am trying to do. I ended up doing more or less what you said, and it seems to work fine (though since there is no overlord or vassal scope I could only test it on fixed countries). However, we shouldn't need to work around this in that way when the system can be changed for the better, providing way better precision, performance and simplicity. As I said, I know this will probably take a lot of work, but I just hope PDX notices that this is a very limiting factor.

That's true for all PDX games. At M&T for EU4 Demiansky is creating a very advanced population system, which utilises a lot of variables just to replicate the common values like manpower, production etc. Hopefully now that PDX is pressed not only by EU4 and CK2 community, but also Stellaris modders then they might crave in and work something out. We got a lot of goodies from Gars over years and now their team was expanded, so we have to press for more tools.

Believe me, I know. I have modded EU4 and CK2, and each time I found myself limited by the variables. I really hope PDX does something about this at some point - basic mathematical operations and using the variables as I mentioned would open up new exciting areas of modding, allowing for way more complicated in terms of design, but way simpler in terms of the technical side mods.
 
  • 2
Reactions: