Also, do you have an idea of how to stop the boomerang from passing through walls etc as well? Ideally when it hits a restricted region it should bounce back to the player.
MV Chrono Engine ABS: Help with hookshot/boomerang passing through walls etc
Javascript/Plugin SupportSorry, I've been busy but this function is what changes the enemy target's speed when the hookshot locks on to it so there is something wrong here with the enemy speed not being reset
JavaScript:
//==============================
// * Update Tool Hookshot Lock
//==============================
// from chronoEngine
Game_CharacterBase.prototype.updateHookShotLock = function() {
var target = this._user.hookshotLock.tool;
this._moveSpeed = target._moveSpeed;
if (target._x != $gamePlayer._x || target._y != $gamePlayer._y) {
this._x = target._x;
this._y = target._y;
} else {
this._moveSpeed = this._user.hookshotLock.preMoveSpeed;
this._user.hookshotLock.preMoveSpeed = this._moveSpeed;
this._user.hookshotLock.tool = null;
};
//erase the target if it's dead - otherwise the game will check your
//hookshot indefinitely after you snag an enemy
if (target._erased == true)
{
this._user.hookshotLock.tool = null;
}
};
As for the boomerang thing, it would be adding extra lines to the boomerang section of the plugin to make it bounce off walls like the hookshot. Give me a couple days to test some solutions.
This will make the boomerang bounce off walls like the hookshot:
The other issue is caused by the target/enemy speed being set to the hookshot retract speed (6). The enemy is getting one move in at the retract speed before being reset to the its original speed.
JavaScript:
//ChronoEngine Make hookshot and boomerang bounce against terrain 3 and region 4
// altered hookshot so it retracts faster than it flies out.
Game_Character.prototype.processMoveCommandTool = function(command) {
if (this._tool.boomerang[0]) {
if($gameMap.regionId(this.x+.5,this.y+.5) == 4 || $gameMap.terrainTag(this.x+.5,this.y+.5)==3){
AudioManager.playSe({name: 'hammer', pan: 0, pitch: 100, volume: 100});
this.moveTowardCharacter(this._tool.user);
this._tool.forcingMove = 2;
}
if (this._tool.boomerang[1] > 0) {
this._tool.boomerang[1]--;
this.moveForward();
} else {
this.moveTowardCharacter(this._tool.user);
this._tool.forcingMove = 2;
};
} else if (this._tool.hookshot.enabled) {
if($gameMap.regionId(this.x+.5,this.y+.5) == 4 || $gameMap.terrainTag(this.x+.5,this.y+.5)==3){
this.hookShotTink();
this.erase();
this.moveTowardCharacter(this._tool.user);
this._tool.forcingMove = 2;
}
if (!this._tool.hookshot.locked) {
this._directionFix = true;
if (this._tool.hookshot.range > 0) {
this._tool.hookshot.range--;
this.moveForward();
} else {
if (this._tool.forcingMove != 2)
{
//first time we change to retracting, increase speed
this._moveSpeed+=1;
}
this.moveTowardCharacter(this._tool.user);
this._tool.forcingMove = 2;
};
} else {
this._tool.forcingMove = 2;
};
};
};
The other issue is caused by the target/enemy speed being set to the hookshot retract speed (6). The enemy is getting one move in at the retract speed before being reset to the its original speed.
Original thread: https://forums.rpgmakerweb.com/threads/chrono-engine-abs-help-with-hookshot-boomerang-passing-through-walls-etc.160687/