Regarding event touch trigger

Hello.
 
I'm trying to make a simple ABS system and some parts relies on eventing.
Basically, I have an event on the map that is the enemy, its role is to chase the player and so when it touches the player it triggers a damage handling routine.
Everything works fine but there's still a problem:
 
Whem the player is standing still, its good, damage is processed fine.
But if the player moves toward the enemy event, and keeps the move input key pressed, it keeps touching the event and so there are a LOT of damage processment.
The worst is that when I implement the player action (when we attack the enemies), the player (person playing) will mostly keep the move input key pressed toward the enemy event, so he can hit the enemy. And he is gona die before he can kill anything because of those unwanted touches.
 
There's an image of my event, the other pages only controlls the trigger that makes the enemy move toward the player, but the event touch is only what matters:
 

Spoiler
14nmwht.jpg
Any ideas?
Why have you placed the wait inside a set move route?


A set move route starts a different process in the game loop - if there is no wait in it, the set move route and this event page will be processed independently of each other. That is why the damage can be done more often than once per second.


Try if it works if you use the regualr wait command, not the one inside the set move route.
Why have you placed the wait inside a set move route?

A set move route starts a different process in the game loop - if there is no wait in it, the set move route and this event page will be processed independently of each other. That is why the damage can be done more often than once per second.

Try if it works if you use the regualr wait command, not the one inside the set move route.
I used it inside the move route because using the regular one blocks the player movement and I only need to make the enemy wait before doing damage again, the player may be able to run away.

The damage made by the enemy is working fine, if I (the player) stand still it damages me once every second.

On the other hand, the repeated damage is made by the player itself, its triggered when I keep the move key pressed toward the enemy.

Lets say:

Im at position [0, 0], the enemy is at [1, 0].

If I keep the "->" button pressed, the event will be triggered lots of times.
bump
That is very simple to Solve.

When your Hero Hits the Event , the Hero will stay unmovable unitl the Eventpage finished.

To Solve this we activate a Self Switch at the end of the first Page.

The Seccond Page will have that Switch as Condition and the Page must be Paralell.

On this Page you make 60Frames Wait Command, than Self Switch Off.

Thisway your Hero is Free to walk again, and the Event just Waits 60 Frames before switching back to the Atack Mode Eventpage.

If the Eventgrafik changes to the wrong direction, even this can be Fixed in a Way that the Player will never notice it.
That is very simple to Solve.

When your Hero Hits the Event , the Hero will stay unmovable unitl the Eventpage finished.

To Solve this we activate a Self Switch at the end of the first Page.

The Seccond Page will have that Switch as Condition and the Page must be Paralell.

On this Page you make 60Frames Wait Command, than Self Switch Off.

Thisway your Hero is Free to walk again, and the Event just Waits 60 Frames before switching back to the Atack Mode Eventpage.

If the Eventgrafik changes to the wrong direction, even this can be Fixed in a Way that the Player will never notice it.
You are a genious!

Even thou i didnt use you idea exactly, i just changed the "event touch" to "parallel process" (and thats why you are genious), now i control it so the hit only happens if the enemy is at the range required by the skill used to hit.

Also I managed to control the "wait" inside the script, thanks a lot.
But your Way you might get many PAralell Events that slow your Game down.

My Solution uses the Paralell Event just for short Times and not all at once.

But one Paralell Event could for example handle the attack stuff of many enemies, thatway not every enemie neds to be on Paralell Process all the Time.

You might get trouble with Performance with more than 20 to 30 Paralell Events and some Tint Screen Effects at the same Time + Animations and Stuff.

Maybe this could be interesting for you?

http://steamcommunity.com/sharedfiles/filedetails/?id=400971763
Wow what a lot of zombies!
 
I see your point, im gona use it on runtime made maps, cloning the enemies using Shaz's event clone, and Im using moghunter's anti lag. Anyway I dont expect to have that much enemies on screen at once.
Well, I may run some tests... its a basic abs anyway, cant espect much hehe
 
Thanks for the advice, Im gona check that dayzed project too
 
EDIT: forgot to say, I guess its not good to use approach trigger also, ranged enemies does not need to get closer
EDIT 2: just tested using 50 events, no problem at all.

Image:

Spoiler
wjys1z.jpg
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.


at OP's request

Original thread: https://forums.rpgmakerweb.com/threads/regarding-event-touch-trigger.43212/