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,511
Reaction score
12,049
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 Profile Posts

Sometimes I feel like I don't belong here. I feel like I have the exact opposite interests in storytelling as everyone else.
You know what really grinds my gears? Websites that block your access completely if you have an AdBlocker on...

I would rather skip the site than endure some popups that may give me a gnarly virus!
Guys this thread is so good and you should be reading it.
Once again have another case of an Android user losing all of their save files for all of my games after a single game update. Apparently even Yanfly's Save Core can't prevent it. Very frustrating.
Question! If anyone here has any of the Time Fantasy tiles, or the Omega Modern one, do they include character templates/bases/whatever the term is?

Forum statistics

Threads
94,489
Messages
921,351
Members
124,334
Latest member
x01010110x
Top