RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Is there a 'code' for how many of a certain item/armor/weapon the player has?

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
why yes, i SHALL shamelessy advertise in my sig!
Could someone tell me if there is a bit of code to call to say how many of a particular item/armor/weapon is in the player's inventory? thnx in advance and for all those who are thinking it, yes i am new to this whole Ruby thing. (personally im more fond of GML, but thats not even a programming language  :D) .

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Best RPG Maker User (Scripting)2010 Best Use Of Avatar And Signature Space
Just use Control Variable: Item [] in possession for items

For weapons and armor there is no evented way I know of, so the code is this:

Code: [Select]
$game_variables[variable_id] = $game_party.weapon_number (weapon_id)
$game_variables[variable_id] = $game_party.armor_number (armor_id)

That will only give the ones in your inventory though, and will not include armors or weapons that are equipped.

**
Rep: +0/-0Level 85
why yes, i SHALL shamelessy advertise in my sig!
Thanks, it works perfectly! but also, if you replace the word 'armor' or 'weapon' with 'item', it works for the items, too! thanks for your help!

*
Rep:
Level 98
2010 Best Veteran2014 Best Use of Avatar and Signature Space2014 King of RMRK2014 Favorite Staff Member2014 Best Counsel2014 Best Writer2014 Most Mature Member2014 Best IRC Chatterbox2013 Favorite Staff MemberSecret Santa 2013 ParticipantFor the great victory in the Breakfast War.Secret Santa 2012 Participant2011 Best Counsel2011 Best Writer2010 Best Writer2010 Funniest Member
Topic Resolved?

Please edit your first post and place [Resolved] in the topic title and select to lock this topic until it is necessary to open it again.

Thank you!

               -The Management
you awoke in a burning paperhouse
from the infinite fields of dreamless sleep

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Best RPG Maker User (Scripting)2010 Best Use Of Avatar And Signature Space
Yeah, but why use a script when you can use a built-in event command?  :police:

**
Rep: +0/-0Level 85
why yes, i SHALL shamelessy advertise in my sig!
I don't know... i guess to save mucking around with variables for ages. Off topic for a minute, know of any good ff-style side-view cbs?

**
Rep: +0/-0Level 85
why yes, i SHALL shamelessy advertise in my sig!
just joking. i know ur not allowed.