So when taking a LUA file and making modifications to it inside your mod.. how can you tell if it is loading or loaded when you make changes to said LUA file? I am kind of a noob when it comes to LUA modding - Okeh so I've figure the above out. --- Post updated --- Now how would I go about writing an equation which takes two values, determines which is lesser then the other and assigns that as the value to move forward with? Nvm.. I've managed to do this as well.
I don´t know in which programming language but standard will be something like that: IF item1<item2 THEN valuetouse = item1 ELSE valuetouse = item2 END IF
all I needed was something like this - (I got it working after figuring out the correct math I needed to use for LUA to do this for me) Code: assignedValue = math.min(value1,value2)
How do I create and assign a value to a random number generator? I've tried using these functions in places and I just cannot get a RNG to actually work and function as intended. Code: - random() - math.random() - math.randomseed( os.time() ) math.random() - math.randomseed( os.time() ) local number = math.random()
yeah, it doesn't work, it just takes that value and uses that 100% of the time. So if I write math.random(32) it'll just always output as 32.
You need a random seed which helps the randomizer making real random numbers. Read here: https://stackoverflow.com/questions/20154991/generating-uniform-random-numbers-in-lua
Yes but idk where to write the seed in which it'll both, actually get used, and not just brick my Lua.
Alright, what I actually need to do is write a loop that assigns a variable to an output value from a looping Random Number Generator.