8
« on: October 04, 2017, 09:29:35 pm »
random is god, dunno what your question was tho, since u seem to understand simple things.
just look in critical_failures.fos if you want to know what roll is doing what... like decribed in the comment line in the script i guess, the rest is simple math like u already figured out.
you already figured out the differences between different luck, its simple addition operation
Random(1, 100) - 5 * (cr.Stat[ST_LUCK] - 5); or Random(1, 100) + (- 5 * (cr.Stat[ST_LUCK] - 5));
Random() just generates a number between 1 and 100 this value will be used for simple calculation. only thing you have to pay attention too is that a negative number multiplied with another negative number will have an positive result.
you analysed that already on the bottom like, Random number between 1 and 100 + (-5*(1-4)) would look like Random + (-5*(-3)) > Random number between 1 and 100 + 15 and so on ...
so yeah with 1 luck and anything under 5 you will end up with some addition to the random generated number, on the other hand its still pretty rare i think the random generated number ranges from 1 to 100 so thats a wide field were u would have to hit >=75 on random gen to receive the baddest critical miss roll. i dont know exactly how the random number generator works here but if you just go by probability its like 3/4 chance against it and 1/4 to happen, in reality you might have more luck haha.
also this is only for creating a critical roll when already a "critical" miss occured. it would be more interesting to look on the part which turns a miss into a critical miss.