Lists and interacting with them / The quantum treasure chest

Discussion in 'Javascript/Plugin Support' started by Pine Towers, Apr 8, 2017.

  1. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hello guys!

    I don't know if this would be better here at JS support or at MV subforum, so I apologize firsthand.

    My idea is the quantum treasure chest. Let me explain:

    The party enters a dungeon with 5 chests (A, B, C, D, E). Previously the game developer make a list of 7 items to be granted as treasure (1 per chest). He also noted that one chest will actually be a Mimic monster. The chests are always at the same spot, but when the party opens the first chest (be it A, B, C, D or E), it have a 1/8 chance of being a Mimic or getting one of the items. Whatever happens (item or monster) is removed from the list of possible outcomes, so when opeing the second chest they have a 1/7 chance of getting whatever remained. And so on for the others chests, making possible to not trigger the monster and have 5 items at the end, with said items being any of the 7 in the list (so in any playthrough, at least 2 items won't ever be acquired by that chests in that dungeon).

    Can this already be done via variables or only through JS? And there is a way to improve on the odds? Like having 4 items, but item A is 50% more easy to find than item B and C, with item D being 50% harder?

    This could be use to assign different behaviours to NPC or even interior of houses, since the main idea is the same.

    Thanks for the input!
     
    #1
  2. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    659
    Likes Received:
    504
    First Language:
    French
    In a simple form it's probably possible to do with variables and switches. However, it becomes really tedious to do if you have a lot of options and even more if you want unequal probabilities. It's one of those things that's really easy to do with a plugin but really hard to do with pure eventing.

    I had however made a plugin that allowed to do most of what you want. Adding monster encounters to loot tables and the possibility to remove the picked option from the loot table took me 5 minutes so I went ahead and created a new version because I liked the idea. You can check it in my signature, under random loot.
     
    #2
  3. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,090
    Likes Received:
    12,269
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Actually, its pretty easy with pure eventing, as it is just mathematics. Figure out all the probabilities, make sure they add to 100. Then set them up in a list in order, then have a random variable roll between 0 and 100, and based on where that variable is, give the appropriate event.
     
    #3
  4. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    659
    Likes Received:
    504
    First Language:
    French
    That part is indeed easy. What I couldn't get to work easily with eventing is the second part: removing already picked options. I mean I can get it to work but it's really tedious.

    Maybe you have a way to do it I haven't seen though. I must admit beginning eventing it and thinking "screw it, it would be much easier to script it".
     
    #4
  5. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Thank you, @Astfgl66 for the plugin, will check it out! The probability part, like @bgillisp said, is "easy" to event, but not the removing something already pick, which is the most important aspect of what I called the quantum treasure chest.
     
    #5

Share This Page