Odd Question?

Discussion in 'RPG Maker MV' started by Jack_Gram, May 16, 2017.

  1. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello!
    I'm new to the RPG maker community and so far I have to say its great. I just have a question about a problem I have encountered while making my game.

    So I have an item that there is a limited amount of them and you exchange them for rare weapons and armor. The problem I'm having is I just want the players to be able to buy one of each item in this exchange, when they buy the first item, it goes away as I planned, but when the player buys another one of the items, the first one pops back up.

    I'm not good at scripting and I'm trying to do this using switches and variables.

    Also my first forum post, so please be gentle lol

    Thank you in advance for all the help!
     
    #1
  2. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,916
    Likes Received:
    12,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    It sounds like you accidentally used the same switch for both items, so when you buy the second item, the first one is returning. Can you post a screenshot of your event for the rare item that you should only be able to buy one of, as well as the other item that when you buy it, the first item pops back up?
     
    #2
  3. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah sure, here is what I got if you need more just ask
     

    Attached Files:

    #3
  4. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,916
    Likes Received:
    12,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    What's pages 3 - 8? Are those related to what you've already bought? If so, then I would not use variable 2 to store the item bought, as that is getting overwritten every time you buy another item, hence why it is popping up again.
     
    #4
  5. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh yes sorry, In each event im removing the option to go to the item, I dont know if thats correct, here is some examples
     

    Attached Files:

    #5
  6. Frogboy

    Frogboy I'm not weak to fire Veteran

    Messages:
    1,672
    Likes Received:
    2,091
    Location:
    North Carolina, U.S.
    First Language:
    English
    Primarily Uses:
    RMMV
    Instead of a variable, that's getting overwritten every time you buy a new item, you'll want to use a block of switches to indicate that you've either bought or not bought each item individually.

    So "Bought Fighter's Ring" will be one switch that's turned in when you buy it. Bought Master's Ring will be another switch as will each item available for purchase. Each time you buy a new item, that's the only one that's unavailable for purchase because you are you are basically just storing the value of the last item you bought.

    Hopefully what I'm saying makes sense.
     
    #6
  7. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Kinda? An example or a little more detail would make sense, like should the block be in multiple event pages or should this all be done in a single event page?
     
    #7
  8. Frogboy

    Frogboy I'm not weak to fire Veteran

    Messages:
    1,672
    Likes Received:
    2,091
    Location:
    North Carolina, U.S.
    First Language:
    English
    Primarily Uses:
    RMMV
    When I say a "block of switches", I just mean "several in succession". If you have 10 items that you can purchase in this manner, allocate say, switches 50-59. Switch 50 can be "Bought Fighter's Ring". 51 can be "Bought Master's Ring" and so on. It's just easier if you keep them together for maintenance purposes. You'll probably also want to leave switches 60-69 free in case you decide to add more later.

    Whenever you buy an item, turn the switch on that corresponds to the item you want to remove and then check that switch whenever you need to see if the item is available.
     
    #8
  9. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I apologize but I am still quite lost :(
     
    #9
  10. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    This is what i did, for each item and then the switch block, not sure what to do from here
     

    Attached Files:

    #10
  11. Frogboy

    Frogboy I'm not weak to fire Veteran

    Messages:
    1,672
    Likes Received:
    2,091
    Location:
    North Carolina, U.S.
    First Language:
    English
    Primarily Uses:
    RMMV
    Inside (or just outside) your IF Moonstone >= 10, you'll want to then check if the Moonstone 10 switch is OFF before you execute the transaction. In the ELSE branch, meaning that the switch is ON, you can inform the player that they already purchased this item.
     
    #11
  12. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    So is this what you were saying?
     

    Attached Files:

    #12
  13. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,916
    Likes Received:
    12,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Not quite. In my opinion, I'd look at another way to do this altogether, because right now you will have a lot of cases to do, and might even run out of event pages (as 20 is the limit in MV). As it is, you need to turn ON a switch when you get each item, and then add a separate page to only allow you to trade for the items you don't already have.

    If the player can get each item out of order, it will be very complicated, as there will be 24 cases (4 * 3 * 2 * 1) to consider. So I'd see if I could think of another way altogether to do this event/exchange to avoid the issue of the number of cases altogether (ideas for that: Allow the player to only trade for the first ring initially, then once they have it, let them trade for the second, and so on. Will heavily reduce the number of cases, and you might be able to use self switches for it too!)
     
    #13
  14. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    ok that makes more sense!

    But how would i even go about doing that?

    Sorry im still kinda new XD
     
    #14
  15. Jack_Gram

    Jack_Gram Veteran Veteran

    Messages:
    53
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Nevermind!
    I figured it out, thank you all for your help!
     
    #15

Share This Page