doesn't work, even when i clone a new js file to turn the param on. Creating a new map let i run around in the first time on that map, but not the second
What other plugins do you have?
This plugin is not compatible with Yanfly Event Chase (http://www.yanfly.moe/wiki/Event_Chase_Player_(YEP) ). As soon as the "chase" is initiated there is massive lag. Anyone know why this happens? Any potential hack or workaround to fix it? If not, any alternative plugins compatible with Altimit that achieve a similar effect (making events that will chase the player or flee from the player when the player enters within range of the event or when the event sees the player)?
Rough stab at it
Code:
Game_CharacterBase.prototype.goTowardsPlayer = function (){
var vx = $gamePlayer.x - this.x;
var vy = $gamePlayer.y - this.y;
var length = Math.sqrt( vx * vx + vy * vy );
if ( length > this.stepDistance ) {
this.setDirectionVector( vx, vy );
vx *= 1/length;
vy *= 1/length;
this._moveTarget = true;
this._moveTargetSkippable = true;
this._moveTargetX = this.x + vx ;
this._moveTargetY = this.y + vy;
}
}
Game_CharacterBase.prototype.setSelf = function(switchName,switchValue)
{
var key = [$gameMap._mapId, this._eventId, switchName];
$gameSelfSwitches.setValue(key, switchValue);
}
//calculates the distance from an event to a given point.
Game_CharacterBase.prototype.distanceToPoint = function(xcoord,ycoord)
{
var distance = Math.sqrt( (this.x-xcoord)*(this.x-xcoord) + (this.y-ycoord)*(this.y-ycoord) );
return distance;
}page one move route on repeat (can have 'wait' commands in the middle so it only scans occasionally)
Code:
page two with 'd' activeif (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)<5){setSelf('d',true)}Code:
if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)>5){setSelf('d',false)}else{this.goTowardsPlayer()}for seeing it you'd have to include a 'cansee' function, which would be a lot more elaborate (since it needs to scan for walls)