Edit:
Took nearly 3 days but I figured it out! Thanks anyway all...
I couldn't find a script call to open the item menu (I need to make an item that uses a common event and then goes back to the menu...)
(Is there a way to directly open the item menu through plugin commands?)
What is it again the script call to check if the actor has the item in his/her inventory, and if he/she has it, he/she loose one of the item(s) he/she has in his/her inventory?
if($gameParty._items[id]>0) {
$gameParty.gainItem($dataItems[id], -1);
} {};
Replace id with the number in your items database. I'm guessing you're also going to want to do something else? If so you'll want to write your code on the third line above...
I'm creating a battle with two enemies (each of a different type) where I want different things to happen if the player tries to use the same ability on the different enemies. If you use an ability on one of the enemies, it will be turned to stone while the other is completely unaffected.
I'm using Yanfly's action system to do this and it works for most things (even without the plugin, I'd want to know how to do this in script), except my issue is this...
<setup action>
if ____________________ <----(I've tried a bajillion things here...)
{change switch 7: on}
else
{change switch 9: on}
end
</setup action>
What's the correct call for assessing the target of the current ability? Is it done with the enemyindex? target.enemyid? etc.
It's kind of cheesy, but I have a skill that applies an invisible state while launching a common event that reads like:
for(var i = 0; i< $gameTroop.members().length; i++){
if ($gameTroop.members().states().contains($dataStates[YourInvisibleStateIndex]) ) {
}
You could then check to see if that Troopmember is the right enemy type.
I'm trying to make the game keep track of the job points (I use Yanfly's job points script) of each member of my party and set up a condition that when they have a JP greater than or equal to 500 the switch turns on, but if they don't, the switch turns off. I've been trying this script call,
if ($gameParty.members()[0,1,2,3,4,5].jp >= 500) {$gameSwitches.value(1) === true} else {$gameSwitches.value(1) === false}
and the game doesn't detect any errors and I can test play just fine, but the switch isn't turning on when the members have 500 JP, so I'm thinking my switch command is wrong. I know it's not that the game can't recognize job points because I've been able to add and subtract JP from my party many times, it's just that the switch I have set to turn on with that condition will not turn on. So could anyone tell me where I might be going wrong with my script call?
Did you try using single equals signs?
I think, in JS, == and === are for testing a variable, not setting a variable.
I haven't found a script in the list to store the actor ID of an action in battle. But I have found this (that's a VXAce CS):
battle_info_user.id
Will it work with MV call script? Probably the syntax is different, maybe something like: $battleInfoUser.id will work? I really don't know a thing about scripts syntax I'm just making a guess looking at the list.
I made an account on this forum to ask this question thank you.
Is it possible to access any plugin activity's variables? How do you go about doing that ? For example I want to check is an npc can see me - using YEP's EventChasePlayer
Does any one know the script for checking if the down key is being pressed I tried (Input.isPressed(down)) but i keep getting error input undefined.