Event askes for something random?

Discussion in 'RPG Maker MV' started by Hatake-hime, Jul 17, 2016.

  1. Hatake-hime

    Hatake-hime Squishy Cat Summoner Veteran

    Messages:
    48
    Likes Received:
    16
    Location:
    Scotland
    First Language:
    English
    Hey guys, basically I'm doing an event that can happen at random but I'm having a brain fog; I think I can do this with normal eventing and no need for script, can you help? Thank you!


    it goes like this: 


    player has 2 flowers, 3 chickens, and a mango. 


    What should I do if I want someone to ask the player to give them a (random number) of (item) the player has? 


    Surely i would first do a conditional branch where it checks if the player has the item first but how can I get them to ask for one of the random items, and the amount of the item as well? What could I do to event it so they come and ask randomly?


    Too bad there's not like a dice roll or something that would randomise it.


    it is a reoccurring event, so I'd like them to come at the player with different wants each time. 


    Thanks for for any help 


    I'm not great at explaining so I appreciate it if anyone can point me in a direction!
     
    Last edited by a moderator: Jul 17, 2016
    #1
  2. Kenen

    Kenen Veteran Veteran

    Messages:
    256
    Likes Received:
    152
    First Language:
    English
    Primarily Uses:
    RMMV
    You probably need to use a variable to check for and store the number of required items.


    E.g. run a "control variable" event that sets a variable called "requiredMangos" to a random number between 1 and X. Do this for all 3 items.


    From there, you can print the number of required mangos in a message box (I required \v[x] mangos), and you can also use conditional branches to see if the player has a quantity of mangos that equals the value stored in the variable.


    Edit: to check how many items your player possesses, you'll also need to run a Control Variable event.


    Select Control Variable, select the Set radio button, select the Game Data radio button under the Operand panel, and then select the Item (Possession Count) radio button. That will allow you to check how many mangos your player has, and you can then compare the two variables using a conditional branch.


    This is probably a very basic example of what you'll want to look into doing:


    http://imgur.com/KdUZRaK
     
    Last edited by a moderator: Jul 17, 2016
    #2
    Lake likes this.
  3. Lake

    Lake *Smirk* Veteran

    Messages:
    35
    Likes Received:
    14
    First Language:
    English
    Very well said, but this can truly be done with pure variables and switches.


    Let me simulate it for a bit to have a definitive solution ^_^
     
    #3
  4. Hatake-hime

    Hatake-hime Squishy Cat Summoner Veteran

    Messages:
    48
    Likes Received:
    16
    Location:
    Scotland
    First Language:
    English
    You think so? ^


    if you have a better option I'd love to see it! Thanks so much for your help too, Kenen; that's so descriptive! 


    So I would have-- (please if this is correct?) for each item


    a check for the item amount in inventory, then


    a check for how many would be wanted?


    if I wanted to trade for it,


    would I just put another conditional in after it? 


    like, if requiredmangos = 1 then trade 10g, if = 2 then 20g, etc? 


    Sorry im trying to visualise this all in my head ?


    If anyone can help me I'd love it, this is a simple but huge part of the economy in my game! If I can just get one right, they can all follow suit!
     
    Last edited by a moderator: Jul 17, 2016
    #4
  5. Hatake-hime

    Hatake-hime Squishy Cat Summoner Veteran

    Messages:
    48
    Likes Received:
    16
    Location:
    Scotland
    First Language:
    English
    Still looking around if anyone can help out! <3
     
    #5
  6. Dad3353

    Dad3353 Veteran Veteran

    Messages:
    421
    Likes Received:
    108
    Location:
    France
    First Language:
    English


    Is this any use to you..?

    When triggered, this Event decides, randomly, which of the three Items to give, then, according to the Number available, gives out a random quantity between one and the maximum (inclusive...)...


    [​IMG]


    Just for testing purposes, I fill in the Item quantities here, but they would, of course, normally be handled by the Game...


    [​IMG]



    Hope this helps.
     
    Last edited by a moderator: Jul 18, 2016
    #6

Share This Page