RMMV Trying to stop map movement of events with chase player on.

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
243
Reaction score
121
First Language
English
Primarily Uses
Alright, so I have on map encounters with both of my games. Now, when a player escapes, I wanted to give them a grace period where they can't be bumped into an encounter again. I also wanted to make it so that opening a chest or watching a cutscene after avoiding following encounters doesn't create a massive queue behind the player. I figured this plugin was perfect:
Just hit stopmapmovement and events stop... But....

The problem is that some of these on map encounters use this plugin to chase the player when they're spotted:
And any event that's in range of the player (screen and a half distance-ish) doesn't stop their player-spotting routines, and if they're already alerted they'll continue to follow the player regardless of stop map movement.

However, this does work:
When a player is put into stealth, events stop following them. This is fine for escaping, since my original escape event had the player turn semi-transparent anyway, but for cutscenes turning transparent doesn't work. There are script calls that turn off the gauge, and the change in speed, but not the transparency.

TL;DR: Is there a way to call event commands from event chase stealth to get the effect of breaking all events on map chasing the player without the opacity change?

I've been looking through the plug-in's javascript and tried this section out:
Code:
Game_Event.prototype.stealthClearChaseSettings = function() {
    if (this._chasePlayer) this.endEventChase();
    if (this._fleePlayer) this.endEventFlee();
    this._alertLock = 0;
    this._alertPlayer = false;
};
By calling it as Game_Event.prototype.stealthClearChaseSettings()
It didn't return an error in the console, but it also didn't do anything. I'm at a bit of a loss.

Edit:
Also you've got:
Code:
Game_CharacterBase.prototype.opacity = function() {
  var opacity = Yanfly.ECS.Game_CharacterBase_opacity.call(this);
  if (this.isStealthMode()) opacity *= this.stealthTransparencyRate();
  return opacity;
};
Which seems to be the function that sets the player's opacity based on the plug-in settings. I wonder if I can't splice in a conditional that requires a switch to be on for the opacity to apply...
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,771
Reaction score
2,123
First Language
EN
Primarily Uses
RMMZ
First, check whether your Yanfly plugins are loading in the recommended order, listed here:
Notably, Stop Map Movement should load after the Event Chase plugin(s). You can click+drag to rearrange plugins in the Plugin Manager. Remember to save your project to apply Plugin Manager changes before testing.

If that doesn't fix it, you could try putting the following in a Script command:
JavaScript:
$gameMap.events().forEach(function(e) { e.stealthClearChaseSettings(); });
I.e. "for all events on the map, clear their chase settings". I think this will make all events on the map leave "alert mode", which might be overkill if you just want them to stop where they are for a while.

In case it helps: I have an RMMV plugin that can make map events visually freeze and/or have their triggers disabled when a specific switch in on. Link:
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
243
Reaction score
121
First Language
English
Primarily Uses
@caethyril Yeah, I make absolutely sure that plugins are in the right order, so it's not that (though I did try changing the positions of the plugins that are involved a few times just to make sure). Also, googling makes it clear that stopmapevents has no effect on event chase player, go figure.

Anyway, thanks for the code you gave me, it... half-works? When the script runs any events chasing the player go back to their original positions and stop chasing the player, but if the player is in their line of sight when it runs they get alerted again.

I'm thinking I'll try to edit the plugin:
I'm gonna try changing:

Game_CharacterBase.prototype.opacity = function() {
var opacity = Yanfly.ECS.Game_CharacterBase_opacity.call(this);
if (this.isStealthMode()) opacity *= this.stealthTransparencyRate();
return opacity;
};

to
Game_CharacterBase.prototype.opacity = function() {
var opacity = Yanfly.ECS.Game_CharacterBase_opacity.call(this);
if ($gameSwitches.value(x) == true)
{
if (this.isStealthMode()) opacity *= this.stealthTransparencyRate();
}
return opacity;
};

If that doesn't work, I'll take a look at your plugin, thanks.\

Edit:
It's ham-fisted, but the above works
 
Last edited:

Latest Threads

Latest Profile Posts

Playing Aroma Indosiar theme song.
Aroma is an Indonesian TV show about cooking. :)
Working on a characteeer! (Why is it so hard to color hair?) ;-;
Silly-Sketches.png
Just finished eventing a couple simple puzzles in RMMV, for my very first game "Sample Quest." Just messing around, throwing things together, and calling it a story XD On a non-RM note, got my hair cut today!
I feel the need to inform everyone on the forums NOT to go with Web Hosting Canada for your hosting needs. It is by far the worst customer service and just overall experience I have ever had with hosting and I am Canadian...
BCj
Got another eye surgery monday. Hope I'll recover quick and all's well. A bit tired of surgeries. On a happy note, working on the next chapter of Escalia so hope I can continue soon :)

Forum statistics

Threads
115,372
Messages
1,089,347
Members
150,067
Latest member
GutterRat
Top