Overworld enemies spot you?

Myzma

Veteran
Veteran
Joined
Dec 7, 2014
Messages
32
Reaction score
1
First Language
English
Primarily Uses
Is it possible to make it that enemies are on the overworld, but when they see you, they start running towards you?

I'm making an Earthbound-like game, so I want to make enemies on the overworld more like earthbound's. I've done it before, but

it didn't feel at all the same, it felt more like npc's wandering around and if you touch one, the battle starts.
 

EliteKilljoy

Beta Tester, English Proofer, German Translator
Veteran
Joined
Sep 8, 2014
Messages
197
Reaction score
45
First Language
English
Primarily Uses
N/A
Yup. Give the enemies sprite events, have them set to "approach player" or whatever, and set it so that when they touch the player, it initiates a battle. You can also set it so that when the battle is over, the sprite disappears.
 

Myzma

Veteran
Veteran
Joined
Dec 7, 2014
Messages
32
Reaction score
1
First Language
English
Primarily Uses
That's exactly what I did. It seems really akward and not like Earthbound at all. I want it to be that it wanders around, if it sees you, an exclamation bubble pops up, its speed increases, and it runs towards you.
 

LostFonDrive

Veteran
Veteran
Joined
Feb 13, 2015
Messages
173
Reaction score
52
First Language
English
Primarily Uses
Yup. Give the enemies sprite events, have them set to "approach player" or whatever, and set it so that when they touch the player, it initiates a battle. You can also set it so that when the battle is over, the sprite disappears.
This is a great starting point, however if I'm not mistaken this causes the enemies to always approach you no matter where you are on the map, no matter how far and what's in the way. 

Also it may be preferable to use a common event instead, so that you don't have to set up the event every time, and so that it's easy to make changes to your entire "overworld enemy" system, without having to edit EVERY single enemy event in your game.

I would recommend using the tutorial here in conjunction with Yanfly's "event chase" script, allowing you to set up a specific range to activate a monster's chasing behaviour. Yanfly's scripts are available for any kind of project (obviously with credit)
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
You can do this with different event pages and self-switches.  When an enemy spots you, their self switch is turned on, and the highest-numbered page (or at least a page with a number higher than their "standard" behavior) has that self switch as the page condition.  That page should have a higher speed/frequency and a Custom Move Route which only includes "Move Toward Player".

The harder part is to track whether an enemy has spotted you.  This requires either extremely complicated eventing, or moderately complex scripting.  If you take a look at my Action Battle System demo, you may notice that the Hooded Specter enemies only shoot fireballs at you when you stand in their line of sight, and the Toy Soldier enemies only make a fast dash (with the exclamation point bubble) once they've spotted you.  I did this with some scripting, and while I'd be willing to share the scripting with you if you want it, I'm not sure you'll be able to adjust it to your own project's needs since you sound like you're pretty new to this.

Maybe someone has the time to give you a more thorough explanation about how to create line-of-sight detection for events?
 

Myzma

Veteran
Veteran
Joined
Dec 7, 2014
Messages
32
Reaction score
1
First Language
English
Primarily Uses
I'm not that new to Rpg Maker Vx Ace. I've been using it for at least a year now. I would like to know how to make enemies do the line-of-sight thing though.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
OK - here's the eventing/scripting I used to determine Line of Sight.

Line of Sight Detection Event.jpg
 

shaynec1981

Veteran
Veteran
Joined
Jun 10, 2014
Messages
88
Reaction score
21
First Language
English
Primarily Uses
There's actually a pretty easy way to implement this as I do it in one of my projects. Give me a few minutes and I'll edit this post and give you the answer. :)
 
Edit:
 
Add this script:

class Game_Interpreter  def in_range?(range)    sx = $game_map.events[@event_id].distance_x_from($game_player.x).abs    sy = $game_map.events[@event_id].distance_y_from($game_player.y).abs    sx + sy <= range  endendThen on each of your mobs, have the first page set to parallel process, and add this script command:

if in_range?(4) == true  $game_self_switch[[@map_id, @event_id, 'A']] = trueendHave page 2 with the conditional of self switch A == ON and autonomous movement to approach and event touch trigger and the regular event battle processing or whatever commands you'd normally run there.

Oh yeah, change the 4 to whatever range you want to enemy to detect you in.
 
Last edited by a moderator:

Myzma

Veteran
Veteran
Joined
Dec 7, 2014
Messages
32
Reaction score
1
First Language
English
Primarily Uses
I got it working by using the Yanfly Chase Script. It has everything I needed to use to make it like earthbound.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top