MV - Chrono Engine ABS: Help with hookshot/boomerang passing through walls etc

● ARCHIVED · READ-ONLY
Started by DTurtle 23 posts Page 2 of 2 View original ↗
  1. AquaEcho said:
    I'll look at it next week but I'm on vacation right now so can't go digging into plugin files
    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.
  2. DTurtle said:
    However, there seems to be a small bug when the hookshot drags an enemy back to the player. I can't tell if this is caused by something that was changed here or by something Restart added to the Cross Engine elsewhere: after you drag an enemy to the player's position with the hookshot, the enemy's speed seems to be set to the hookshot's return speed and it carries out its SelfSwitch D moveroute at a super high speed, resulting in the event zig-zagging around the map until SelfSwitch D turns off. Have you encountered this issue before?
    Sorry, 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.
  3. This will make the boomerang bounce off walls like the hookshot:
    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.