Getting the currently displayed stepping frame of an event

EHCB

Villager
Member
Joined
Nov 17, 2018
Messages
7
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hello! I have some events that I want to behave differently depending on which image is chosen for them in the editor

It was straightforwad to check which direction the events facing but I can't for the life of me find a way of referencing the current frame. I'm hoping it's something simple like
Code:
If (this._currentFrame==0){ blah blah};
and I just haven't come across the right documentation.

Any insight on this would be really helpful, I'm going to have to rethink how my whole game's put together if this isin't possible.

EDIT:

After digging through source files it LOOKS like
Code:
this._pattern
is what I'm looking for but it always seems to return 0 when I try and use it???
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Notes:
  • _pattern can be 0, 1, 2, or 3. I'm guessing you'll want to use pattern() instead: it returns 0, 1, 2, 1 respectively, corresponding to the sprite's displayed animation frame. :kaophew:

  • "this" is context-dependent: when used in a move route it references the moving character, but when used via a normal Script command (or Conditional Branch/Control Variables/etc), it references the interpreter. :kaoback:

  • Maybe just a typo, but remember to use a lower-case "i" on "if" in your script. :kaoswt:
I'd suggest something like this for a move route script:
Code:
if (this.pattern() === 0) { blah blah };
...or this in a Script command (or similar in Conditional Branch/Control Variables/etc):
Code:
if (this.character(0).pattern() === 0) { blah blah };
 

EHCB

Villager
Member
Joined
Nov 17, 2018
Messages
7
Reaction score
6
First Language
English
Primarily Uses
RMMV
I had no idea 'This.' On it's osn didn't work in event sheets!
Thank you so much, this is exactly what I needed!!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
You're welcome, happy RPG Making! :kaojoy:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top