RMMV Action Sequences - function for checking user's enemy index?

Damascus7

Veteran
Veteran
Joined
Jul 21, 2019
Messages
143
Reaction score
39
First Language
English
Primarily Uses
RMMV
Hi there! I'm using Yanfly's Action Sequences and I'm just looking for a particular function that I can't find in any documentation I checked, which is checking the index of the enemy that used it so I can run one of two particular choices in the action sequences. Here's an example:

Code:
motion spell: user
action effect
if user.enemyId() == 0
  change variable 139 = 3
  change variable 140 = 0
else
  change variable 142 = 3
  change variable 143 = 0
end
common event: 52

I've tried using user.index(), user.id(), user.enemyId(), and user.enemyIndex() but none of them works. I've used the function for checking a player's index before, but never for an enemy's, and I can't find the function listed anywhere. I might also be getting my syntax wrong, but I don't know.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,553
Reaction score
3,619
First Language
English
Primarily Uses
RMMV
I don't see the relevance of the action sequence you posted to your question.

However, here's my favorite reference:

user.index() is the correct method, and it should work for both enemies and actors.

if user.enemyId() == 0
You know this can never be true? IDs in the database start at 1.
 

Damascus7

Veteran
Veteran
Joined
Jul 21, 2019
Messages
143
Reaction score
39
First Language
English
Primarily Uses
RMMV
I don't see the relevance of the action sequence you posted to your question.
I basically have a skill where I change different sets of variables depending on which enemy on the field is using it.

However, here's my favorite reference:

user.index() is the correct method, and it should work for both enemies and actors.


You know this can never be true? IDs in the database start at 1.
Thank you, I'll bookmark this link. Your suggestion worked perfectly, thank you.
 

Latest Threads

Latest Posts

Latest Profile Posts

Tried something. Little sneak peak of Unity AD.
M42S7Us.gif

It's the little things. Lengthened the time the bar fades in and out to be a bit more comfortable.
3 days until release!

Forum statistics

Threads
125,736
Messages
1,173,114
Members
164,882
Latest member
thuthiemzeitriver1
Top