Swimming events – restricting movement using terrain/region tags?

Status
Not open for further replies.

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
135
Reaction score
10
First Language
English
Primarily Uses
RMVXA
Hi all!

I'm trying to find a way to have swimming enemies on my maps that only swim in water. I'm using falcoa's ABS script, but I don't think that's particularly relevant (only for context of having enemy events on the maps).
One of my playable characters can swim – I use a swimming script that checks the player's XY coordinates and changes the sprite to a "swimming" sprite when it hits a certain terrain tag:

# * Determine if Actor can Swim
#--------------------------------------------------------------------------
def can_swim?(x,y)
# Actor ID Terrain Tag
$game_party.leader.class.id == 5 && $game_map.terrain_tag(x, y) == 7
end
end

Currently, any enemy 'events' on the map cannot pass over water tiles (unless they are above characters or have 'through' on), so my birds can fly over water, for example. I'd like to be able to have fish, etc, that can only swim in the water (despite the tiles not being passable).

I found Yanfly's Move Restrict Region v1.03, but it only allows for events to not move past certain boundaries – I need the events to be able to move within a certain region/terrain, which is not passable by other events.

Appreciate any help – thanks in advance!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,788
Reaction score
12,217
First Language
English
Primarily Uses
RMMV
Can you not set those events to through so they can move in the water, and use the region script and draw with a region tag around the edges of the water so they can't move out?
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
135
Reaction score
10
First Language
English
Primarily Uses
RMVXA
@Shaz No, because the through tag allows events to move through the region tag in Yanfly's script. :(
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,788
Reaction score
12,217
First Language
English
Primarily Uses
RMMV
What kind of water is it? If you use the water in the top right section of the tileset (the poison swamp), I think that's walkable.
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
135
Reaction score
10
First Language
English
Primarily Uses
RMVXA
@Shaz I use all kinds of different water tiles. Like I said, I can make them walkable/swimmable for one of my characters, but I need to make them walkable/swimmable for certain enemies/events. I don't want them to be able to walk on any other tiles than the water tile, and I don't want any other enemies/events to be able to walk on the water (unless they are above chars or have through on – birds, bees etc.)

I'm beginning to think this might not be as simple as I'd hoped. Will probably need a script.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,597
Reaction score
3,782
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

GOOOOD MOOORNING!
APRIL WILL BE BETTER!
First time I've seen the shelves full in my local shop in a while. Still no soap, though.
RachelTheSeeker wrote on StormyRange's profile.
Hey! Haven't I seen you before? :p Good to see you on a RPG Maker site; am pleasantly surprised. :)
When you really think about it, the Trolley Problem is pretty dumb.
StormyRange wrote on Magusalfador's profile.
Hi! I saw you ask @DreamX about that recording Enemy Troop number to a variable and wondered if you got the updated version? I asked them too but they've not been seen a few years, thanks!

Forum statistics

Threads
95,564
Messages
930,119
Members
125,847
Latest member
debb
Top