• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Selene, Mint, Solana - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Error with bridge on new tileset

  • 55
    Posts
    11
    Years
    • Seen Oct 8, 2019
    Hey I'm struggling with some bridges on a new tileset added to my game.
    The conditional branch I use for the bridges is the following:

    Code:
    Conditional Branch: Switch[199:BRIDGEON]==ON
        @Control Switch[199:BRIDGEON]==OFF
    Else
        @Control Switch[199:BRIDGEON]==ON
    Branch End
    The bridge itself is a two page event, with Switch 199 on and off and the options: "Through/Always on top" on/off.

    It works with the default "outside"-tileset from Pokemon Essentials without any problems.

    In the database it has the same settings as the default one, but when I step on the event, the following error message occurs:

    Code:
    Message: undefined method `*' for nil:NilClass
    Game_Character:206:in `screen_z'
    Sprite_Character:156:in `update_or'
    Tilemap_Perspective:429:in `shadow_update'
    DynamicShadows:178:in `update'
    Spriteset_Map:291:in `_animationSprite_update'
    Spriteset_Map:287:in `each'
    Spriteset_Map:287:in `_animationSprite_update'
    AnimationSprite:86:in `updateOldFL'
    SimpleHUD:48:in `update'
    Scene_Map:51:in `updateSpritesets'
    I just copied and pasted the event from the outside tileset, where it works fine and unfortunately my knowledge in ruby is not good enough to understand what's going wrong here.
    I added a "Simple HUD Script" but if that's the problem it shouldn't work anywhere, right?

    Is there anybody who can help me? I would appreciate it very much!

    Cheers Hargatio

    EDIT:
    When I follow the instruction of Building Better Bridges I'm not able to convert it properly because the terrain tag ends at 7 (not at 15, like in the tutotial).
     
    Last edited by a moderator:
    Thanks for your answer, Vendily!

    I tried to follow the bridge tutorial, but unfortunately it is deprecated and no longer relevant to the latest version of Pokémon Essentials. So I can't solve the problem this way..
     
    I'm sorry for the confusion, but I read the wikia and this article, but it doesn't work. I thought it was maybe deprecated, too.

    So when I understand the wikia (bridge) right, I have two events in a row. First event the player touches before he enters the bridge activates "pbBridgeOff", after that, he touches another event that calls the script "pbBridgeOn" and then he enters the bridge. The bridge tiles have the terrain tag 15. In the map they are mapped in the third layer.

    I can walk on the bridge, but it seems the script pbBridgeOff doesn't work,
    because I can't walk under the bridge. What am I doing wrong here?

    [PokeCommunity.com] Error with bridge on new tileset
     
    To avoiding errors, which version of Essentials are you Using? Can you post, also, a screenshot about the priority of the tiles of the bridge?

    Second thing: The event that contains the call of "pbBridgeOff", has the trigger "Player Touch"?
     
    I'm using the latest version of Pokemon Essentials (v16.1). The errors occured after the update.

    The event "pbBridgeOff" has also the trigger "player touch".


    Screenshot Priority:
    [PokeCommunity.com] Error with bridge on new tileset
     
    Are you sure that in your defs, there is $PokemonGlobal rather than $PokemonMap?

    Code:
    def pbBridgeOn(height=2)
      $PokemonGlobal.bridge=height
    end
    
    def pbBridgeOff
      $PokemonGlobal.bridge=0
    end
     
    yes, the def is the same as you wrote down (screenshot below)

    Screenshot Event Bridge Off:
    [PokeCommunity.com] Error with bridge on new tileset

    Screenshot Script Section "pbField_Field":
    [PokeCommunity.com] Error with bridge on new tileset
     
    Last edited:
    The only thing that i can think is that your bridges haven't the correct terrain tag. Can you tell us which number is set?
     
    Hm that is weird...I set the terrain tags to 15, so it should work.
    As well I tried calling the scripts at the default "outside"-tileset (where the method with the conditional branch still works, see first post for more infos) and it doesn't work as well. The bridge is always beneath the player as its terrain tag is set at 0.

    [PokeCommunity.com] Error with bridge on new tileset
     
    Try to test if it's all correct: put, after "pbBridgeOn" and "pbBridgeOff" map events, another script that contains:
    Code:
    Kernel.pbMessage(_INTL(
    "{1}",$PokemonGlobal.bridge))
    Then, post a screenshot.
     
    Seems the settings are right, do I have to change anything else in the settings of the tileset? It's new, I imported it to the game and didn't do any changes, except of the terrain tag.

    Left: pbBridgeOff || Right: pbBridgeOn

    [PokeCommunity.com] Error with bridge on new tileset
     
    Well...
    - Terrain Tags are ok;
    - Map Events are ok;
    - Defs pbBridgeOn and pbBridgeOff are ok;

    The last thing is the double-check of def playerPassable?
    Code:
        def playerPassable?(x, y, d, self_event = nil)
        bit = (1 << (d / 2 - 1)) & 0x0f
        for i in [2, 1, 0]
          tile_id = data[x, y, i]
          # Ignore bridge tiles if not on a bridge
          next if $PokemonGlobal && $PokemonGlobal.bridge==0 &&
             tile_id && PBTerrain.isBridge?(@terrain_tags[tile_id])
          if tile_id == nil
            return false
          # Make water tiles passable if player is surfing
          elsif $PokemonGlobal.surfing &&
             PBTerrain.isPassableWater?(@terrain_tags[tile_id])
            return true
          # Prevent cycling in really tall grass/on ice
          elsif $PokemonGlobal.bicycle &&
             PBTerrain.onlyWalk?(@terrain_tags[tile_id])
            return false
          # Depend on passability of bridge tile if on bridge
          elsif $PokemonGlobal && $PokemonGlobal.bridge>0 &&
             PBTerrain.isBridge?(@terrain_tags[tile_id])
            if @passages[tile_id] & bit != 0 ||
               @passages[tile_id] & 0x0f == 0x0f
              return false
            else
              return true
            end
          # Regular passability checks
          else #if @terrain_tags[tile_id]!=PBTerrain::Neutral
            if @passages[tile_id] & bit != 0 ||
               @passages[tile_id] & 0x0f == 0x0f
              return false
            elsif @priorities[tile_id] == 0
              return true
            end
          end
        end
        return true
      end
     
    Everything is correct...I double checked it and to make sure, I copied your code and replaced it.

    I don't think it makes any difference, but in the attach is the tileset I'm using.

    [PokeCommunity.com] Error with bridge on new tileset
     
    ONLY if you want, you can send me a backup copy of your project, with this map only. Thus, by testing it in person, I can help you.
     
    Last edited:
    I found the solution and, as I predicted, you need to learn how to use bridges. In fact, in your map, you placed the bridges as event and not as tileset and this causes the game crash you have reported in top of this thread.
    I could post a link with your project and all its corrections, but I suggest you to learn how the bridges work in essentials. (This include also the functions and methods related).
     
    Hi Folle,

    thanks again for your patience with me. I'm working on the game here and then for three years now. But without using the rmxp before or knowing ruby it is hard to solve problems on your own, all the more I appreaciate your help.

    But your last post doesn't help me very much. The map was far away from its last touch, and the event bridges were just leftovers from previous tries (v15 it worked).

    The bridge we were talking about and I was trying on make it work, was in the upper left, framed with flower-tiles. It was mapped in the third layer (not as an event). So I replaced all the event bridges through bridge tiles from the third layer, but it still doesn't work. I read the article bridges again, but I can't figure out the problem.
     
    Taking a look to your project, I detected immediately all possible mistakes:
    - Some bridges are placed as event and not as tileset. This cause the error that you reported in top of this thread;
    - The bridge's tileset hasn't some features required to work properly, like the priority and the passage "4 dir";
    - In the end, the functions "pbBridgeOn" and "pbBridgeOff", exept for the section surrounded by flowers, are not called properly and are replaced by Switch 199.

    I'll upload your project into my Google Drive account, and then I'll post the link hereinafter.
    https://drive.google.com/open?id=0B7WEIe-gDeS3VEZRLXUzaGtmcWc
     
    Last edited:
    Back
    Top