Odd Question?

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
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!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,367
Reaction score
14,074
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?
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
5
First Language
English
Primarily Uses
RMMV
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?
Yeah sure, here is what I got if you need more just ask
 

Attachments

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,367
Reaction score
14,074
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.
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
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
 

Attachments

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,685
Reaction score
2,182
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.
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
5
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.
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?
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,685
Reaction score
2,182
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.
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
5
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.
I apologize but I am still quite lost :(
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,685
Reaction score
2,182
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.
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
5
First Language
English
Primarily Uses
RMMV
So is this what you were saying?
 

Attachments

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,367
Reaction score
14,074
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!)
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
5
First Language
English
Primarily Uses
RMMV
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!)
ok that makes more sense!

But how would i even go about doing that?

Sorry im still kinda new XD
 

Jack_Gram

Veteran
Veteran
Joined
May 16, 2017
Messages
53
Reaction score
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
Nevermind!
I figured it out, thank you all for your help!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I'm hoping to get a call October 1. They should be fully open by then.


With this, all demo dungeon graphics are done.
Eventually I need to make animations...send help.
OcRam demo project is now available at https://ocram-codes.net !!!
mzBaseBody.png added!

Ami
--- Mushroom ---

F.Knight: We runs out the food!
Hero: Anything could eat in this place?
F.Archer: It's a bunch of Mushroom over there. I wonder it's safe to eat.
F.Knight: No worries,we have to fill our inside no matter what it is.
(Hero & F.Knight Eat The Mushroom,After 10 Seconds They Collapse With Foam)

Forum statistics

Threads
103,446
Messages
999,367
Members
134,984
Latest member
kakecide-5897
Top