You're right@raffle your question deserves its own thread. I believe you will get more responses for doing so than asking it here.
.equips()
", which gives you all of the actor's currently equipped gear. For each piece of gear in this array, I need to check if any of the equipment has a baseItemId of x.did you try?:Hi, I'm trying to help someone w/ a plugin issue. I need to check if any of an actor's equipment has a baseItemId of a certain value. The problem is I'm not trying to check the array's elements itself, but rather, an element of an element if that makes sense. (element might be the wrong term, sry).
The array is an actor's ".equips()
", which gives you all of the actor's currently equipped gear. For each piece of gear in this array, I need to check if any of the equipment has a baseItemId of x.
View attachment 206469
$gameParty.menuActor().equips()[0].baseItemId === x
// "x" should be the number which you are looking for
// this returns true or false and can be put in a "if condition"
if ($gameParty.menuActor().equips()[0].baseItemId === x) {execute stuff here if true};
That only checks a specific slot, it won't return true if any of the slots have the appropriate item. You could use that syntax and check each individual equipment slot, but that's what the inherent some() function is designed to handle.did you try?:
You can use the inherent array foreach() function. So, for example:Quick question, what would the eval be to apply a state to all allies and enemies?
$gameTroop.aliveMembers().foreach(battler => battler.addState(X));
Hmm, trying that out, I'm getting the following error:You can use the inherent array foreach() function. So, for example:
Code:$gameTroop.aliveMembers().foreach(battler => battler.addState(X));
$gameTroop.aliveMembers().foreach(battler => battler.addState(32));
You should be able to do this. You'll want to tie it into probably the commandWindow handler. If that's not quite enough for you to go on, this deserves its own plugin request thread.Bit of a long shot but does anyone know a way of triggering script between battle menus?