Need help with making identifiable potions

I want the potion to just be named a color until the player uses it. Then it's name changes to what type of potion it is. I'm trying
to make a rougelike so I want the potion effects randomized until the player tries it.
My problem is I don't know how to make it random while checking if the potion type is already taken by another color. I tried to have it check if the random number attached to the color is attached to any other color and if so re-roll the variable for that color and loop until it has a unique number.
I have the color potion item trigger the common event and it does produce a random effect, and replaces the color potion with the name of the type of potion.
This is one of the few cases where even I would suggest a scripted/plugin approach instead of trying to handle this by events.
And you should split it into two parts.

First, search for a plugin that enables a dynamic database.
Use that to setup the database to use generic names and no effects at the beginning, and add in the effects after first use only. You'll basically have to have each potion twice in the database, with only one of each pair active at any time. And the first is calling a common event on use that handles the randomness before changing the numbers to the second variant.

Second, you should use an array to store the possibilities and remove one element each time randomly. Javascript has commands that make handling a limited element group by array much easier than trying to do this by events.
Hm.... I get a feeling this might not be soooo hard.

Thinking you could potentially make a single ??? potion item that calls a common event on use.
That common even then rolls a random variable "potion unlocker" between 0 and X, where X is the amount of effects you have.

Then you could use a conditional branch like this:
if variable "potion unlocker" = 0
if switch "potion effect1" = OFF
turn switch "potion effect1" = ON
else
roll the random variable again

This would potentially unlock a new potion effect with each use.

The way to actually get the discovered potions to the player via chest would then be a whole bunch of conditional branches like:

Change variable "potion randomizer" 0-X where X is the amount of of potion types you have.

if potion randomizer = 0
if switch potion effect1 = ON
Give player this specific type of potion

Repeat that for all potion types.

You can also just roll an additional variable 0-1 and use that to determine whether or not the game rolls for an already discovered potion or give an unkown one.

It's servicable and can be expanded upon too. But a plugin could definitely make this easier.
SGHarlekin's approach would work. I agree doing some of it via code would make your events less cumbersome.

Just putting it out there: Roguelike. Rouge is makeup.
Thanks everyone. Sounds like the plugin route is best in the long run. I did find a dynamic database plugin I think. I'll have to learn some javascript but that's part of the point of me making this game.

Just putting it out there: Roguelike. Rouge is makeup.

Fair point. Not the first or last time I make that mistake sadly.
If your items are organized in a way where the identified versions of each unidentified item are grouped together in the database, you can use a common event to award the player with a random element from a specific group.


Spoiler: Screenshot
1680310739815.png

All of the possible rewards from an 'Unidentified Treasure' are items 1912 - 1930

You could have multiple identifying events to have multiple sets of rewards.

-EDIT-
I guess I didn't read your post well enough initially, and I see this isn't exactly what you were looking for but maybe it could help anyway.
That does help actually, thanks. I was thinking about adding random equipment as well and that seems simpler then going through an array since it's OK to have repeats of those.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-making-identifiable-potions.156288/