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,837
Reaction score
12,250
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,837
Reaction score
12,250
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,622
Reaction score
3,793
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

Sorry Aerith... I will abandon your shoes... :guffaw:
Spent a whole bunch of time today reworking the area in the video because someone said it was too illusory. So I reworked it so it changes less, moved the grass up to the same level as the player.... And found enough extra resources to make the grass moves when the player touches it. Also lots more water, because it looks amazing. I'll probably put up a short updated video later today.
I never noticed how NOISY birds can be in the morning..
The worst part of writing the thesis is getting to a point where it's nearly done and you feel like an 8th-grader could've written something on that level.
So ... uh ... this weekend I have to cut my husband's hair. He searched long and hard - highest mountains, deepest valleys, across vast oceans. All hairdressers are now closed. So it's me.

Forum statistics

Threads
95,765
Messages
931,706
Members
126,168
Latest member
Daruyo
Top