Random variable

Is there a way to add randomness into equations?

There is a random variable in event triggers, but I didn’t find anything similar for input/output effects.

Hello,

Well, I have never used any
(special) random functions
for my Mod building, yet.

But, you could experiment with following 2 functions
from my tests:

#,RandomizerTest5,Randomizer Simu Test5,"Random Simu Function",TAX,0,0,1,UNKNOWN,icons_environment.dds,#,"_random_,0.5+(1000*x)"
,#,"Environmentalist,-0.4+(0.8*x)","Environment,0-(0.22*x)",,,,,,,,,

#,RandomizerTest6,Randomizer Simu Test6,"Random Simu Function",TAX,0,0,1,UNKNOWN,icons_environment.dds,#,"_random_,0.5+(0.001*x)"
,#,"Environmentalist,-0.4+(0.8*x)","Environment,0-(0.22*x)",,,,,,,,,

2 pictures here:
image
image


If you replace ,TAX, with ,HIDDEN, then this item is hidden.
It will not show on Main Screen, not on Changes Screen
and not as a named input in the inputs list of a target item.

But, you can still use it as (secret/hidden) outputs/inputs
to other items. ( Example here: “Environmentalist,-0.4+(0.8*x)” )


I have not tested everything
nor tried these:

random,0.5+1”
random,0+1”
random,0,1”

Maybe these work even better.


As an alternative, for long time curve effects, you could also use
these slow alternating / oscillating functions:
GDP
globaleconomy

And, as you mentioned, event random triggers
and single voter effects are RANDOM, too.

Cheers and good luck :slight_smile:


Please read the Democracy 3 official modding guide (from cliffski),
positech.co.uk/democracy3/modding.html
especially sections basics and simulations!

Always make backups of original data files, first!

These 2 functions above are Simu-items and need to be added into a simulation.csv-file.