Multi-digits chest code (Input Number)

Hello.

I need to know how to get 3 variable value at once to open a digit entry chest.

I have 3 chests. Each of them generating a random value to a variable

-One of them gives the "Units digit key"

-A second one gives the "Dozens digit key"

The third one gives the "Hundreds digit key"

When you have the code you can open the big reward coffer.

(I know I can just use a single variable in each chest that add+1, then

the reward coffer is openable if the variable = 3, but I dont want to do it that way.)

It works, but I have to use conditional branch check the 3 digits one by one.

I would like to know how to use the "Input Number" setted with the 3 digits, please.

Thanks in advance.

Chest code.jpg
Are you asking for 3 single-digit numbers and want to combine them to make a 3-digit number? I'm not really sure I follow you.


But, this might help:


code = hundreds * 100 + tens * 10 + ones
Use a number of mathematical operations to turn the three random numbers into a single number (x+10*y+100*z), then compare the result with a three digit input number.
I just want to discover the 3 parts of the code of the chests and enter them directely in a 3 digit. input.

The Andar's idea... I go to sleep and will meditate about it, will try something later ^^.

3 digit.jpg
Primarily what Andar said.

Treasure Combination.png

That command there should give you a random combination of numbers to use, and sort out the final chest.

One thing I forgot to add on the command, once the final chest is set, dividing the RNG chest 10 with 10, and the RNG chest 100 with 100.
Not quite. I imagine you want to keep the original digits as they are so you can show them on the 3 original chests. And the example above assumes it's only going to be run once (you use += when first setting the full code - if there was a number in that variable beforehand, it would just increment).

Something like this, as an event that will run once only - so set it to parallel process, and give it a second page conditioned by self switch A:

Control Variables [001: Ones] = Random Number (0 - 9)Control Variables [002: Tens] = Random Number (0 - 9)Control Variables [003: Hundreds] = Random Number (0 - 9)Control Variables [004: Code] = Variable [003: Hundreds] * 10Control Variables [004: Code] += Variable [002: Tens]Control Variables [004: Code] *= 10Control Variables [004: Code] += Variable [001: Ones]Control Self Switches A = ONLet's say you get this:Var 1 = 5

Var 2 = 8

Var 3 = 2

That will do the following:

Var 4 = 20 (var 3 * 10)

Var 4 += 8 = 28 (add var 2)

Var 4 *= 10 = 280

Var 4 += 5 = 285 (add var 1)

Then on chest 1, you use

Show Text: _ _ \V[1]

On chest 2, you use

Show Text: _ \V[2] _

On chest 3, you use

Show Text: \V[3] _ _

and on chest 4, you input the number, then use conditional branch to compare it to variable 4, which is set to 285.
Shaz, Andar, Kvich, Thank you very much.

It's exactely what I wanted. As usual, I want to do too complicated...

Now when I read well the Shaz's reply I understand it.

I did not get it the 1st time, sorry.

I think Shaz won the choco ore cookie 😛

Original thread: https://forums.rpgmakerweb.com/threads/multi-digits-chest-code-input-number.38414/