So, I'm wanting to create a preview of what a Danganronpa-like game would look like in RPG Maker MZ. For now, I'm only focusing on a small scene with a debate, and I have six variables for each evidence in that debate, labeled "Evidence 1" to "Evidence 6", assigned to an item with the Hidden Item A label. My aim is to have a variable called "Evidence List" which is set to being a range between the "Evidence 1" and "Evidence 6": said "Evidence List" variable will be used with the "Select Item" command to let the player choose the evidence to counter the contradiction with.
Range of variables as variable
RPG Maker MZ SupportIf the range is fixed (e.g. the valid evidence is always 1 out of 6) then you can just use:
I.e. "generate a random integer from 1 to the value of game variable ID 123". E.g. if that variable's value is 3, it would set a random value 1, 2, or 3.
Is that the sort of thing you were asking?
- Control Variables -> Set -> Random: 1 ~ 6.
JavaScript:
1 + Math.randomInt($gameVariables.value(123))
Is that the sort of thing you were asking?
Well, the range will always be variable due to the items being used always being different, though a single evidence can appear several times in the same trial until it is successfully used to counter a contradiction. At least, that's how I think Danganronpa trials work, anyway.
As I understand it, several variables in one is an array of data, well, let's say you can put them there, but I do not know how to take them out in the maker, I am not a programmer, just if you wanted to say it, then it will be clearer to others.If not, then I'm sorry that I misunderstood
You should probably explain more explicitly what you're trying to accomplish. Not everyone here has heard of or played Danganronpa, and certainly most people don't know how its game mechanics work.
So all we have to go off of is your descriptions in your posts.
I understand you're saying you have six hidden items, and you'll have a variable to store which of those items the player chooses. That makes sense.
So what is your actual question? I don't understand, from that description, what you mean by "range of variables as variable." What do you need help doing with that variable?
It doesn't sound, from the description, like any advanced script calls with arrays should be necessary for this, but we'll see what the OP's clarification brings.
We all know that, in RPG Maker MZ, we can set a variable to a range of integers. In my example, I'm asking if that's possible for variables as well. That way, one could set a variable to a range of variables: for example, if they're creating a detective game and wanna let the player choose between several pieces of evidence, they could create a variable called "Evidence List" and set it to a range between, say, variable 1 and variable 6, then use the "Select Item" event command to test this out.
No, we don't all know that.
If you're talking about this:
That's the opposite of what you're saying. That's saying you are going to control that range of variables in the way specified below. e.g. take variables 1 through 7 and add 2 to all of them.
What you're describing is possible via coding arrays as sergs mentioned above, but it's really not clear to me how that would be helpful in the gameplay you're describing.
I just don't see what the Select Item event command has to do with a variable that contains a list. That's not any kind of option in Select Item.
If you want to control which things (pieces of evidence) the player can choose from, add or remove the appropriate ones from their inventory via the Change Items event command. You can use event commands to randomize that, if you want them to have evidences 1, 4, and 6 to choose from, or add all 6.
It's just not clear how you want this variable to play into the sequence of commands.
Original thread: https://forums.rpgmakerweb.com/threads/range-of-variables-as-variable.164971/