you may have to make some adjustments, but put this as a plugin, and call it from the events' move routes.
Code:
Number.prototype.between = function(a, b) {
var min = Math.min(a, b);
var max = Math.max(a, b);
return this >= min && this <= max;
};
Game_CharacterBase.prototype.inRect = function(x1, y1, x2, y2){
return this._x.between(x1, x2) && this._y.between(y1, y2);
};
on a straight shore line, put down an event with a custom move route, with a script call:
Code:
$gameSelfSwitches.value([$gameMap.mapId, this._eventId, "A"]) = $gamePlayer.inRect(A1,B1,A2,B2)
where A and B are the corners defining the rectangle to watch.
you want this to be 1 tile wide, as long as the coast strip.
and in a new page on that event, call the common event dealing with the movement, and after it restore the self switch and exit the event.
you may want to set the event proper to spawn only when "surfing" is ON.
set the route refresh rate to slow and priority to high.
set the sprite to invisible.... or set a sprite to identify it in the editor, and then add a sprite removal block to the move route.
copy this event, with the call to the common event, wherever you want to transfer mediums, and change the coordinates.
this is adapted from my fix in Ace, so there might be syntax mistakes.
this is *a proximity detector*... the actual movement will have to be done through the common event: hide the boat, step forward, deploy party, etc.
you'll still have to put down actual events to deal with corners.