Autonomous Movement doesn't run/update outside the player's camera

Hey, I was making some mechanics involving the use of Autonomous Movement, but I have been stumbled. The Autonomous Movement doesn't run/update outside the player's camera (not even with Parallel Process). I have tried a snippet but it doesn't work (I get an error) even on a new project, which I assume is because of Ace's updates. Anti-Lag scripts has been suggested but it still doesn't run/update the Autonomous Movement when outside the player's camera.


Snippet error:

Spoiler



Snippet:

Spoiler
# Put [update] in the event’s name and the move route will always update.
#
# ~Kread


class Game_Event < Game_Character
#————————————————————————–
# * Determine if Near Visible Area of Screen
#————————————————————————–
alias_method🙂krx_alfix_ge_nts?, :near_the_screen?)
def near_the_screen?(dx = 12, dy = 8)
# YEA compatibility
if $imported && $imported[“YEA-CoreEngine”]
dx = dy = nil
end # YEA compatibility
return true if @event.name.include?(‘[update]’)
return krx_alfix_ge_nts?(dx, dy)
end
end



Demo (the guard should come from the right. interact with the event above the player to walk through water):

I know you can set a move route for an event outside the camera and it will update, but the move route has to be set in another event (so not in the move route of the event itself). At least I've had no issues with it, though an anti-lag script might make that not work. Could you use an autorun for the entire sequence you are trying to use by chance?
you'll need an advanced anti-lag script, and you'll need to mark the events that need to run outside the player area - of course no antilag will activate them as-is, because that would increase lag.


Please check the instructions for using the anti-lag scripts you found, and see how to mark map events as always run. Just adding an anti-lag script alone does nothing, it needs to be configured correctly.
I know you can set a move route for an event outside the camera and it will update, but the move route has to be set in another event (so not in the move route of the event itself). At least I've had no issues with it, though an anti-lag script might make that not work. Could you use an autorun for the entire sequence you are trying to use by chance?

I'm trying to do an operation while also doing the movement, so that's why it's not an actual move route. I've tried to put the route in 'Else', but it doesn't quite work haha.


VNv5G2F.png


you'll need an advanced anti-lag script, and you'll need to mark the events that need to run outside the player area - of course no antilag will activate them as-is, because that would increase lag.


Please check the instructions for using the anti-lag scripts you found, and see how to mark map events as always run. Just adding an anti-lag script alone does nothing, it needs to be configured correctly.

I actually marked them to always update and it doesn't work. In the demo I provided you can see I have some comments (both as a call and in the event) for the event but it still doesn't work. Beware though, the demo doesn't provide the script, it just have the comments.
I found the bug. The snippet is off. Try posting this instead:

Spoiler
# Put [update] in the event’s name and the move route will always update.
#
# ~Kread


class Game_Event < Game_Character
 #————————————————————————–
# * Determine if Near Visible Area of Screen
 #————————————————————————–
   alias_method🙂krx_alfix_ge_nts?, :near_the_screen?)
   def near_the_screen?(dx = 12, dy = 8)
   # YEA compatibility
   if $imported && $imported[“YEA-CoreEngine”]
     dx = dy = nil
   end # YEA compatibility
   return true if @event.name.include?('[update]')
   return krx_alfix_ge_nts?(dx, dy)
   end
 end



The error was the ' ' was the wrong version of them (I think they used ` instead, which won't work). I'll also post an updated version of your demo here with the correct snippet included, though I did change the guards move route while experimenting so you'll need to restore it to what you want.


http://www.mediafire.com/download/j1jmluqjdro9git/1.rar
I found the bug. The snippet is off. Try posting this instead:

Amazing! It works like a charm 😀


There is a little bug in the script that can be fixed easily, and it's that if you don't have Yanfly's Core Engine, it throws an error, but removing the line to check Yanfly's compatibility fixed the problem. Just something worth mentioning for by-passers.

Spoiler
# Put [update] in the event’s name and the move route will always update.
#
# ~Kread
 
class Game_Event < Game_Character
 #————————————————————————–
# * Determine if Near Visible Area of Screen
 #————————————————————————–
   alias_method🙂krx_alfix_ge_nts?, :near_the_screen?)
   def near_the_screen?(dx = 12, dy = 8)
   return true if @event.name.include?('[update]')
   return krx_alfix_ge_nts?(dx, dy)
   end
 end
If you marked them and it doesn't work, then you did something wrong with the script.
If you marked them and it doesn't work, then you did something wrong with the script.

I've tried 2 scripts in the demo and they don't work. Here's a demo so you can find out for yourself. From the scripts I've seen, they only update the event page and not the Autonomous Route which is the issue I was having. Enabling the script snippet (provided in the demo) fixes the issue.
Yeah, the check for Yanfly didn't post for some silly reason, but it's correct in the demo. Use that one instead.
Disregard what I earlier said, I seem to not have the bug appear in the snippet you posted. Ugh, those ninja bugs :ninja:

Original thread: https://forums.rpgmakerweb.com/threads/autonomous-movement-doesnt-run-update-outside-the-players-camera.68498/