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,810
Reaction score
12,226
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,810
Reaction score
12,226
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,609
Reaction score
3,786
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

Anyone who says anyone or anything "needs to tone down the swearing" has just instantly lost 90% of my respect, unless of course they're talking about like children's programming or a teacher or something.
I feel bad sometimes around others, I hate, and I mean HATE being touched, and I know they don't know I hate it so much
Testing out applying a stroke effect to things at player level to increase visibility. Thoughts?

Forum statistics

Threads
95,654
Messages
930,783
Members
125,987
Latest member
noxfungi
Top