Event Direction

I am making a battle system using regions that depends on the way that the enemy is facing. But every time the player triggers the event to attack, it turns toward the player and thus attacks him too. Is there a way to have an event not turn to face the player without using Direction Fix?
You control direction fix by turning it on whenever the even is moving in one direction and then turning it off right before it turns to another direction then back on as it begins to move in said direction. I've done something similar when designing a backattack system of sorts. The downside being that you have to have each of these enemies on a defined move route at least until they spot the player and being able to sneak up on them from behind becomes a moot point.
You control direction fix by turning it on whenever the even is moving in one direction and then turning it off right before it turns to another direction then back on as it begins to move in said direction. I've done something similar when designing a backattack system of sorts. The downside being that you have to have each of these enemies on a defined move route at least until they spot the player and being able to sneak up on them from behind becomes a moot point.
This worked but now my event will stop moving after a minute or two. Any ideas?
This worked but now my event will stop moving after a minute or two. Any ideas?
Show us a screenshot of your entire event (including all pages) - the error has to be somewhere else, because direction fix has nothing to do with moving itself.
Show us a screenshot of your entire event (including all pages) - the error has to be somewhere else, because direction fix has nothing to do with moving itself.
New to forums. How do I post a pic?
This is not a bug or any issue with the way the event is set up. By default, an event WILL turn towards the player the moment the player interacts with it. The very first command that's executed when you turn towards an event (in the script, not in event commands) is to turn towards the player.

The only way to STOP this from happening is to modify scripts.

It just so happens I HAVE a script that will do this 😉

Spoiler
#============================================================================# Disable NPC Lock# v1.0 by Shaz#----------------------------------------------------------------------------# This is a simple script to allow NPC events to continue with their move# route while you are interacting with them (they will not stop their # movement and turn to the player)#----------------------------------------------------------------------------# To Install:# Copy and paste into a new script slot in Materials. This script aliases# existing methods, so can go below all other custom scripts.#----------------------------------------------------------------------------# To Use:# Add the text <nolock> in a comment anywhere on your event's page# (the closer to the top, the better)#----------------------------------------------------------------------------# Terms:# Use in free or commercial games# Credit Shaz#============================================================================class Game_Event alias shaz_nolock_clear_page_settings clear_page_settings alias shaz_nolock_setup_page_settings setup_page_settings alias shaz_nolock_lock lock #-------------------------------------------------------------------------- # * Clear Event Page Settings #-------------------------------------------------------------------------- def clear_page_settings shaz_nolock_clear_page_settings @nolock = false end #-------------------------------------------------------------------------- # * Set Up Event Page Settings #-------------------------------------------------------------------------- def setup_page_settings shaz_nolock_setup_page_settings # look for collision in first block of comments list_index = 0 while list_index < @list.size && [108,408].include?(@list[list_index].code) if @list[list_index].parameters[0] =~ /<nolock>/i @nolock = true break end list_index += 1 end end #-------------------------------------------------------------------------- # * Lock (Processing in Which Executing Events Stop) #-------------------------------------------------------------------------- def lock shaz_nolock_lock if !@nolock endend
Put this script into its own slot below Materials, and add a comment at the top of the event pages with this:

<nolock>But for future reference,

How to take a Screenshot:


You've heard people say to take a screenshot, but how does one take a screenshot of their game? Simple, while the game is running, hit the Prt Scr button on your keyboard, which is located right next to your F12 key. If you're using a laptop, you might have to use the Fn key in combination with the Prt Scr key to get it to work.

Now that you've pressed the button, it's time to paste this screenshot into an image editing software. If you don't have anything fancy such as Adobe Photoshop, GIMP or Paint.NET, no worries; you can use MS Paint instead. Open up your image editing software, create a new file, and then hit ctrl+v on your keyboard, or simply right click on the screen and select paste. This should instantly paste the screenshot into your image editing software. You can go ahead and crop the image to suit your needs, or if you don't even know what that means, you can just upload it as it is.

Save the image as a PNG, or if you really need to, as a high quality JPG.

How to upload the image to the forums


Now that you have you have an image on your computer you'd like to show us, how can you get it to show up on the forums? Firstly, you need to find an image hosting site, photobucket.com or imageshack.us are popular ones. If you have another image uploading website, great - use that one! Either way, upload it to the site, and then get the direct link. Don't get the resized link, or the thumbnail link, but the direct URL. You'll know you have the direct URL if the URL ends with the file extension you saved your image in (which will hopefully be .png).



Once you have this direct URL to your image, simply use the IMG tags in your forum post and paste the URL in between them. If this image is big, please leave the image in spoiler tags.

IMG tags:
image.png
This is not a bug or any issue with the way the event is set up. By default, an event WILL turn towards the player the moment the player interacts with it. The very first command that's executed when you turn towards an event (in the script, not in event commands) is to turn towards the player.

The only way to STOP this from happening is to modify scripts.

It just so happens I HAVE a script that will do this 😉

Spoiler
#============================================================================# Disable NPC Lock# v1.0 by Shaz#----------------------------------------------------------------------------# This is a simple script to allow NPC events to continue with their move# route while you are interacting with them (they will not stop their # movement and turn to the player)#----------------------------------------------------------------------------# To Install:# Copy and paste into a new script slot in Materials. This script aliases# existing methods, so can go below all other custom scripts.#----------------------------------------------------------------------------# To Use:# Add the text <nolock> in a comment anywhere on your event's page# (the closer to the top, the better)#----------------------------------------------------------------------------# Terms:# Use in free or commercial games# Credit Shaz#============================================================================class Game_Event alias shaz_nolock_clear_page_settings clear_page_settings alias shaz_nolock_setup_page_settings setup_page_settings alias shaz_nolock_lock lock #-------------------------------------------------------------------------- # * Clear Event Page Settings #-------------------------------------------------------------------------- def clear_page_settings shaz_nolock_clear_page_settings @nolock = false end #-------------------------------------------------------------------------- # * Set Up Event Page Settings #-------------------------------------------------------------------------- def setup_page_settings shaz_nolock_setup_page_settings # look for collision in first block of comments list_index = 0 while list_index < @list.size && [108,408].include?(@list[list_index].code) if @list[list_index].parameters[0] =~ /<nolock>/i @nolock = true break end list_index += 1 end end #-------------------------------------------------------------------------- # * Lock (Processing in Which Executing Events Stop) #-------------------------------------------------------------------------- def lock shaz_nolock_lock if !@nolock endend
Spoiler
Put this script into its own slot below Materials, and add a comment at the top of the event pages with this:

<nolock>But for future reference,

How to take a Screenshot:


You've heard people say to take a screenshot, but how does one take a screenshot of their game? Simple, while the game is running, hit the Prt Scr button on your keyboard, which is located right next to your F12 key. If you're using a laptop, you might have to use the Fn key in combination with the Prt Scr key to get it to work.

Now that you've pressed the button, it's time to paste this screenshot into an image editing software. If you don't have anything fancy such as Adobe Photoshop, GIMP or Paint.NET, no worries; you can use MS Paint instead. Open up your image editing software, create a new file, and then hit ctrl+v on your keyboard, or simply right click on the screen and select paste. This should instantly paste the screenshot into your image editing software. You can go ahead and crop the image to suit your needs, or if you don't even know what that means, you can just upload it as it is.

Save the image as a PNG, or if you really need to, as a high quality JPG.

How to upload the image to the forums


Now that you have you have an image on your computer you'd like to show us, how can you get it to show up on the forums? Firstly, you need to find an image hosting site, photobucket.com or imageshack.us are popular ones. If you have another image uploading website, great - use that one! Either way, upload it to the site, and then get the direct link. Don't get the resized link, or the thumbnail link, but the direct URL. You'll know you have the direct URL if the URL ends with the file extension you saved your image in (which will hopefully be .png).



Once you have this direct URL to your image, simply use the IMG tags in your forum post and paste the URL in between them. If this image is big, please leave the image in spoiler tags.

IMG tags:
image.png
Thank you, Shaz. This was exactly what I was looking for.
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.

Original thread: https://forums.rpgmakerweb.com/threads/event-direction.25825/