• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Mach and Acrobike-help!

23
Posts
11
Years
  • Seen Aug 29, 2019
So I've been trying to implement the Acro and Mach Bikes into a vanilla version of 17.2 Essentials. The script I'm using is quite an old one (Kudos to REI) and I've performed a little cleanup to make it compatible with v17.2, and everything seems to work fine, the animations and terrain tags all work as are supposed to (though I am using placeholder graphics at the moment for the acro bike wheelies).

My issue is that bridges are completely broken, and the character is able to walk on the edge tile of a lake (though strangely not the ocean tiles). The player cannot walk further into the water, and surfing still functions normally.

I get the following error on attempting to navigate a bridge from above or underneath:

bqGaZWl.png


I beleive the error lies in this line of script.

Code:
for i in [2, 1, 0]
      tile_id = data[x, y, i]
      next if tile_id && @terrain_tags[tile_id]==PBTerrain::Bridge &&
             [COLOR="Red"] $PokemonMap && $PokemonMap.bridge==0[/COLOR]
      if tile_id == nil
        return false
      # Make water tiles passable if player is surfing
      elsif PBTerrain.isPassableWater?(@terrain_tags[tile_id]) &&
         [COLOR="red"]$PokemonGlobal.surfing #&& self_event==$game_player[/COLOR]
        return true
      elsif @terrain_tags[tile_id]==PBTerrain::TallGrass &&
         $PokemonGlobal.bicycle && self_event==$game_player
        return false
      elsif @terrain_tags[tile_id]==PBTerrain::Bridge [COLOR="red"]&& $PokemonMap &&
            $PokemonMap.bridge>0[/COLOR]
        if @passages[tile_id] & bit != 0 ||
           @passages[tile_id] & 0x0f == 0x0f
          return false
        else
          return true
        end

I can see from my limited understanding and the error above that the metadata PBS file doesn't define 'bridge' so removing that condition does stop the crash from happening, however, bridges then become impassable from the top (though are passable underneath) and attempts to do the same for surfing just results in all water tiles becoming passable. Due to my lack of experience, I am unsure of what these checks are actually checking for in setting the passibility, so I could really use some help in dissecting this problem to ensure any solution keeps feature functioning as intended.

Here is my full script. I inserted it above main.

Spoiler:

P.S, if you could help explain what the issue is and what a solution is doing in place, that would be really beneficial for me to learn, however, it is not entirely necessary for one :)
 
Last edited:
Back
Top