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.
Armor Check help

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 70
RMRK Junior
Hi, I'm somewhat new to the site, and suppose to Rpg Maker Vx as well. Anyway, I've been working on a game recently and have run into some troubles.

The Problem:

I need to be able to check what armor (specifically helmets in this case) an actor is wearing from a script call. I know a tiny bit of the scripting as I have edited various scripts and even produced some basic overides and notebox checking scripts, but I can't seem to figure out how to check what armor an actor is wearing at the moment. If you know of a way for me to check this or even a way to create a script to asign a variable to each armor type it would be wonderful if you could explain it to me.

Anyway, any help would be greatly appreciated and if (but hopefully when) I ever get a game out there credits would obviously be given (assuming it's a free game. I don't expect to be selling anything anytime soon)

Many thanks,
    ~Aero_drake

*
Rep:
Level 82
If you know a bit on scripting, this isn't too difficult.

Everything about an actor is held in the $game_actors class.

You can access the weapon(s) an actor has with:

$game_actors[n].weapons

You can access the armor(s) an actor has with:

$game_actors[n].armors

Or you can get all the equipment (both weapon(s) and armor(s)) with:

$game_actors[n].equips

replacing 'n' with a number. I'm not entirely sure how the data is stored in $game_actors. I don't know if the actors get sorted into an order, or if they are just added to the end of the array as they are encountered and added to the party. I've not really looked into it much yet. So unless someone comes by to provide more details, just play around with it or run an additional check to find out what actor is at the given 'n' value.

If you want more specific information for Helmets, you can get this from either (in some kind of code format):

Code: [Select]
armors = $game_actors[n].armors
helmet_id = armors[0]  #if using Two Swords Style
or
helmet_id = armors[1] #if not using Two Swords Style

or

Code: [Select]
equips = $game_actors[n].equips
helmet_id = equips[2]

Obviously, they are stored as IDs so you'll have to find out what armor that relates to. $data_armors[helmet_id] will probably find it though I'm not 100% sure.
(Why do I always feel like it's the end of the world and I'm the last man standing?)