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:
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.
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 }
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