Thank you so much for all the help! I will read over through all of the provided links to get a better understanding of the system and JS in general. The last thing I need to do is update this bit of code to grab the weapon id (it is currently grabbing the array I believe of all of the weapon mods)
Code:
var weapon = DataManager.getBaseItem(a.weapons()[0]);
var value = weapon;
$gameVariables.setValue(12, value);
I can probably find this in the script call guide, perhaps? Going to go look for it now. Then take a break from the double wield shenanagins because I don't even want to start thinking about how much a pain it is going to be to perform this same function for enemies, but maybe it won't be too difficult if I am using HIME's enemy equip script. I could likely just call a state or a skill to do the same thing I am doing here, but use his custom tags to perform the swaps instead. That actually doesn't sound too hard, heck it may even be easier, especially now that I can cross reference the working code.
I am currently on class 3 of 33 total for my SRPG project. I think I have about 30-40 skills already setup and working as intended, with the AI even using skills based on specific conditions that seems to be working much better than expected. Never thought I would really get back into RPG Maker, its been over 20 years since I was messing with RM2K, and I gotta say, it feels pretty good to be back! The community has grown a lot too, much bigger than the old crew that used to rip sprites and share tips how to make custom battle systems with common events and variables. I suppose I have a little catchup to do!
::edit::
I did find this, but I think I would rather use the above type code as the a.weapons specifically refers to the attacker if I am not mistaken. If I were to use the below code however, it would be as simple as running this after the initial actorID script, and replacing actor(5) with $gameVariables.value(14) or [$gameVariables.value(14)], if I am correct.
Code:
$gameVariables.setValue(12, $gameActors.actor(5).equips()[0].baseItemId);
This is what I came up with:
Code:
var activeFighterID = BattleManagerTBS.activeEntity()._battler._ActorId;
var value = activeFighterID;
$gameVariables.setValue(15, value);
$gameVariables.setValue(12, $gameActors.actor($gameVariables.value(15)).equips()[0].baseItemId);
Am I doin' it rite?
::final edit::
GOT IT!
Code:
$gameVariables.setValue(12, $gameActors.actor($gameVariables.value(15)).equips()[0].id);
$gameVariables.setValue(13, $gameActors.actor($gameVariables.value(15)).equips()[1].id);
Thank you again, ct_bolt and everyone else!
::edited after some testing::
It turns out the script was only working incidentally, due to an improper call returning a 0 which actually was the slot index for the character I was testing, meaning that characters in slots 1 and up do not work at the moment with this script.
The theoretical solution I have found is to instead find the character's proper slot id (in relation to party order, slots 0-3), based on who is currently the active battler. As I am using a custom battle system (LeTBS), I am of the mind that traditional calls in the battle scene will not pull the correct slot if any, so I am kind of stuck. I did go through the console and running "BattleManagerTBS.activeEntity()._battler" returns a hefty amount of results, including an actorId (5 for the character in slot 0), however I do not see anything that would associate this activeBattler with their party formation slot, which appears to be what is actually needed to run the equip character script. I had thought characterIndex was what I wanted, but it shows 0 for all battlers when active, which is why the script worked only for the lead party member (and why I thought it was returning the value I was looking for). Not really sure the best way to do this, but I think if I could find the character party slot from the actorId, I could use this to correct and complete the formula, but I am finding very little to no information on how to do this. I would think there are methods to find the character slot number based on active battler would work I imagine, but just unsure if this would work with the custom battle system, which used BattleManagerTBS instead of BattleManager.
The only other solution to this that I can think of would be using a command similar to "$gameVariables.setValue(12, $gameActors.actor($gameVariables.value(15)).equips()[0].id);", however one that equips the identified character based on their actorId instead of slot placement.
Maybe by assigning a state to the active battler via the skill used that calls this script, there could be some way to figure out the ID of the character in question. I am probably going to try some novel solutions to this tomorrow. Maybe equipping via a state with HIME's equip mod would be the best way to do this, bouncing variable equations in and out with some Yanfly scripts.
Surely there is a way around this.
-------------
This was fixed by switching $gameParty.members to $gameActors.actor, which looks for the actorId instead of the party placement. Reading through the documentation more clearly would have likely helped me prevent this mistake. Thank you again everyone for the help.