I need help with this mechanic

I have made a chase mechanic in RPG Maker VX Ace, it detects the player when they are 5 cubes away from the enemy, and then starts following them. When he touches it a battle begins. I have done this with the RM variables, no script.

I would like to know how to make that if after, for example, 8 seconds of chasing, it has not reached the player, it stops, if possible. Also, if the player escapes from combat, the monster should give me a few seconds to run, and if I'm still there he will chase me again. And finally, if there is any way that after winning the fight, the enemy disappears fluidly, it is that when the fight ends, the enemy is no longer there. If I chose delete event, the combat ends and the screen becomes clear, but the monster is still there and suddenly POPs and disappears, I want this to feel more fluid, i mean, it is no longer there when the combat is won.

Can someone help me? Thank you
Basically you'll need a script for event timers, then you can key the event behaviour to those timers.

forget about doing it with pure eventing - it would get much too complex to simuate the different timers with waits, and there is only one official game timer that is not enough.

for your specific sequences we'll have to see screenshots of how they are done in your event before we can correct any sudden changes.
Basically you'll need a script for event timers, then you can key the event behaviour to those timers.

forget about doing it with pure eventing - it would get much too complex to simuate the different timers with waits, and there is only one official game timer that is not enough.

for your specific sequences we'll have to see screenshots of how they are done in your event before we can correct any sudden changes.
Ooh, I understand, well I expected it, but I don't know how to handle scripts and with my low level on programming I wouldn't know how to do this. Well, I can try to learn a little about it, and see if I can do something. Thanks for your quick help! Very grateful.
you don't need programming knowledge to use scripts.
you copy them into the script editor and then call them from events.
a minimal knowledge of ruby syntax might help for the more complex scripts, but most scripts have large help sections that tell you how to use them.

you can also read the tutorial "how to use a script" in my signature - a forum update several years back had messed up the formatting, but it should still be mostly readable.
you don't need programming knowledge to use scripts.
you copy them into the script editor and then call them from events.
a minimal knowledge of ruby syntax might help for the more complex scripts, but most scripts have large help sections that tell you how to use them.

you can also read the tutorial "how to use a script" in my signature - a forum update several years back had messed up the formatting, but it should still be mostly readable.
Yes, I just finished reading it, that was a lot of useful information. So I just have to find a ready-made script, and install it. I think Yanfly had a chase mechanics script for RMVX Ace, so I'll try that, I wonder if it has a Pixel movement script, I had installed Victor's Engine for it, but I don't want them to collapse from being together so I'll have to delete one and put the one from Yanfly's.

Thanks for your great help!! You seem to know a lot about the subject! it's good to have people like you to help those who are starting out in this.

I'll have you informated if something else. It's a pleasure 😀
I have a similar chase system for the enemies in my game, the IMGs below have a slime that detects the player if they walk within 3 tiles, looses track of the player if player is over 6 tiles away, and initiates battle if within 1 tile. If win the slime disappears (no 'Pop'), and if escape the Slime becomes transparant for ~3 seconds before checking if the player is within 3 tiles to chase again.
The enemies in my game only spawn in when the player sleeps to the next day, the script call I use to turn on the Self Switch A of the Slime is;
Code:
$game_self_switches[[@map_id, @event_id, 'A']] = true

#Eg. Slime Event is ID 30 on Map 1
$game_self_switches[[1, 30, 'A']] = true
Note that this isn't a script(in the script editor), but a default VXAce script call(Event Command Script)

I also used a script by Vlue(V.M of D.T) called Proximity Events, which is what those conditional branches are refering to.
Code:
Proxy.inprox?(@event_id, value)

Hopefully this can be used as reference for your escape commands or that pop issue.
I have a similar chase system for the enemies in my game, the IMGs below have a slime that detects the player if they walk within 3 tiles, looses track of the player if player is over 6 tiles away, and initiates battle if within 1 tile. If win the slime disappears (no 'Pop'), and if escape the Slime becomes transparant for ~3 seconds before checking if the player is within 3 tiles to chase again.
The enemies in my game only spawn in when the player sleeps to the next day, the script call I use to turn on the Self Switch A of the Slime is;
Code:
$game_self_switches[[@map_id, @event_id, 'A']] = true

#Eg. Slime Event is ID 30 on Map 1
$game_self_switches[[1, 30, 'A']] = true
Note that this isn't a script(in the script editor), but a default VXAce script call(Event Command Script)

I also used a script by Vlue(V.M of D.T) called Proximity Events, which is what those conditional branches are refering to.
Code:
Proxy.inprox?(@event_id, value)

Hopefully this can be used as reference for your escape commands or that pop issue.
Woooo thank you very much, It comes with a tutorial and all!! I Will make It work, i will notice you if i actually use it properly.
Thank you for your support!
Salutations from Spain 🙂
I have a similar chase system for the enemies in my game, the IMGs below have a slime that detects the player if they walk within 3 tiles, looses track of the player if player is over 6 tiles away, and initiates battle if within 1 tile. If win the slime disappears (no 'Pop'), and if escape the Slime becomes transparant for ~3 seconds before checking if the player is within 3 tiles to chase again.
The enemies in my game only spawn in when the player sleeps to the next day, the script call I use to turn on the Self Switch A of the Slime is;
Code:
$game_self_switches[[@map_id, @event_id, 'A']] = true

#Eg. Slime Event is ID 30 on Map 1
$game_self_switches[[1, 30, 'A']] = true
Note that this isn't a script(in the script editor), but a default VXAce script call(Event Command Script)

I also used a script by Vlue(V.M of D.T) called Proximity Events, which is what those conditional branches are refering to.
Code:
Proxy.inprox?(@event_id, value)


Hopefully this can be used as reference for your escape commands or that pop issue.
I have used the Proximity Event script from Vlue that you posted there, this is how i use it. Srry if you dont understand Spanish.
Its a little hard to understand spanish but RM's colour coding makes it possible.
Looks like it should be working to me, although there are a few points I'm not sure about.
Pg2. Esperar: 10 frame(s), Separacion Condicional
Not sure why you've got a wait command and a duplicate conditional branch. I never looked at Vlue's Demo so I'm assuming you've taken this from there? Also if this does what I think it does then you've taught me something as well. Thanks! Nice! I just checked out the demo, this fixes a prefire of the battle processing before the event reaches 1 tile of the player.
Pg2. Si Gana, Ruta de Movimiento: Este evento (Esperar)
Is this opacity fade ment for battle win? I thought you wanted the sprite to be already gone after battle win?
Pg4. Controlar Interruptor: A =Encendido
The SwitchA=On isn't needed here.
Its a little hard to understand spanish but RM's colour coding makes it possible.
Looks like it should be working to me, although there are a few points I'm not sure about.

Not sure why you've got a wait command and a duplicate conditional branch. I never looked at Vlue's Demo so I'm assuming you've taken this from there? Also if this does what I think it does then you've taught me something as well. Thanks! Nice! I just checked out the demo, this fixes a prefire of the battle processing before the event reaches 1 tile of the player.

Is this opacity fade ment for battle win? I thought you wanted the sprite to be already gone after battle win?

The SwitchA=On isn't needed here.
I based this in the demo, yes, and the opacity fade is made to give you a fading effect before disappearing completely, i think it looks better than just disappearing, maybe i could give it a corpse sprite after battle win. But for nowT that will be okay. About the switch A, i thought i would be necessary to return to the pg2 state, so if the player has already left from the detect zone, then he will stop, i will check right now and see. I'll tell you now. And one question, where do you put this:
Code:
$game_self_switches[[@map_id, @event_id, 'A']] = true

#Eg. Slime Event is ID 30 on Map 1
$game_self_switches[[1, 30, 'A']] = true

at the start i wanted to recreate what you showed me but i realized that i didnt know where to put that code and then i played the demo of the Proximity Event.

Its a little hard to understand spanish but RM's colour coding makes it possible.
Looks like it should be working to me, although there are a few points I'm not sure about.

Not sure why you've got a wait command and a duplicate conditional branch. I never looked at Vlue's Demo so I'm assuming you've taken this from there? Also if this does what I think it does then you've taught me something as well. Thanks! Nice! I just checked out the demo, this fixes a prefire of the battle processing before the event reaches 1 tile of the player.

Is this opacity fade ment for battle win? I thought you wanted the sprite to be already gone after battle win?

The SwitchA=On isn't needed here.
I replaced the SwitchA=On for a SwitchA=Off, i just saw that of course, since switch A was activated, when escaping from the range after the time had passed, he made the feint of trying to chase me, taking a step forward, and then releasing the "?" icon. If I removed the switch it did the same thing, so I put it but in Off, and now it returns to its original detection state. Thanks, I didn't realize the mistake!
where do you put this:
Code:
$game_self_switches[[@map_id, @event_id, 'A']] = true
That code will allow you to turn on or off a self switch from another event. In my game monsters are inactive by default, only when their SelfSwitchA=On do they show up ingame. Each day the player sleeps a randomiser picks a few monsters to activate. (so I put that code on my bed's event)
Your events are setup slightly different, so you'd use this to respawn one of your monsters
$game_self_switches[[@map_id, @event_id, 'B']] = false
$game_self_switches[[@map_id, @event_id, 'A']] = false
Just remember to switch out @event_id for the monster's event id that you're trying to respawn, and @map_id for the map its on
That code will allow you to turn on or off a self switch from another event. In my game monsters are inactive by default, only when their SelfSwitchA=On do they show up ingame. Each day the player sleeps a randomiser picks a few monsters to activate. (so I put that code on my bed's event)
Your events are setup slightly different, so you'd use this to respawn one of your monsters

Just remember to switch out @event_id for the monster's event id that you're trying to respawn, and @map_id for the map its on
I don't have much knowledge about scripts yet, I still have to read the help manual, but now I'll try what you told me. So your monsters spawn randomly? That is, in the same area, some monsters appear, but when you go to sleep, it is possible that others appear, is that right?
What an interesting idea! It gives variety to the encounters, some players will appreciate it. I don't know how you do it, well, I'm not even familiar with some aspects of the program.
I would like to try your game once it is playable!!

And another question, the unique way of making monsters respawn is with this code?
I don't have much knowledge about scripts yet, I still have to read the help manual
I define RM code in three different categories.
- Own Custom scripts (something I can't do)
- Other's Custom scripts (simple to use)
- Script Calls (also simple to use)
The Script Editor(F11) requires RGSS knowledge to create your own scripts, but you don't really need to know how to write RGSS if you're just using someone else's scripts.
Script Calls(EventCommand>Script) are exactly that, a call from a custom or default script in the script editor. I found that SelfSwitch Script Call in Archeia's Script Call Collection for VXAce.
So your monsters spawn randomly? That is, in the same area, some monsters appear, but when you go to sleep, it is possible that others appear, is that right?
Yes, a single monster has a group of three spawn locations, at random one is chosen and the monster is spawned. When the player next sleeps, the randomiser chooses again if it's the same spawn location and the player hasn't killed the monster then nothing happens, but if it rolls a location with no monster then that monster also spawns. So the population of monsters is always equal to the amount of monster groups I have, plus additional monsters if you don't cull them to keep the population in check. Also I've planned set it so that if you neglect culling monsters entirely, and all the monster groups fill up then emergency quests are issued or events are triggered, etc. The medicinal herbs and ore deposits in my game also refresh with this same mechanic.
And another question, the unique way of making monsters respawn is with this code?
Well this is how I do it, selfswitches. I know some games have a Wait Event Command so if you wait long enough on the same map then the monster respawns, another way is the EraseEvent Event Command so that a monster respawns every time you leave and re-enter a map.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-help-with-this-mechanic.172513/