I don't see how. "calling an actor" to reference information doesn't trigger anything on passive state conditions. Of course, I don't see that you posted your actual errors anyplace to look at, but like I said, I put your original code into my game and it works exactly as expected.
That's why I recommended you troubleshoot your actual plugin installation, there's no reason this shouldn't work.
It does? You said earlier:
Regardless, when you say
that's telling me the plugin isn't working right.
And just as a tip, this isn't done correctly:
The null error is not coming from the user ID not being 37, it's coming from the user not having anything in equips slot 1.
It would correctly be:
Code:
condition=user.actorId()==37 && user.equips()[1] && user.equips()[1].atypeId==7;
Just out of curiosity, if all of this only applies to actor 37, why isn't the passive state just on that actor? Get rid of the checks for the actor ID, save yourself some code.
Changing it to user.equips did work, the error I had was returning a null value when nothing was equipped in said slot. Putting an additional conditional to check if slot 1 was equipped before determining if slot 1 was equipped with aType 7 solved this.
Yes indeed, I did switch the state to be set by actor instead, and removed the user.actorId condition, instead using multiple conditionals to verify that both a crossbow and a shield are equipped at the same time. This does seem to be a better solution as the end script being run is specific for an actor anyways.
The code I ended up going with is this:
Code:
<Custom Passive Condition>
if (
user.equips()[0] && user.equips()[0].wtypeId === 21 && user.equips()[1] && user.equips()[1].atypeId === 7)
{
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
<letbs>
sprite_name: Tristan_xbow_shield
</letbs>
and
Code:
<Custom Passive Condition>
if (
user.equips()[0] && user.equips()[0].wtypeId === 21 && !user.equips()[1])
{
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
<letbs>
sprite_name: Tristan_xbow
</letbs>
Easy enough, besides the oddball error at the start. Some of my plugins may be out of date anyways, which could also explain the issue. I think for all purposes the working code I ended up using will do what I need for the various actors I have, and as a benefit of using an actor to determine sprite instead of an equipment piece, I can also reuse the code for enemy battlers (which are more or less just AI controlled versions of my actors).
Lots of work to make a system coming even close to Final Fantasy Tactics. Especially with the LeTBS plugin lacking the ability to use conditionals and variables in a lot of its notetag calls, or not being compatable with sprite graphic overlay scripts. For example, changing classes and providing a unique sprite for every weapon combination would total up to 120,000 sprite sheets and 12,000 different states determining which sprite sheet to use. Or having to use different versions of the same skills to determine attack range based on which weapon is equipped. Having a simple sprite overlay plugin that worked or ways to adjust LeTBS tags without cloning an entire skill type would save me so much trouble and open up so many possibilities. Instead I think I am going to have to settle with a subclass system that only provides additional skills, limiting the different possible combinations per character and class to 5-10 each, rather than 40-80 each. With about 150 characters and 40 different classes, it becomes obvious where I will run into limitations without going deep into the plugin code itself and rewriting things. Once again, I am shown how beneficial being well versed in JS is for MV.
Here is an example of the notetag for one skill, Lucky Strike, which is a dual wielding attack that factors luck into its damage formula. I can do a lot with the Yanfly plugins, but when it comes to LeTBS, I think I am stuck with using a direct sequence without making a duplicate skill.
damage formula = (a.atk + (Math.random() * a.luk)) * 3 - ((b.def + (Math.random() * b.luk)) * 4)
Code:
<before eval>
var activeFighterID = BattleManagerTBS.activeEntity()._battler._actorId;
var value = activeFighterID;
$gameVariables.setValue(15, value);
$gameVariables.setValue(12, $gameActors.actor($gameVariables.value(15)).equips()[0].id);
$gameVariables.setValue(13, $gameActors.actor($gameVariables.value(15)).equips()[1].id);
$gameActors.actor($gameVariables.value(15)).changeEquip(1, $dataWeapons[0]);
</before eval>
<letbs>
scope: circle(1)
scope_select: enemies
sequence: lucky_strike
</letbs>
LeTBSConfig.js
"lucky_strike": [
"play_pose: user, atk",
"save_cells: lucky_strike_target, cursor_cell",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 20",
"use_skill: user, 36"
],
skill 36, Lucky Strike second swing:
(a.atk + (Math.random() * a.luk)) * 3 - ((b.def + (Math.random() * b.luk)) * 4)
Code:
<before eval>
$gameActors.actor($gameVariables.value(15)).changeEquip(0, $dataWeapons[$gameVariables.value(13)]);
</before eval>
<after eval>
$gameActors.actor($gameVariables.value(15)).changeEquip(0, $dataWeapons[$gameVariables.value(12)]);
$gameActors.actor($gameVariables.value(15)).changeEquip(1, $dataWeapons[$gameVariables.value(13)]);
</after eval>
Unless there is some way to contain the <letbs> tags inside a conditional if statement, I will have to duplicate both skills and the sequence for every weapon with a different range (such as a spear, or firearm), whose range is set by
scope: circle(1). This is much the same as the issue with the
sprite_name: Tristan notetag inside the <letbs> tag inside the states I am using to determine which sprite to use.
A bit of runaround to do something that could be handled inside a single conditional statement, but I can't exactly put JS inside the LeTBS notetags I don't think, nor have multiple LeTBS notetags inside the same skill or state and only run on a conditional, not without some deep edits to the core LeTBS system. As far as I am aware, anyways..