Monster Aggression

PYRG

Necropotent
Member
Joined
Feb 23, 2015
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Hi all,

This is my first 'official' post to the RPG maker community, so hold onto your hats and glasses.

I've been making games with VX Ace for about a year now, and I love it, its great.  Originally my games utilized the Regions tool for enemy fights, but I found that it gave the game a stale feeling after a short amount of playtime.  I now use scripts in world, along with the corresponding skin, and set movement routes and event touch to begin combat. (I realize that sentence made no sense, Example- a skeleton walking around on the map, when you walk into it you fight a skeleton, skeleton self-switches after the fight to turn off, although i haven't figured out respawning yet)   I'm now looking to expand on this format and add enemies that have a one to three square aggression range, where they will attack if you move within those squares (keen to my favorite MMO of all time, Dofus).  I'm not very good at scripting yet, so I just wanted to ask, is it possible to do something like this without a lot of scripting?  Or has someone else come up with a script for it yet?

Thanks so much
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
You might want to look into ABS type battle scripts.  Generally they are able to give events an 'aggro range' or whatever you wanted to call it ~ however, then battles would completely take place on the map. :)
 

PYRG

Necropotent
Member
Joined
Feb 23, 2015
Messages
10
Reaction score
0
First Language
English
Primarily Uses
then battles would completely take place on the map.
Dang.  I'm not that confident enough in my scripting capabilities yet.  Unfortunately for the most part I've also been using the High Fantasy bundle for my games, and I've ran into problems trying to get everything to line up and look right when attempting open-world combat.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
ahh yea, those kind of spritesheets may not work very well for ABS systems. Dunno though, I've never really used them for long enough :D
 

KoldBlood

Innovation from Limitation
Veteran
Joined
Feb 5, 2014
Messages
77
Reaction score
55
First Language
English
Primarily Uses
RMVXA
I use event touch encounters on my game as well, I handle respawning by placing the "Erase Event" command after the "If Win" condition on battle processing instead of a Self Switch. This causes the event to disappear after the player defeats the monster in the battle and it will stay gone until the player leaves the current map and returns. You could also achieve a "timed repawn" by activating "Self Switch A" on battle win, creating a second "Event Page" set to "Parallel Process", add a "Wait" command for how many ever frames you wish and then deactivate "Self Switch A" after the wait command. I don't use the second method so I haven't tested it but it should work in theory.

As for having the enemy's chase the player I use this script by Yanfly: https://raw.githubusercontent.com/Archeia/YEARepo/master/Field/Event_Chase_Player.rb

It lets you customize each enemy's chase AI separately so you can have enemies react differently or chase at different speeds or even run from the player.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You could make the enemies run in parallel process, then check the distance between that enemy and the player via getting their X/Y coordinates and getting the total distance... If it's within the range, make the enemy move closer. Then if the distance is just 1 tile, make the enemy face the player and start battle.
 
Last edited by a moderator:

PYRG

Necropotent
Member
Joined
Feb 23, 2015
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Well I've made something like this with Moghunter's Event Sensor script:

https://atelierrgss.wordpress.com/rgss3-event-sensor-range/
I'll have to brush up on my (spanish?)  But this seems to be what I was asking about.  I'll look into, thanks!

You could also achieve a "timed repawn" by activating "Self Switch A" on battle win, creating a second "Event Page" set to "Parallel Process", add a "Wait" command for how many ever frames you wish and then deactivate "Self Switch A" after the wait command. I don't use the second method so I haven't tested it but it should work in theory.
I'll definitely be changing my monsters to do this, except I'll use a world switch in comparison to a self switch.  That way I can bundle and turn off all monster switches for an area, which would give my loading screens more than an informational purpose.

You could make the enemies run in parallel process, then check the distance between that enemy and the player via getting their X/Y coordinates and getting the total distance... If it's within the range, make the enemy move closer. Then if the distance is just 1 tile, make the enemy face the player and start battle.
Close, but not exactly what my intention was.  I was looking for a script that basically allows an event to extend its area of infulence by 1-4 squares.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Close, but not exactly what my intention was.  I was looking for a script that basically allows an event to extend its area of infulence by 1-4 squares.
You can check this with the following script command:

if ($game_player.x - $game_map.events[n].x).abs <= 4if ($game_player.y - $game_map.events[n].y).abs <= 4(do whatever... maybe set a self switch on the event that allows it to activate the battle)endendwhere n is the Event ID of the monster in question.

If you're organized about how you number your Events, you can run this in a loop inside a parallel process to continuously check whether any monsters have gotten in range to start a battle.  To avoid lag, add a short (1 to 15 frames) Wait at the end of the Parallel Process event.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.


Game Mechanics Design is for discussion about game mechanics - the theory and implications. If you want to know how to implement something, that belongs in either Ace Support or Script Requests/Support, depending on the method you're using.


Welcome! Hope you get it sorted out :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top