check if carrying no items excluding key items

yo, i've found out that


$game_party.items.size == 0


as a condition should check if the player has no items (not counting armour or weapons, only "item" items) but can it be made to exclude key items? or does it possibly still count armour and weapons? as i said it needs to only check for normal items, excluding those marked as key items


as for what use it has, it's supposed to be for a skill that cannot be used if the player has no items. is there maybe an easier way to go about that?
That array doesn't include weapons or armors, but key items will be included.


You could try creating a new selection like this:


selection = $game_party.items.select {|item| !item.key_item?} ; selection.size == 0


Edit: Actually, if it needs to be on one line, this might be better.

Code:
$game_party.items.select {|item| !item.key_item?}.size == 0
That array doesn't include weapons or armors, but key items will be included.


You could try creating a new selection like this:



selection = $game_party.items.select {|item| !item.key_item?} ; selection.size == 0


Edit: Actually, if it needs to be on one line, this might be better.



$game_party.items.select {|item| !item.key_item?}.size == 0



that works, thank you

Original thread: https://forums.rpgmakerweb.com/threads/check-if-carrying-no-items-excluding-key-items.69504/