- Joined
- Feb 4, 2018
- Messages
- 66
- Reaction score
- 4
- First Language
- Portuguese
- Primarily Uses
- RMMV
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
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

