Fairy needs to trade gems for sword

EvieEvangelion

Villager
Member
Joined
Sep 14, 2016
Messages
17
Reaction score
0
First Language
English
Primarily Uses
Ok so i have been following the tutorials on the main RPGmaker website, and honestly i get most of it, but in the final tutorial it wants you to make a fairy, that will trade 2 elemental gems for a weapon item, and then once you've done that the price goes up for the next item. 


Honestly i just want to know how to get the fairy to check for the 2 stones in your inventory, take them, and then give you the sword (ok i know how to get her to give you the sword) 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I've moved this thread to MV Support. Please be sure to post your threads in the correct forum next time. Thank you.


Tech-Support is for getting the editors to run, not for development support


Please give a link to the tutorial you're talking about, because I never heard of that one.


That said, what you need is variables - I suggest you follow the link to the starting point in my signature and work through the variables guide linked there.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Have you problems reading the flowcharts, or what exactly is your problem?


Simply showing you one of the solutions would not be the best way to proceed here imho, sorry - the best way is to determine where exactly your problem in understanding the tutorial was and solve that part, because otherwise you'll probably have more trouble later.
 

EvieEvangelion

Villager
Member
Joined
Sep 14, 2016
Messages
17
Reaction score
0
First Language
English
Primarily Uses
Have you problems reading the flowcharts, or what exactly is your problem?


Simply showing you one of the solutions would not be the best way to proceed here imho, sorry - the best way is to determine where exactly your problem in understanding the tutorial was and solve that part, because otherwise you'll probably have more trouble later.
i get the flowchart, they way i understand what i have to do is:


Fairy asks if you want to trade > yes or no, if no, end interaction, if yes, which items trade, select gems, then the game needs to check if the user has an gem in there inventory. I know how to get the event/game to check if an action as been done (looting a chest of talking to someone a number of times) but is it the same for it to check the inventory? It's just the checking for the item in the inventory part that i don't get. 
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
There is a "Conditional Branch" option which checks if you have a certain item in your inventory.  You can nest two of these together (one inside the other) if there are two different gems you are looking for.


There is also a "Control Variables" option which can set a variable to the number of a certain item that you currently possess.  So if Gems are a collectible and you need to check whether the player has 2 or more of them, you would want to set a variable equal to the number of gems, then use a Conditional Branch to see whether that variable is 2 or more.
 

EvieEvangelion

Villager
Member
Joined
Sep 14, 2016
Messages
17
Reaction score
0
First Language
English
Primarily Uses
There is a "Conditional Branch" option which checks if you have a certain item in your inventory.  You can nest two of these together (one inside the other) if there are two different gems you are looking for.


There is also a "Control Variables" option which can set a variable to the number of a certain item that you currently possess.  So if Gems are a collectible and you need to check whether the player has 2 or more of them, you would want to set a variable equal to the number of gems, then use a Conditional Branch to see whether that variable is 2 or more.
Ok so i am trying this, i'm putting 3 stones in my inventory to see both the positive and negative result. I can get it to take 2 stones and give me the sword, but when i try again it will give me another sword, i have 1 stone in my inventory at this point which it will take after giving me the 2nd sword. But the cost of the sword is 2 stones so i shouldn't be able to get it and arg! Here this is what i have (what it looks like in the event page) 

2016-09-13.png
 

Dad3353

Veteran
Veteran
Joined
Mar 9, 2016
Messages
421
Reaction score
110
First Language
English
Primarily Uses
@EvieEvangelion...


Just after you check for having enough Stones, you replenish with the line that follows (the Red one...). The next time the Event is triggered, the Stones have been reset to '2', so another Sword is given.


That Red line should be outside of the loop, in a separate Event, used only at the start to enable the first exchange. It should not be triggered again.


Does this help..?
 

EvieEvangelion

Villager
Member
Joined
Sep 14, 2016
Messages
17
Reaction score
0
First Language
English
Primarily Uses
@EvieEvangelion...


Just after you check for having enough Stones, you replenish with the line that follows (the Red one...). The next time the Event is triggered, the Stones have been reset to '2', so another Sword is given.


That Red line should be outside of the loop, in a separate Event, used only at the start to enable the first exchange. It should not be triggered again.


Does this help..?
Sadly no, it seems that it's not checking my inventory. As i tired it out with no stones in my inventory and it still gave me the sword.
 

Dad3353

Veteran
Veteran
Joined
Mar 9, 2016
Messages
421
Reaction score
110
First Language
English
Primarily Uses
Sadly no, it seems that it's not checking my inventory. As i tired it out with no stones in my inventory and it still gave me the sword.


There's some misunderstanding here, I believe. The Variable '0001 Check Lightning Stones does not check inventory, nor anything else. It simply stores a value, and your Red line stores a value of 2 in that Variable. When next the Condition tests, it finds a value of 2, each and every time. Nowhere in the contents of the Event is Inventory checked.


I'll do a 'quick and dirty' simulation and post here the results, to show how Inventory could be checked. Back in a moment or two...


Just for the test, I put 10 Potions in the Inventory at Map opening...

(/spoiler]



This is how I check the Inventory for Potions...




Here's the Event code where the Sword will be exchanged for Potions...




Here is the first passage to the Exchange Chest




... and here is the 6th passage, now that the 10 Potions (5 x 2...) have been taken...




Does that make sense to you..?.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Your event is completely wrong.  The Variable control must come before the Check of that variable (otherwise you will get whatever result you set last time - such as when you set it to 2 inside the branch); additionally, you should be setting the variable to the number of stones the player actually has, not to an arbitrary number that they chose.


Here's a better way to event it:


Message: What elemental stones have you brought me?


Show Choices: 2 Lightning Stones, 3 Fire Stones, 4 Ice Stones, Never Mind


When "2 Lightning Stones"


  Control Variables: Var #1 "Stone Check" = Number of Lightning Stones in Inventory (note: this is done through the "Game Data" option in Control Variables)


  Conditional Branch: IF Var #1 "Stone Check" is GREATER THAN OR EQUAL TO 2


    Change Items: Lightning Stone -2


    Change Weapons: Lightning Weapon +1


    Message: Thanks for the Stones!  Here is your weapon.


  Else


    Message: Don't try to fool me!  You don't have enough Stones!


  End Branch


When "3 Fire Stones"


Control Variables: Var #1 "Stone Check" = Number of Fire Stones in Inventory


  Conditional Branch: IF Var #1 "Stone Check" is GREATER THAN OR EQUAL TO 3


    Change Items: Fire Stone -3


    Change Weapons: Fire Weapon +1


    Message: Thanks for the Stones!  Here is your weapon.


  Else


    Message: Don't try to fool me!  You don't have enough Stones!


  End Branch


When "4 Ice Stones"


  (use the same pattern shown above)


When "Never Mind"


  Message: Okay, come back when you have more Stones


End Choices
 

EvieEvangelion

Villager
Member
Joined
Sep 14, 2016
Messages
17
Reaction score
0
First Language
English
Primarily Uses
THANK YOU!! You are an angel, looking at this i found my hiccup, it was that little bit about 'game data' that you put in bold. LIke i get how the other stuff was out of order, but it was that game data bit that i couldn't find before or didn't see. THANK YOU! 
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Yes, and not only was the change variable after the check, and the number being set to 2 instead of the number of the items in the inventory, the check was set to <= 2 instead of >=...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top