Neareyn

Villager
Member
Joined
Apr 21, 2021
Messages
19
Reaction score
3
First Language
German
Primarily Uses
RMMZ
Hey!

I plan a feature in my game which allows the player to get a random Item in a dungeon. The item will be collectable from a chest and the player can enter the dungeon multiple times to get more items, but never more than one time.

But I couldn't figure out how I can randomize the loot and how I can disable an item that the player already has (I tried to do it with switches and simple eventing but it didn't worked)

So I think I need is a plugin that allows me to get a random event from a trigger, but disable events if a certain switch is off/on.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
559
Reaction score
540
First Language
german
Primarily Uses
RMMZ
So you want to get random items, but don't get an item twice? I think you can do this with eventing

Code:
loop
  Set Variable "random" as random number
  If Condition random = 1
    if Condition: Party has item "fiery sword"
      do nothing
     else
      gain item "fiery sword"
      break loop
  If Condition random = 2
    If Condition: Party has item "magical cloak"
      do nothing
    else
      gain item "magical cloak"
      beak loop
end loop

Be aware this eventing will break the game if you have all items from the list.
 

Neareyn

Villager
Member
Joined
Apr 21, 2021
Messages
19
Reaction score
3
First Language
German
Primarily Uses
RMMZ
Thank you very much! I will try it out later.
Can I use it as a common Event so it works with multiple maps?
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
559
Reaction score
540
First Language
german
Primarily Uses
RMMZ
With some adjustments, yes for sure.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,690
Reaction score
5,747
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to MZ Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Latest Threads

Latest Profile Posts

Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally
We're playing one of the Touch the Stars game jam entries, come join us!

Forum statistics

Threads
113,555
Messages
1,075,811
Members
147,552
Latest member
Pliskin
Top