- Joined
- Nov 28, 2017
- Messages
- 21
- Reaction score
- 4
- First Language
- Greek
- Primarily Uses
- RMMV
I'm pretty new to JS, but I usually manage to pull off small variations to the default gameplay, by using some basic, non-complex scripting. Normally I have no trouble at all, but this time it seems that I hit a dead end.
What I want to achieve : Actor X gets afflicted by a State. At the moment of his next action ( I use Yanfly's BuffsStatesCore notetags for this), if another particular actor in the party doesn't wear a specific armor, Actor X gets afflicted by an additional State.
What I tried :
Unfortunately, nothing happens!
Then I experimented a bit by removing the exclamation mark
Funny conclusion with this one: the second state affects the target, no matter if the other actor equips the item or not!
I must be missing something very basic here...
What I want to achieve : Actor X gets afflicted by a State. At the moment of his next action ( I use Yanfly's BuffsStatesCore notetags for this), if another particular actor in the party doesn't wear a specific armor, Actor X gets afflicted by an additional State.
What I tried :
Code:
<Custom Action Start Effect>
var actor = $gameActors.actor(id);
var armor = $dataArmors[id];
if (!actor.equips(4, armor)) {
target.addState(id);
}
</Custom Action Start Effect>
Unfortunately, nothing happens!
Then I experimented a bit by removing the exclamation mark
Code:
<Custom Action Start Effect>
var actor = $gameActors.actor(id);
var armor = $dataArmors[id];
if (actor.equips(4, armor)) {
target.addState(id);
}
</Custom Action Start Effect>
Funny conclusion with this one: the second state affects the target, no matter if the other actor equips the item or not!
I must be missing something very basic here...