The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: yarub on November 28, 2006, 10:02:19 AM

Title: [RESOLVED] Condition Branch that Checks for Item Amounts
Post by: yarub on November 28, 2006, 10:02:19 AM
As default, you can only check to see if the player has one item. I was wondering if it'd be possible to set it up so I can check to see if they have a specific amount of items.

The idea I'm playing with is a recipe system. If they have a water crystal and three potions, it would make a tonic. Currently, I can't look for three potions. I can only look to see if they've got a single potion in their inventory.

What it is now:
Conditional Branch: [Item] in inventory
@>
: Else
@>
:Branch End

What I want:
Conditional Branch: [Item] in inventory >= 3
@>
: Else
@>
:Branch End
Title: Re: Condition Branch that Checks for Item Amounts
Post by: Falcon on November 28, 2006, 10:18:37 AM
Just search for Deke's Crafting Script on Dubealex.
Title: Re: Condition Branch that Checks for Item Amounts
Post by: Blizzard on November 28, 2006, 01:09:49 PM
Use the script condition on tab 4. Type:

$game_party.item_number(ID) == 1

where ID is the item ID in the database. In this specific case it would return "true" if the party has exactly one item.

Title: Re: Condition Branch that Checks for Item Amounts
Post by: yarub on November 28, 2006, 09:55:29 PM
Quote from: Blizzard on November 28, 2006, 01:09:49 PMUse the script condition on tab 4. Type:

$game_party.item_number(ID) == 1

where ID is the item ID in the database. In this specific case it would return "true" if the party has exactly one item.

Oh sweet. I didn't even see that. o_o Thanks!