Main Menu

Is there a 'code' for how many of a certain item/armor/weapon the player has?

Started by GEXROX, July 04, 2008, 09:53:43 AM

0 Members and 1 Guest are viewing this topic.

GEXROX

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) .

modern algebra

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:


$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.

GEXROX

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!

Sophist

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
[fright]you awoke in a burning paperhouse
from the infinite fields of dreamless sleep
[/fright]

modern algebra

Yeah, but why use a script when you can use a built-in event command?  :police:

GEXROX

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?

GEXROX