Personally I just browse the project code files, in the project's
js subfolder...I also have several years of experience doing that. In this case, most of the relevant code (party, actor, equipment) can be found in
rpg_objects.js.
do you know how i can grab the equipment in the Nth slot while on the page?
Spoiler: Detailed explanation
First, we need an actor reference. In this case, we have the actor ID, so we can get a reference from
$gameActors. However, there's a shortcut available (search for
_menuActorId in rpg_objects.js and you'll see it pretty quickly):
You can reference their equipment with the
Game_Actor.prototype.equips method, as you tried:
JavaScript:
$gameParty.menuActor().equips()
This is an array of objects (
$dataWeapons and
$dataArmors references) that can be indexed like any other array. Remember that index 0 is the first element of the array, so to get the second equipped item you can use this:
JavaScript:
$gameParty.menuActor().equips()[1]
From there you can access any property you like, e.g. the name of the item in the current actor's second equip slot:
JavaScript:
$gameParty.menuActor().equips()[1].name
If you want to discover all the properties available to reference from the database objects, you have a few different options:
Note that
this is a JavaScript keyword; its value depends on where it is used. For example, a
Script command is evaluated in a
Game_Interpreter context, i.e.
this will point to an instance of
Game_Interpreter.prototype. More details:
The scope is the current context of execution in which values and expressions are "visible" or can be referenced. If a variable or expression is not in the current scope, it will not be available for use. Scopes can also be layered in a hierarchy, so that child scopes have access to parent...
developer.mozilla.org
A function's this keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between strict mode and non-strict mode.
developer.mozilla.org
Lastly...
I tried the following with no success.
this._actor.equips()[1](edited)
$gameParty.members()[1].equips()[1]
I'm guessing you saw an error when you tried to run this code? Something like "Cannot read property 'equips' of undefined"? If so, please note that the error messages are not just for show: they are deliberately programmed to (try to) point out what is going wrong. In other words, don't just say "no success" when confronted with a detailed error.
😴