How to check if inventory is empty.

ZumataScream

Villager
Member
Joined
Feb 18, 2015
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Hello! I would like to know if there is any way to check if the inventory is empty or not.  The reason I would like to be able to check is that I plan to design a locked door which the player can only pass through if they are not carrying any items, weapons, armours etc., i.e. an empty inventory.  Doing it by variables and conditional branches is a bit time consuming, so I would like to know if there's an easier way.  

Please let me know if there's something unclear that you need to know.
 

Ramiro

Now with an army of Mecha-Ralphs!
Veteran
Joined
Aug 5, 2015
Messages
858
Reaction score
364
First Language
Spanish
If I'm not wrong

$game_party.items.size == 0As an script condition in your event
 

Lecode

(─‿‿─)
Veteran
Joined
Dec 18, 2013
Messages
490
Reaction score
659
First Language
French
Primarily Uses
N/A
any items, weapons, armours
 Use all_items instead of items

Code:
$game_party.all_items.empty?
 

ZumataScream

Villager
Member
Joined
Feb 18, 2015
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Thank you both for the answers! They all worked  :)
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top