Getting the currently displayed stepping frame of an event

Hello! I have some events that I want to behave differently depending on which image is chosen for them in the editor
Gg1tJet.png

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???
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. 😮‍💨

  • "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. 👋

  • Maybe just a typo, but remember to use a lower-case "i" on "if" in your script. 😅
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 };
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!!
You're welcome, happy RPG Making! 😂

Original thread: https://forums.rpgmakerweb.com/threads/getting-the-currently-displayed-stepping-frame-of-an-event.114379/