Status
Not open for further replies.

Sarena

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
56
Reaction score
21
First Language
English
Primarily Uses
RMMZ
Hi, I'm using Triacontane's AutoSelfSwitch Plugin, and I'm looking for a way to either control multiple self switches, or to call a common event before the self switch is called.

Basically, I'm trying to create an enemy that will chase the player after they've reached a certain distance from them. Ideally, I'd like a balloon to pop up over the enemy's head once, then they will chase until the player gets out of range.
Right now, I can only create half of each of the two situations listed above.

Situation 1: A balloon pops up over the enemy and then they chase the player, but they never stop chasing the player even if they're out of range. This is because I have the parallel process balloon pop-up set to self switch A, which then turns on self switch D to chase the player and start the battle when the event collides with the player, and the plugin only allows you to turn off the initial self switch when they're out of range (which is A, the balloon, not D the chasing).

Situation 2: The enemy only chases the player until they're out of range, but no balloon pops up to indicate that the chase has started.

Here's the condition I set up in the plugin:
enemyChase.png

And here are the applicable event pages:
Page2.png
Page3.png
(the custom route is moving towards the player)

Any ideas on if this is possible, or how modifying the plugin could work for what I'm trying to do?
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,344
Reaction score
1,839
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
Well, I have an idea of using a parallel process to deactivate the chase:

1629069837012.png

I can think of other ways of doing that to... since you are using the move route command Towards Player, right?

You can turn your event page 3 into a parallel process (instead of touch event).
Then, calculate the distance between them like I did above.
If this distance is below or equal to 1, then the event has reached(touched) the player and you can proceed with your event.
If this distance is higher than the range, then you can proceed with your event. Something like that:
1629070868095.png

See if this can help you :)
 

Sarena

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
56
Reaction score
21
First Language
English
Primarily Uses
RMMZ
Well, I have an idea of using a parallel process to deactivate the chase:

View attachment 198746

I can think of other ways of doing that to... since you are using the move route command Towards Player, right?

You can turn your event page 3 into a parallel process (instead of touch event).
Then, calculate the distance between them like I did above.
If this distance is below or equal to 1, then the event has reached(touched) the player and you can proceed with your event.
If this distance is higher than the range, then you can proceed with your event. Something like that:
View attachment 198751

Thanks so much for your help! I mostly got it working by combining some of the code together that you made here.

Currently, the only weirdness I've seen is that sometimes the exclamation balloon pops up multiple times on top of itself when the player is running from the enemy on the map, so I was wondering if you could take a look at my event and see what might be causing that:

EnemyChaseEvent.png
I'm thinking it has to do with when the player is exactly at a distance of 10, it starts to double up. I'm stuck on what to change though to make more of a delay. I tried adding a Wait event before turning Self Switch D off and that didn't help either.

I ended up removing Page 3 like you recommended so that it doesn't use the Event Touch, though the only downside with that was that I was using Galv's Event Start Types plugin to determine battle advantages. I'm okay cutting that mechanic if I need to for making this work though.

I'm using event spawning from the VisuStellaMZ Event Move Core, which is why I updated some of the code to detect the current event instead of specifying a certain one, as well.
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,344
Reaction score
1,839
First Language
Portuguese - Br
Primarily Uses
RMMZ
Ok, so as I can see, you are only using the self switch D now to control the balloon, right?

I believe this is probably happening because the chase event page is still the same, regardless of the self switch D is on or off.
And even waiting for 5 frames is not enough, because if I record well, an event with a default speed and frequency takes 16 frames to complete a movement (walk to a tile to another). So, maybe the distance >= 10 conditions are being reached more than one time.

You could try putting 20 frames instead of 5, but being honest I believe I'm missing something here.

My suggestion would be that the balloon and the chase ( The detect player mechanic / The chase player mechanic) stay on different pages.

So on page X he detects the player, plays the ballon(or anything you want to do to represent the player being spotted), and goes to the chase page.
There you make your chase mechanic and put the conditions of the distance. If the player goes out of range, you can then turn the chase switch off, wait for 20 or 30 frames to be sure, and exit the event.

If the chase page has the self switch D as a condition, I believe it will be safer.

===========================

Ohh I get it. Galv Event Start types are really useful, I don't know if we can make an event that will replace him perfectly... Maybe you could use a parallel event to handle the stop chasing mechanic?
So you can keep this event as event touch and keep using galv.
 

Sarena

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
56
Reaction score
21
First Language
English
Primarily Uses
RMMZ
Ok, so as I can see, you are only using the self switch D now to control the balloon, right?
Yeah, I ended up making that Self Switch D just control the ballon.

I believe this is probably happening because the chase event page is still the same, regardless of the self switch D is on or off.
Okay, thank you! Splitting them into their own pages helped a bit, and then when I added a Wait event to the top of the page where the enemy detects the player (before the exclamation), it seems to work!

Here are the screenshots of the new events for future reference on what I did to make it work:
Chaser1.png
Chaser2.png

Ohh I get it. Galv Event Start types are really useful, I don't know if we can make an event that will replace him perfectly... Maybe you could use a parallel event to handle the stop chasing mechanic?
So you can keep this event as event touch and keep using galv.
I think this would work if I created the events straight on the map, but since I'm spawning enemies in from an external map, I haven't figured out a good way to reference these events other than referring to "this event". When printing to the console what the event numbers were, they were 1005+, which could get a little weird and be inconsistent between the maps. I've been spawning the enemies in so they can be easily duplicated and editable.

Though actually, after testing a few times, the Galv Event Starts do work sometimes even with it set to Parallel instead of Event Touch, so it might maybe be all good?

Thanks again for your help with this!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,344
Reaction score
1,839
First Language
Portuguese - Br
Primarily Uses
RMMZ
Ok then! Glad you made it worked!
Just a little tip about your event:
1629091505128.png
The exit event processing, make the game interpreter jump to the last index(last command) of the page.
So using the Exit Event Processing command on both conditions, is skipping the last "Wait 30 frames". Maybe that's why you have to put the Wait 30 frames on page 2 too.

But, on page 3, you can either put the 30 frames before every exit event processing(In fact, only in the first condition, because the second one is already on the end of the page.), or just put a jump to label that leaves you right before the 30 frames.

Just a minor detail, nothing to worry about :D
 

Sarena

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
56
Reaction score
21
First Language
English
Primarily Uses
RMMZ
Oh yeah, good point, thanks! I threw those in there while I was testing and forgot to remove them. I don't use the Exit Event Processing commands much myself, but how you explained it, it makes much more sense. :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,735
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Switch actor positions during battle
Download
01010.PNG
SF_People3_1 added!
index.php

Micro rant. The worst part of working from home when you live with your family is seeing how inconsiderate they are. "Hey, you're sitting in front of your computer, that means you're not doing anything! I want to put the TV at 200 decibels!"

If I was working in the office would you still talking me like that?
It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png

Forum statistics

Threads
118,510
Messages
1,116,503
Members
155,508
Latest member
theunderscoregreg
Top