Users browsing this thread: 1 Guest(s)
Checking inventory for an item
12-30-2019, 11:11 PM
Hi everyone! I have another question, this time regarding Event programming. I had the idea to incorporate a sort of Synthesis Shop that turns items into other items. Here's what I have so far!
In this example, by giving 200gp and a Hi-Ether to a merchant, the player will receive an Elixir. The simplest way I could figure to do this was to create an NPC who performed only this single function. The code looks as follows:
As you can see, I'm hoping there is something we can place in the spot of the question marks that checks whether or not the Hi-Ether is in the player's inventory, and if not will display a text box saying "not enough items" and return. As it stands now, the game will take the Hi-Ether if it sees it, but if you don't have one it just continues on with the code giving you an Elixir anyway.
I'd say a way to do it is to set an event bit when you receive a Hi-Ether in your inventory, but how would you even turn it off if you drink it in battle, sell it, etc, so that doesn't seem like a realistic option. Is there a way to do this that I'm missing?
Thank you in advance for any assistance. I appreciate it!
In this example, by giving 200gp and a Hi-Ether to a merchant, the player will receive an Elixir. The simplest way I could figure to do this was to create an NPC who performed only this single function. The code looks as follows:
Code:
4B 01 00 [display text box with a "No/Yes to continue" choice]
B6 78 98 02 83 98 02 [if no, then return. If yes, then proceed]
85 C8 00 [take 200 GP from party]
C0 BE 81 [check event bit 1BE to see if party has enough GP. If not...]
FF 69 01 [display text box "not enough GP..." and return]
81 ED [take Hi-Ether from inventory]
????
80 EE [Give Elixir to inventory]
FE [return]
I'd say a way to do it is to set an event bit when you receive a Hi-Ether in your inventory, but how would you even turn it off if you drink it in battle, sell it, etc, so that doesn't seem like a realistic option. Is there a way to do this that I'm missing?
Thank you in advance for any assistance. I appreciate it!
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)