Check for item in event

Tigersong

Furry Fellow
Veteran
Joined
Oct 22, 2012
Messages
451
Reaction score
44
First Language
English
Primarily Uses
Hey, I just resumed work in XP after some time. I want to make an event dependent on the player having a specific item, but it looks like I'd need to write a script. What might that script look like?

Actually, what would be ideal is if adding an item automatically incremented a variable. Can that be done?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,066
First Language
English
Primarily Uses
RMMV
I'm working in MV so I'm sure it's not the same, but you can do this with eventing -

1. On your dependent event, check through a conditional branch whether the party possesses the item that is required.

upload_2017-11-10_13-9-6.png

2. Or, if you need X amount of that item, you can set a variable to the number of that item and then check on that variable in a conditional branch.

upload_2017-11-10_13-11-25.png

Hope this helps.
 

Tigersong

Furry Fellow
Veteran
Joined
Oct 22, 2012
Messages
451
Reaction score
44
First Language
English
Primarily Uses
Looks like it'll work! I guess "item exists" officially became a condition in Ace- but a conditional branch is a different story. Thank'ee, Guvner!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,467
Reaction score
12,017
First Language
English
Primarily Uses
RMMV
Nope, both of those are in XP.

Control Variables has Item X In Inventory, which puts the quantity into the variable, so you can then use the variable in a conditional branch to see if they have 10 rats.

Conditional Branch has Item X In Inventory on tab 4, which just checks that you have at least one of the item - it doesn't care how many you have.


If you don't see that in your XP, maybe you have a really, really old version.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

i deleted anime only family guy from now on
I've discovered Stardew Valley and now I'm an addict. To think that one person designed this...
There a thread out there that tells us the best way to open an RPG that isn't 'the protag gets out of bed'?
Updated my state Stacker Script on itch.io, github is down for some reason (probs just me).
Wife watching Locke and Key. This show is so bad!! You can't just acclimate to discovering magic or magical worlds in less than 60 seconds.

Forum statistics

Threads
94,335
Messages
920,035
Members
124,093
Latest member
JosephTucker
Top