The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Users browsing this thread: 1 Guest(s)
Checking inventory for an item

#1
Posts: 22
Threads: 11
Thanks Received: 0
Thanks Given: 0
Joined: May 2019
Reputation: 2
Status
None
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:
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]
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!
  Find
Quote  



Messages In This Thread
Checking inventory for an item - by Morendo - 12-30-2019, 11:11 PM
RE: Checking inventory for an item - by madsiur - 12-31-2019, 09:13 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite