Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[ENHANCEMENT] "Random" animation variable (java math.random)

boot2big opened this issue ยท 3 comments

commented

For anything from varying pitches to playing different soundfiles. Would probably make use of clampMin/clampMax as its range of operation, otherwise maybe a predefined range, though I would need other PAs to weigh in on what said hardcoded value should be if it can't be custom defined

commented

#1293
I spent more time finagling with github to get the PR set up than it took to write the code in notepad

commented

So you don't need to make use of the clamps. Just scale the axis. Math.random() returns a value 0->1, so you can use that and scale it with an axis to make it whatever you wish it to be.

Just be aware that this value will be random every time it's used, so if you use it in an animation, it'll spazz out.

I'm going to leave this one as a PR, since it's a one-line code addition in the common entity file that both vehicles and blocks use as a case in the switch statement where stuff like sunlight, rain, and the like are returned.

commented

Implemented in V22.0.0