RPG Maker Forums

I'm currently trying to make a NPC that behaves like the trainers in the pokemon games: if you pass in a area of tiles in front of them they'll trigger a battle. I actually got this working with a parallel event and a bunch of coditions (if looking in a certain direction).

The only thing that's missing is activating the fight by 'talking' to the NPC, since i used parallel eventing for the NPC i don't know how to make it also trigger by pressing a button.

This is how it looks:

and this is how the first page looks (the other pages are the animation of it walking up to the player and triggering the fight), 'Jogador' means 'Player' in portuguese and Laminha is the name of the monster NPC

Code:
◆Control Variables:#0001 Jogador X = Map X of Player
◆Control Variables:#0002 Jogador Y = Map Y of Player
◆Control Variables:#0003 Laminha01_X = Map X of This Event
◆Control Variables:#0004 Laminha01_Y = Map Y of This Event
◆If:This Event is facing Down
  ◆If:Jogador X = Laminha01_X
    ◆Control Variables:#0002 Jogador Y -= Laminha01_Y
    ◆If:Jogador Y ≤ 3
      ◆If:Jogador Y > 0
        ◆Control Switches:#0002 Giro Pausa = ON
        ◆Control Self Switch:A = ON
        ◆
      :End
      ◆
    :End
    ◆
  :End
  ◆
:Else
  ◆If:This Event is facing Right
    ◆If:Jogador Y = Laminha01_Y
      ◆Control Variables:#0001 Jogador X -= Laminha01_X
      ◆If:Jogador X ≤ 3
        ◆If:Jogador X > 0
          ◆Control Switches:#0002 Giro Pausa = ON
          ◆Control Self Switch:B = ON
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆
  :Else
    ◆If:Laminha 01 is facing Up
      ◆If:Jogador X = Laminha01_X
        ◆Control Variables:#0002 Jogador Y -= Laminha01_Y
        ◆If:Jogador Y ≥ -3
          ◆If:Jogador Y < 0
            ◆Control Switches:#0002 Giro Pausa = ON
            ◆Control Self Switch:C = ON
            ◆
          :End
          ◆
        :End
        ◆
      :End
      ◆
    :Else
      ◆If:Jogador Y = Laminha01_Y
        ◆Control Variables:#0001 Jogador X -= Laminha01_X
        ◆If:Jogador X ≥ -3
          ◆If:Jogador X < 0
            ◆Control Switches:#0002 Giro Pausa = ON
            ◆Control Self Switch:D = ON
            ◆
          :End
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆
  :End
  ◆
:End

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top