Hi,
I have a region passage plugin created by one Ponpoko Neruson. It allows you to control passage of tiles that have region IDs set to them, for example placing <RegPass16:1540> in the map notes will make tiles with region ID "blocked" at the right side for walking (4), boats (512), and ships(1024).
I'm trying to have a common event that places a boat in front of the player when an item is used from the inventory. The script in the common event goes like:
This works nicely as long as the Pon_RegionPassge is disabled. But enabling it will cause an error upon loading of the game. Probably there's something not entirely clean with the way it patches checkPassage, but I'm scratching my head... any help greatly appreciated.
EDIT: never mind there was just a "use strict" missing... sorry...
I have a region passage plugin created by one Ponpoko Neruson. It allows you to control passage of tiles that have region IDs set to them, for example placing <RegPass16:1540> in the map notes will make tiles with region ID "blocked" at the right side for walking (4), boats (512), and ships(1024).
I'm trying to have a common event that places a boat in front of the player when an item is used from the inventory. The script in the common event goes like:
JavaScript:
var d = $gamePlayer.direction();
var x = $gameMap.roundXWithDirection($gamePlayer.x, d);
var y = $gameMap.roundYWithDirection($gamePlayer.y, d);
if($gameMap.isBoatPassable(x, y, d)){
$gameMap.boat().setLocation($gameMap.mapId(), x, y);
}
This works nicely as long as the Pon_RegionPassge is disabled. But enabling it will cause an error upon loading of the game. Probably there's something not entirely clean with the way it patches checkPassage, but I'm scratching my head... any help greatly appreciated.
EDIT: never mind there was just a "use strict" missing... sorry...