RPG Maker VX Ace

Set events to chase the player when the player comes within range or sight.

  • YF
  • 01/05/2012 05:29 PM

DL Link

This script allows you to make events that will chase the player or flee from the player when the player enters within range of the event or when the event sees the player.

Insert these lines into the script call window within the Movement Route event to give an event the chase or flee flag. This doesn’t work with players.

@chase_range = x

Event will chase the player after reaching x range.

@flee_range = x

Event will flee from player after reaching x range.

@chase_speed = x

Event will move at x speed when chasing.

@flee_speed = x

Event will move at x speed when fleeing.

@sight_lock = x

Event will chase/flee from player for x frames.

@alert_balloon = x

Event will show ballon ID x when chasing or fleeing.

@see_player = true

For events that require them to see the player first, use this script call inside the movement boxes. This does not follow line of sight rules, which means if there’s a rock blocking you and the event, it will still see you.

— And that’s all, folks! —

Original Blog Page


Pages: 1
to judges: if you play my game you will think about it twice playing it again!!!
it good for a mini-game :)
Or a custom encounter system. Well done, Yanfly!
Hey Yanfly,
I'm a script noob, but the alert box that appears if the music note.
I tried changing the @alert_balloon == 0 numbers to different numbers, but I still get the same result.

Could you tell me how I can change it to the exclamation mark or anything else?

Thank you sooo much!
Are you changing it to numbers that you have within the speech balloons? If you haven't added any speech balloons and have the default RTP speech balloons, you should be renaming them between 1 - 10.

(1 is the exclamation, which you probably want.)

Also, make sure it is "@alert_balloon = x" you seem to have two equal signs, which is probably why you're getting the name results.
Ah I got it!!!!

Haha so simple.

And what are you doing awake at this time!
You think there's a way I can play soundeffect so the monster makes noise when it starts to chase the enemy?
I never sleep, despite me going to school. >:D Sleep is for wussies.

Adding a sound effect in the event probably does that, I think you would make two separate events to the monster, one that scans the area to find you (passive), and another one which turns a switch on and makes it chase you (aggro, which would then play the sound. After it gets out of range, switch that switch off and go back to passive. But I haven't tested it yet, I'm going to try it in a second.
Is it possible to use this script to have a switch flip on/off when the enemy sees you?

Because I monkeyed around with it a bit and I don't seem to see a way to do it...

Putting it in the movement thing doesn't cause it to happen only when it sees you. It'll treat it like any other part of the regular patrol route.
Pages: 1