Hi everyone. This is my first time posting and I'm just starting to learn how to use RPG Maker MV, so apologies if I'm asking a very basic stupid question or posting this on a wrong forum...
So what I'm trying to do is make an event that if you trigger, it drains your hp if you are close to the event. It's basically a monster that attacks you if you are near it, like in games such as Hollow Knight.
The blue slime at the center is the monster, and if the player is at the highlighted tiles they get attacked. If I say the monster's x,y coordinate's (X,Y), player gets attacked if the player's coordinate is either (X, Y+1), (X, Y-1), (X+1, Y), (X-1, Y).
So what I did is set variables to something like this:
oookay this might be confusing because of the parts that aren't english (sorry) so let me explain
I made 8 variables that goes like this:
player x = player's x coord
player y = player's y coord
monster x = event's x coord
monster y = event's y coord
monster x+ = (monster x) +1
monster x- = (monster x) -1
monster y+ = (monster y) +1
monster y- = (monster y) -1
and then conditional branches, so if the player's coords is the same as the yellow highlighted tiles I mentioned before it turns self switch C on, which drains the actor's hp.
This works just perfectly, but it's a very tiring job since I have to set up 8 variables to each monster in every map.
So I was wondering if I could just use a script in conditional branch instead of setting up variables?
For example if I set up a conditional branch like
if player x = (monster x) +1
then I wouldn't have to make a variable monster x+, monster x-, and such.
I barely know anything about programming or scripts so this is a huddle for me.
Also I'm pretty sure there are people who've tried to make monsters like this but I couldn't google it out. If anyone know a plugin that can help it'd be great.
So what I'm trying to do is make an event that if you trigger, it drains your hp if you are close to the event. It's basically a monster that attacks you if you are near it, like in games such as Hollow Knight.
The blue slime at the center is the monster, and if the player is at the highlighted tiles they get attacked. If I say the monster's x,y coordinate's (X,Y), player gets attacked if the player's coordinate is either (X, Y+1), (X, Y-1), (X+1, Y), (X-1, Y).
So what I did is set variables to something like this:
oookay this might be confusing because of the parts that aren't english (sorry) so let me explain
I made 8 variables that goes like this:
player x = player's x coord
player y = player's y coord
monster x = event's x coord
monster y = event's y coord
monster x+ = (monster x) +1
monster x- = (monster x) -1
monster y+ = (monster y) +1
monster y- = (monster y) -1
and then conditional branches, so if the player's coords is the same as the yellow highlighted tiles I mentioned before it turns self switch C on, which drains the actor's hp.
This works just perfectly, but it's a very tiring job since I have to set up 8 variables to each monster in every map.
So I was wondering if I could just use a script in conditional branch instead of setting up variables?
For example if I set up a conditional branch like
if player x = (monster x) +1
then I wouldn't have to make a variable monster x+, monster x-, and such.
I barely know anything about programming or scripts so this is a huddle for me.
Also I'm pretty sure there are people who've tried to make monsters like this but I couldn't google it out. If anyone know a plugin that can help it'd be great.

