Pokemon Mystery Dungeon-Esque Battle System

Lascif

Warper
Member
Joined
Dec 9, 2015
Messages
2
Reaction score
1
First Language
English
I'm currently trying to replicate a system of battle alike to Pokemon Mystery Dungeon.

The player is in a dungeon with multiple enemies which when close enough, starts to follow the main character.
However I have came across an issue that I can't seem to solve.

Whilst I have created the system in which the enemy follows the main character and waits for your input before they move I can't initiate another trigger loop which activates as soon as the enemy touches you.

As soon as the enemy touches me it needs to trigger a new event.

Is there any way to have another conditional if, inside my loop which escapes when that current event touches the player?



P.S
I have tried tracking the X, Y co-ordinates of both the enemy and the player however I'm unsure of a way to use that as a means of escape for my loop.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
I've moved this thread to MV Support (this is an event, not a script, and you posted in the XP/VX/Ace script forum). Please be sure to post your threads in the correct forum next time. Thank you.

So you want, as soon as your event touches the player, for the loop to break and to be able to do something else?

I would do this:

Conditional Branch: Script: p = $gamePlayer; e = $gameMap.event(this._eventId); (Math.abs(p.x - e.x) + Math.abs(p.y - e.y)) === 1  # enemy is on a tile next to the player, and is facing the player - this can be considered 'touching' the playerBranch End

That's getting the distance between the event and the player horizontally and vertically and adding them together.  If the result is 1, that means the event is on a tile next to the player.  And because they've just done a Move Toward Player, you know they're facing the player.
 

Lascif

Warper
Member
Joined
Dec 9, 2015
Messages
2
Reaction score
1
First Language
English
Thanks for the quick reply!

Sorry about the misplacement of the thread. I wasn't sure of where it would be placed because I wasn't sure if it was script/version specific.

Where/How would I apply this custom script?

I can't seem to create an open-ended conditional branch.

Also regarding the API of the scripting, is there a list of all RPGMaker Specific objects and instances?

Thanks
 
 

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

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
Day 9 of giveaways! 8 prizes today :D

Forum statistics

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