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
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???
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,419
Reaction score
1,830
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,419
Reaction score
1,830
First Language
EN
Primarily Uses
RMMZ
You're welcome, happy RPG Making! :kaojoy:
 

Latest Threads

Latest Profile Posts

just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.
Generate Actors, Dark Fantasy Monsters, & I Heard There Was a Chosen One, | RPG Maker News #42

Work on Cat Quest: The Last Catmancer continues slowly but surely. :kaopride: Today I received the Game Over screen from @Finnuval!
GameOver.png

Forum statistics

Threads
111,448
Messages
1,061,171
Members
144,812
Latest member
Kitaaku
Top