OpenXcom Forum
OpenXcom Forks => OXCE Support => OpenXcom Extended (OXCE) => OXCE Support Y-scripts => Topic started by: Nord on March 22, 2020, 07:25:01 am
-
Is it possible to add access to "BattleGame.randomRange" or any other random in script hook "recolorUnitSprite"?
Thanks.
-
Just guessing... but running RNG on every pixel 60 times a second would probably not perform well.
-
Just guessing... but running RNG on every pixel 60 times a second would probably not perform well.
Then it is... err, how to write it on english... shortly, lets think that i never asked this question. :)
-
Random would work fine (most overhead would be function calls), there is bigger problem, game state would be not deterministic if w used main random sequence for that.
Right now there is workaround, you can mix animation frame with unit id to get some unique value, based on it you can fake RNG.
If this is not enough, I already added some new functionality to to scripts to access custom RNG generators that can be separated from game state and safe to altering game state.