Chase event stops when approaching stealth area

Discussion in 'Javascript/Plugin Support' started by Shadowy_Darkness, Sep 23, 2017.

Thread Status:
Not open for further replies.
  1. Shadowy_Darkness

    Shadowy_Darkness Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I am trying to make a cool sneaking section in my game, but whenever I hide behind a wall the event sees me. I thought oh look Yanfly already has a stealth plugin. After it downloaded and I put down the stealth regions, I tested it out and now where the guard used to be able to see me behind the wall he just stops in place and won't continue walking until I leave his area where he would be able to see me. If there is a way to fix this that already exists I would be overjoyed to know. Thank you!
     
    #1
  2. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,807
    Likes Received:
    10,587
    First Language:
    English
    Primarily Uses:
    RMVXA
    A link to the page where the plugin can be found would be helpful so that people don't have to hunt for it.
     
    #2
  3. OnslaughtSupply

    OnslaughtSupply Ssshhh... Veteran

    Messages:
    730
    Likes Received:
    762
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Screen shots of your regions and how you set his move route with script calls is needed as well as the regions you set to stealth and maybe even the parameters you setup in the plugin. Event Chase Player can be a little buggie sometimes, as simple as it all seems, there is a lot going on in the engine that has to process. Also always make sure the frequency of the event is set to highest.
     
    #3
  4. Shadowy_Darkness

    Shadowy_Darkness Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright below are the links to the plugins and the pictures of the problem. Again thank you for your help!
    Links
    Chase Player: http://yanfly.moe/2015/10/21/yep-20-event-chase-player/
    Stealth Chase Player: http://yanfly.moe/2016/03/05/yep-79-event-chase-stealth/

    Stealth Areas. 41, and 40
    Capture.PNG
    Movement Code for the guard to walk in a circle and chase the player if the player is seen. Inside of the custom move route

    Capture2.PNG Guard stops right here and stops moving along his route as soon as I would enter into his sight range.
    Capture3.PNG
    Guard continues his route when player moves out of his sight range.
    Capture4.PNG
     
    #4
  5. Shadowy_Darkness

    Shadowy_Darkness Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    The Plugin parameters Capture5.PNG Capture6.PNG
     
    #5
  6. OnslaughtSupply

    OnslaughtSupply Ssshhh... Veteran

    Messages:
    730
    Likes Received:
    762
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Try putting the script commands before any movement commands in your move route.
     
    #6
  7. Shadowy_Darkness

    Shadowy_Darkness Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Just tried it, and the event still pauses when I'm within his sight
     
    #7
  8. Nova-Games

    Nova-Games Warper Member

    Messages:
    2
    Likes Received:
    2
    First Language:
    Norwegian
    Primarily Uses:
    RMMV
    yeah, im having the same problem.
     
    #8
  9. Keegan

    Keegan Villager Member

    Messages:
    9
    Likes Received:
    3
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Me too, the plugin said that:

    Once the player is detected, Stealth Regions stop applying and the alerted
    * event will chase the player (or flee from) even if the player runs into
    * another Stealth Region. The Stealth Regions remain disabled until the event
    * is no longer chasing (or fleeing from) the player.

    but it doesn't work
     
    #9
  10. IguanaGuy

    IguanaGuy Developing I.C.B.M. :Unleashed! Veteran

    Messages:
    145
    Likes Received:
    659
    Location:
    Winnipeg
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm glad to know that I am not the only one this is happening too. Just searched the forum threads about this situation and saw this one right away. Maybe it has something to do with the new version + plugin updates? I have tried a bunch of different options to make it work but nothing yet.
     
    #10
  11. Icenick

    Icenick Veteran Veteran

    Messages:
    158
    Likes Received:
    19
    First Language:
    English
    Not the same issue but I'm trying the plug-in to trigger enemy encounters on follower touch and it also doesn't work. Maybe these plugins are busted :(
     
    #11
  12. IguanaGuy

    IguanaGuy Developing I.C.B.M. :Unleashed! Veteran

    Messages:
    145
    Likes Received:
    659
    Location:
    Winnipeg
    First Language:
    English
    Primarily Uses:
    RMMV
    Well there was just a sight update to my RPG Maker a week or so back and I don't know what that was exactly. As far as I knew, Yanfly was updating his plugins to work with the new 1.6.1 version so maybe something changed in MV to undo that again. Of course, that is only a theory as I am no program script reader in any way, shape or form. I may try just doing my own event encounter eventing in the meantime in case this isn't a "soon" fix.
     
    #12
  13. Icenick

    Icenick Veteran Veteran

    Messages:
    158
    Likes Received:
    19
    First Language:
    English
    Well for dear of plugin plugin not working I'm using 1.51 lol but again I haven't tried your issue.
     
    #13
  14. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,183
    Likes Received:
    731
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    I made a thing! :kaohi:

    If you want to try it, either download the attachment or save the code in the spoiler below as a .js file (you can name it whatever you like). Then import it as a plugin, placing it immediately under YEP_X_EventChaseStealth in the Plugin Manager.
    Code:
    /*:
     * @plugindesc v1.0 - Patches some behaviours in Yanfly's Event Chase Stealth plugin.
     * @author Caethyril
     *
     * @help Place this immediately below YEP_X_EventChaseStealth in the Plugin Manager.
     *
     * Overrides nonSeePlayer function of YEP_EventChasePlayer (requisite):
     *   - makes events able to chase you outside their original stealth region.
     * Overrides chaseConditions & fleeConditions functions of YEP_EventChaseStealth:
     *   - prevents events from stopping and staring at you when you're stealthed.
     *
     * https://forums.rpgmakerweb.com/index.php?threads/chase-event-stops-when-approaching-stealth-area.84308/
     */
    
    // ~*~*~*~*~*~*~*~ YEP_EventChasePlayer stuff ~*~*~*~*~*~*~*~ //
    //  fix for chasing stopping immediately when going stealthy  //
    
    Game_Event.prototype.nonSeePlayer = function() {			// Override!
      if (Imported.YEP_X_EventChaseStealth) {
        if (this._alertLock <= 0 && this.meetStealthModeConditions()) {	// added _alertLock check
          this.stealthClearChaseSettings();
          this._stopCount = 0;
          return false;
        }
      }
      return !this._seePlayer;
    };
    
    // ~*~*~*~*~*~*~*~*~*~*~ YEP_X_EventChaseStealth stuff ~*~*~*~*~*~*~*~*~*~*~ //
    // fix for automatic movement stopping when player is in range but stealthed //
    
    Game_Event.prototype.chaseConditions = function(dis) {			// Override!
        if (this._alertLock <= 0 && this.meetStealthModeConditions()) {	// changed from $gamePlayer.isStealthMode()
          this.stealthClearChaseSettings();
          return false;
        }
        return Yanfly.ECS.Game_Event_chaseConditions.call(this, dis);
    };
    
    Game_Event.prototype.fleeConditions = function(dis) {			// Override!
        if (this._alertLock <= 0 && this.meetStealthModeConditions()) {	// changed from $gamePlayer.isStealthMode()
          this.stealthClearChaseSettings();
          return false;
        }
        return Yanfly.ECS.Game_Event_fleeConditions.call(this, dis);
    };
    
    // ~*~*~*~*~*~*~*~*~*~ end ~*~*~*~*~*~*~*~*~*~ //
    This comes in two parts:
    • First part to fix stealth causing chasing/fleeing events to stop immediately. Events should now continue chasing stealthy-you for a bit.
    • Second part to fix the halting movement for events that could chase you if only you weren't in a different stealth region.
    I only did a few quick tests, so let me know whether it works for you. :kaothx:

    Oh, and on the topic of non-stationary chase events: be warned that if they're set to return to position after chasing/fleeing, they'll return to the position they were in when they started chasing/fleeing, not their original starting position. Their automatic move route, if any, will then restart from the beginning. This may cause unintentional offsets in your guard patrols, etc. Just so you're aware. :kaoswt:
     

    Attached Files:

    Last edited: Jun 6, 2018
    #14
    CriticalGames, GloClo, zeep and 2 others like this.
  15. IguanaGuy

    IguanaGuy Developing I.C.B.M. :Unleashed! Veteran

    Messages:
    145
    Likes Received:
    659
    Location:
    Winnipeg
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey thanks for doing that Caethyril! I already went ahead and did something else for my current map, but I do have plans for the stealth plugin so I'll gladly look into and test your fix you made. I'm not sure if @Yanfly is aware of the issue or not and his profile is private here so I'm not sure how one could let him know about this bug. He may already know and be working on a patch up, but know knows? He probably has a lot on the go and a solo guy can only do so much in a day, right?
     
    #15
    caethyril likes this.
  16. Junol

    Junol Glitchdev Member

    Messages:
    4
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    You're my hero, Caethyril

    Seriously though, thank you, I'd been trying to find a workaround for this for 2 days with no luck
     
    Last edited: Jun 7, 2018
    #16
    caethyril likes this.
  17. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,183
    Likes Received:
    731
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Yes, I'm not sure what the Yanfly team are occupied with at the moment...maybe Pixel Maker MV? Thanks to all the spam Yanfly have received through other channels, I think the optimal means of contacting them is through Patreon, but I'm not a patron at present. Maybe someone who is will see this and pass it on.

    That said, it seems like a pretty old issue (2016) so I'm surprised I managed to solve it...I keep expecting someone to say it doesn't work. :kaoswt2:

    Took me a while to get there, too, but worth it. :kaophew: You're welcome! :kaothx:
     
    #17
  18. IguanaGuy

    IguanaGuy Developing I.C.B.M. :Unleashed! Veteran

    Messages:
    145
    Likes Received:
    659
    Location:
    Winnipeg
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't know how many people actually get around to using plugins like the chase event ones. I'm sure lots use the skill cores and battle plugins, but maybe ones like this don't get issues reported because only a handful actually fins this one useful? That's only a guess though. Maybe no one thought it was working incorrectly for their setup.
     
    #18
    caethyril likes this.
  19. bazrat

    bazrat Veteran Veteran

    Messages:
    233
    Likes Received:
    152
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    YOU ARE AMAZING! THANK YOU! This totally fixed my map!
     
    #19
  20. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,561
    Likes Received:
    4,123
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    bazrat, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



    Since the issue is solved, I'm closing this.

     
    #20
Thread Status:
Not open for further replies.

Share This Page