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,823
Reaction score
12,233
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,823
Reaction score
12,233
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,617
Reaction score
3,790
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

Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:
Made idle animation for character. It first had only three frames but looked too different from walking animation and I had to draw five more.
MV and VX Ace both have good qualities.

Forum statistics

Threads
95,693
Messages
931,066
Members
126,032
Latest member
MadAtticGames
Top