Having some trouble with an event set to "event touch" trigger.

Jennavieve

Veteran
Veteran
Joined
Oct 21, 2020
Messages
54
Reaction score
47
First Language
English
Primarily Uses
RMMZ
I want to put a type of NPC in the game that follows the player and when the NPC touches the player it drains a set amount of the player's HP. I can get it to do that just fine but once it touches the player, the player gets stuck and the NPC continually touches the player, draining their HP until there's none left. That's not how I want it to work. I want it to drain the set amount once and then start over at following the player again.

I tried putting in a self-switch after the "decrease HP" command and that seemed to work the way I wanted at first but then when I edited it and tried to change the amount of HP it steals, it went back to functioning the same way it did before. Even after I changed the HP drain amount back to 1 like it was when it worked, it continued to function like it did originally again.

So now I'm just completely confused. How the heck do you get an event to not stick to the player once it touches them and does its thing?
 
Joined
Jul 12, 2020
Messages
95
Reaction score
18
First Language
English
Primarily Uses
RMMV
In case I'm not mistaken, wouldn't you need to implement a "wait" time? Like, idk...about 30-60 frames? That way, the event would stop constantly draining HP from the player when they touch them.

As for the player getting stuck, there could be a number of ways around that.
Have you tried setting the player-movement route to force the player away from the event? Perhaps allow the "skip" instead of "wait for completion"?

I don't believe you need switches for something like this...could be wrong though.
 

BK-tdm

Manga Maker
Veteran
Joined
Jun 21, 2018
Messages
189
Reaction score
368
First Language
English
Primarily Uses
RMMV
Try making the event and player jump back 1 step then do the hp drain effect, that way the event cant re-trigger instantly as you're not touching it anymore and 2 spaces should be enough room for the player to run before it catches up again (if it isnt, then adjust accordingly).

Also make sure this event is parallel and not autorun, as autorun will block player input until is resolved and if the touching is constant you will be looping the event, resulting in a slow looped death everytime.
 

Jennavieve

Veteran
Veteran
Joined
Oct 21, 2020
Messages
54
Reaction score
47
First Language
English
Primarily Uses
RMMZ
In case I'm not mistaken, wouldn't you need to implement a "wait" time? Like, idk...about 30-60 frames? That way, the event would stop constantly draining HP from the player when they touch them.
I tried this too and it didn't work either. It only made it take a little longer to drain all of the player's HP.

As for the player getting stuck, there could be a number of ways around that.
Have you tried setting the player-movement route to force the player away from the event? Perhaps allow the "skip" instead of "wait for completion"?
I think this is the solution my brain was trying to think of next but I was in brain fart mode already and couldn't get there lol. I'll try out the player movement command and hopefully that does the trick. Thank you :)
 

Jennavieve

Veteran
Veteran
Joined
Oct 21, 2020
Messages
54
Reaction score
47
First Language
English
Primarily Uses
RMMZ
Try making the event and player jump back 1 step then do the hp drain effect, that way the event cant re-trigger instantly as you're not touching it anymore and 2 spaces should be enough room for the player to run before it catches up again (if it isnt, then adjust accordingly).
I like the jump idea! That should do the trick and give a little more visual queue to the event as well. Sounds like exactly the solution I was looking for. Thank you for the idea!

Also make sure this event is parallel and not autorun, as autorun will block player input until is resolved and if the touching is constant you will be looping the event, resulting in a slow looped death everytime.
It's set to trigger with event touch, so it's not parallel or autorun. I do have a parallel process with a delay timer so that the NPC doesn't show up until a half-second after the player steps over the square that triggers its appearance. That part is working fine though. Of course, now that I'm writing this out I'm realizing I don't even need that either lol.
 
Last edited:

Jennavieve

Veteran
Veteran
Joined
Oct 21, 2020
Messages
54
Reaction score
47
First Language
English
Primarily Uses
RMMZ
In case I'm not mistaken, wouldn't you need to implement a "wait" time? Like, idk...about 30-60 frames? That way, the event would stop constantly draining HP from the player when they touch them.
The wait time thing ended up being the key. The other solutions you guys suggested also worked but I didn't like the way it looked with player movements or jumps. I ended up putting a wait command as a movement route for the NPC with wait unchecked and now it's working how I wanted. I tried just doing a regular wait command before and that was why it didn't work originally. Thank you again!
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,705
Reaction score
4,670
First Language
English
Primarily Uses
RMMZ
I'm assuming this is in RPG Maker MZ. Moving this thread since this is an implementation question.

I've moved this thread to RPG Maker MZ. Please be sure to post your threads in the correct forum next time. Thank you.


@Jennavieve , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

 

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

Latest Threads

Latest Posts

Latest Profile Posts

being able to transition music seamlessly is amazing. my main character's theme has lyrics and it goes from vocal version to istrumental when he leaves his room. and vice versa. and thanks to a plugin, the transition is seamless. I love it.
All of the auditions for our game are so good, I'm so glad I'm not in charge of choosing completely. lol I just can't with some of them. I listen to them on repeat. XD
Working on a Patch to integrate AlphaABS into random generated Dungeons. Was a bit tricky, but the outcome is a real Life Changer!!

Will release it the next days!
Been pretty busy... but I got a better headset for recording and listening today. Dad says that he'll consider taking me to Great Wolf Lodge for the first time once I finish summer classes (my final semester!) I'll be taking my plushie friends with me: Bendy, Lolbit, and Helen Henny. (I WUV PLUSHIES!)
SF_Monster3,4 added!

Forum statistics

Threads
105,651
Messages
1,015,295
Members
137,327
Latest member
Mezzy
Top