Check if player has collected all items?

Hello,

A principal feature of my game is collecting items. I'd like to have a special mode unlock when the player has collected all the items in the game, but I can't figure out how to make such a conditional branch.

I'm using the Item Book plugin that comes with MV, so I was thinking that the event code would be something like:

if ItemBook full = TRUE;
then Switch All_Items = ON

Can such a thing be done with the default plugin, or would I need another?

Thanks in advance.
Hi!
I think you may try this simple script call:

Code:
$gameParty.items().length

This will return the max number of items that your party has.

But only items, not weapons or armors.

So you can put that in a conditional branch, using the field of script call:

Code:
◆Comment:Replace X with the number of items you have.
◆If:Script:$gameParty.items().length == X
  ◆Comment:Congratulations! You have found all the items!
  ◆
:Else
  ◆Comment:Keep looking! Don't give up!
  ◆
:End

To check weapons and armors, just replace the "item" with "weapons" or "armors"(without quotes)
Code:
$gameParty.weapons().length == X
$gameParty.armors().length == X
Hi!
I think you may try this simple script call:

Code:
$gameParty.items().length

This will return the max number of items that your party has.

But only items, not weapons or armors.

So you can put that in a conditional branch, using the field of script call:

Code:
◆Comment:Replace X with the number of items you have.
◆If:Script:$gameParty.items().length == X
  ◆Comment:Congratulations! You have found all the items!
  ◆
:Else
  ◆Comment:Keep looking! Don't give up!
  ◆
:End

To check weapons and armors, just replace the "item" with "weapons" or "armors"(without quotes)
Code:
$gameParty.weapons().length == X
$gameParty.armors().length == X

Absolutely perfect, thank you! I've added your name to my game's credits. 🙂
Absolutely perfect, thank you! I've added your name to my game's credits. 🙂
Wooowww!! 😍
Good luck with your project!!
To check weapons and armors, just replace the "item" with "weapons" or "armors"(without quotes)
Code:
$gameParty.weapons().length == X
$gameParty.armors().length == X
To do the whole thing in one line:

Code:
$gameParty.items().concat($gameParty.weapons(), $gameParty.armors()).length
To do the whole thing in one line:

Code:
$gameParty.items().concat($gameParty.weapons(), $gameParty.armors()).length

Thank you! I'm probably going to need to do that as well at some point in the future.

Thanks to both of you- I'll going to ask to close the thread since the problem's been solved. 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/check-if-player-has-collected-all-items.111976/