• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Scripting Question] Whirlpool HGSS problem

  • 17
    Posts
    6
    Years
    Hello,
    I made this script for Whirlpool in HGSS Style it works when going up and down but left and right goes down can anyone help me?
    this is the script

    Spoiler:
     
    First thing I got to ask is why are you checking if the event direction isn't a value?

    The only time it's going to get beyond the first if is when direction is 8, which isn't 2. Meaning that all this:
    Code:
    elsif event.direction!=4
      oldthrough   = event.through
      oldmovespeed = event.move_speed
      terrain = Kernel.pbFacingTerrainTag
      return if !PBTerrain.isWhirlpool?(terrain)
      event.through = true
      event.move_speed = 0.5
      loop do
        event.move_left(false)
        terrain = pbGetTerrainTag(event)
        break if !PBTerrain.isWhirlpool?(terrain)
      end
      event.through    = oldthrough
      event.move_speed = oldmovespeed
    elsif event.direction!=6
      oldthrough   = event.through
      oldmovespeed = event.move_speed
      terrain = Kernel.pbFacingTerrainTag
      return if !PBTerrain.isWhirlpool?(terrain)
      event.through = true
      event.move_speed = 0.5
      loop do
        event.move_right(false)
        terrain = pbGetTerrainTag(event)
        break if !PBTerrain.isWhirlpool?(terrain)
      end
      event.through    = oldthrough
      event.move_speed = oldmovespeed
     end
    Is doing nothing, if I'm reading it right.
     
    Last edited:
    Yes, but you're not checking if direction is equal to a value (if event.direction==X), you're (for some reason) checking if direction isn't equal to a value (if event.direction!=X).
    Why?
     
    You can only go one way over a waterfall (either down when you're just surfing, or up when you're using Waterfall). That's why its code excludes other directions. You don't want to do that.
     
    Back
    Top