stasis78
Refugee
Hey all,
rng functions are currently broken in the xml, randomint and randomfloat don't work and error out. Anyways I need a reliable rng for Farm Life and spent some time developing the necessary xml for a basic but functioning rng generator!
It was fun because there is also no modulus operation in the xml. There are also no methods for converting floats to ints or performing any rounding/flooring/etc. so I figured out how to floor floats! (Yes yes yes, its super hacky but it does work)
Comments and stuff in the xml here.
Enjoy
Note: I did test this but only with a modulo of around 110. Not sure how it will perform with numbers larger than that, but in general this should be sufficient for most use cases I can think of off hand.
The epsilon check in the last part is not necessary but I left it in as an example.
rng functions are currently broken in the xml, randomint and randomfloat don't work and error out. Anyways I need a reliable rng for Farm Life and spent some time developing the necessary xml for a basic but functioning rng generator!
It was fun because there is also no modulus operation in the xml. There are also no methods for converting floats to ints or performing any rounding/flooring/etc. so I figured out how to floor floats! (Yes yes yes, its super hacky but it does work)
Comments and stuff in the xml here.
Enjoy

Note: I did test this but only with a modulo of around 110. Not sure how it will perform with numbers larger than that, but in general this should be sufficient for most use cases I can think of off hand.
The epsilon check in the last part is not necessary but I left it in as an example.
Last edited by a moderator: