"Max" is short for the word "maximum," the highest value you want to be possible. "Min" is short for the word "minimum," the lowest value you want to be possible. If you want your random number to possibly be 100% of what the player input, then sure.
I already knew that Max is short for Maximum and Min for Minimum. But I'm still a little confused. I think I now know you meant for me to choose two numbers for random. I thought I was placing/stating? variables in them. o-o
I think I understand that the script Math.floor(Math.random() * (max - min + 1) + min); is the same as when I was using my variable at the top for random numbers 1-99 but Math.floor(Math.random() * (max - min + 1) + min); is the script form.
Perhaps you get over-excited and try to dive into things, but try to slow down and go methodically, because this is ignoring several examples and corrections I already gave you.
Yes I'm excited, no I'm not trying to ignore your several examples. It's just that I am having trouble understanding. I'm still not clear on where to place the random numbers, where to state my variables in the script and where to place $gameVariables.value(253)
You just told me "put two cookies into your lunchbox. Now, put all the cookies into the cookie jar." Well, I can't put all the cookies into the jar because I just put two into my lunchbox!
I like cookies. But okay, the glass doesn't have to be 100%. o-o
Correct - again, I already showed you that in a prior example. This is just regular math, the way you would say "30% of something" is "that number * .3." So if you want to use 30% of variable 253, then $gameVariables.value(253)*.3
I knew that .3 was 30% but at the time I wasn't sure which one to use. I'm not familiar with scripts themselves, just the buttons I see in Rpg Maker.
Also the script, I just replaced the number in this example with X. I need clarification. Are the Max and min in place of the two random numbers I'd like? What is the X in your example? Is X the items, the variables or the random numbers?
◆Script:$gameVariables.setValue(253, Math.floor(Math.random() * (x - .x + 1) + .x));
The min is already the percentage so I think Max has to be the player input, in this case variable 253
So I think the script should look something like this
$gameVariables.setValue(253, Math.floor(Math.random() * (253 - .3 + 1) + .3));
I think the script means player input(variable 253 is player input) minus glass percentage and the +.3 is glass being added into the inventory.
but have no idea if that script line is accurate, placed by each other properly or if the computer recognizes that 253 is the variable, not a number.
I don't know how to combine the two scripts into one script.
and if glass is script
$gameVariables.setValue(253, Math.floor(Math.random() * (253 - .3 + 1) + .3));
and if I wanted just two items, Diamonds and Glass, then is this Diamonds script
$gameVariables.setValue(253, Math.floor(Math.random() * (253 - .7 + 1) + .7));
to equal 100%?
Math.floor(Math.random() * (max - min + 1) + min)
The way I interpret this script call is that it is generating something random.
(Because of the words Math.Random) It's also I think multiplying.
(because of the *) The .3 is how much glass I want the player to get back. And that min is the same for both min now. But what is Max? The player input or something else entirely?
I've tried setting $gameVariables.setValue(253, Math.floor(Math.random() * (x - .x + 1) + .x));
to state that 253 IS the player input.
And is Math.floor(Math.random() * (max - min + 1) + min); i
s my random variable? You said
Yes, you use a variable. But you're doing extra things with them that I don't understand. Look at the very first two lines of your event. The first line sets variable 261 to a random number between 1-99. Why?
I keep using 261 variable 1-99 because in past events, in order for a random to work it has to be stated in the event. Or else nothing happens. Is the script
Math.floor(Math.random() * (max - min + 1) + min); in place of the random variable?
And if Math.floor(Math.random() * (max - min + 1) is my random variable, how do do I do this part?
◆Change Items:Diamond + {RNG}
Because now I don't see or seem to have a variable to use for this item change that's depending on a variable.
And is $gameVariables.setValue(253, Math.floor(Math.random() * (253 - .3 + 1) + .3));
The script I'm even suppose to be using?
If you want to use the values of those variables, you know how to do that from the script you were already using: $gameVariables.value(253) or $gameVariables.value(261)
I see two scripts $gameVariables.value(253) and Math.floor(Math.random() * (max - min + 1) + min);
and have no idea how to arrange them in a script call properly. Does $gameVariables.value(253) go first? Is there a space between $gameVariables.value(253) and Math.floor(Math.random() * (max - min + 1) + min);?
If I could just see a visual of the event I'm trying to create, I will most likely have a better understanding. That usually works for me.
I just attached a screenshot that took me several minutes to compose together but right now I am assuming the Math.floor(Math.random() * (max - min + 1) + min); but have not fixed it.