• 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] Change sprite surf depending pokemon

2
Posts
7
Years
    • Seen May 6, 2024
    Hey, I have a problem that is breaking my head, I have been trying to make the surf sprite different depending on the pokemon, I used a code of Rot8er_ConeX, which for now goes well, does what it has to do, but ... example when I have two pokemon that can access surf at the party, gyarados and sharpedo, sharpedo is the one that uses surf, but the sprite changes to gyarados.

    The code starts with gyarados, the question is is there any way that the script will check which of the two has surf and depending on which pokemon the sprite has, change to said pokemon?

    I know it's something complex but good to see if there is luck.

    Code:
    if pbHasSpecies?(:GYARADOS)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
            elsif pbHasSpecies?(:SHARPEDO)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end

    I can not put links, sorry. The title of the original post is this "Add Common Event When Choosing To Surf"

    Thanks and sorry, i to use google translate for my bad english ;)
     
    232
    Posts
    7
    Years
    • Seen Apr 24, 2024
    Hey, I have a problem that is breaking my head, I have been trying to make the surf sprite different depending on the pokemon, I used a code of Rot8er_ConeX, which for now goes well, does what it has to do, but ... example when I have two pokemon that can access surf at the party, gyarados and sharpedo, sharpedo is the one that uses surf, but the sprite changes to gyarados.

    The code starts with gyarados, the question is is there any way that the script will check which of the two has surf and depending on which pokemon the sprite has, change to said pokemon?

    I know it's something complex but good to see if there is luck.

    Code:
    if pbHasSpecies?(:GYARADOS)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
            elsif pbHasSpecies?(:SHARPEDO)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end

    I can not put links, sorry. The title of the original post is this "Add Common Event When Choosing To Surf"

    Thanks and sorry, i to use google translate for my bad english ;)

    managed to correct? I would like a script like this
     
    Hey, I have a problem that is breaking my head, I have been trying to make the surf sprite different depending on the pokemon, I used a code of Rot8er_ConeX, which for now goes well, does what it has to do, but ... example when I have two pokemon that can access surf at the party, gyarados and sharpedo, sharpedo is the one that uses surf, but the sprite changes to gyarados.

    The code starts with gyarados, the question is is there any way that the script will check which of the two has surf and depending on which pokemon the sprite has, change to said pokemon?

    I know it's something complex but good to see if there is luck.

    Code:
    if pbHasSpecies?(:GYARADOS)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
            elsif pbHasSpecies?(:SHARPEDO)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end

    I can not put links, sorry. The title of the original post is this "Add Common Event When Choosing To Surf"

    Thanks and sorry, i to use google translate for my bad english ;)

    I haven't tested it but it might work.
    Code:
          move = getID(PBMoves,:SURF)
          movefinder = pbCheckMove(move)
           if pbHasSpecies?(:GYARADOS) && movefinder.isSpecies?(:GYARADOS)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
           elsif pbHasSpecies?(:SHARPEDO) && movefinder.isSpecies?(:SHARPEDO)
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
          end
     
    Last edited:
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    I haven't tested it but it might work.
    Code:
          move = getID(PBMoves,:SURF)
          movefinder = pbCheckMove(move)
           if pbHasSpecies?(:GYARADOS) && movefinder.species==130
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::GyaraSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end
           elsif pbHasSpecies?(:SHARPEDO) && movefinder.species==319
            trainer=$Trainer if !trainer
            outfit=trainer ? trainer.outfit : 0
            if outfit==0
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]
            else
              $game_player.character_name=Settings::SharpedoSurfFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s
            end

    It's missing an "end" at the very end of the code. Also, instead of checking hardcoded numbers like 130 or 319, it would be better to use the species constant like so:
    Code:
    if pbHasSpecies?(:GYARADOS) && movefinder.isSpecies?(:GYARADOS)
    and
    Code:
    elsif pbHasSpecies?(:SHARPEDO) && movefinder.isSpecies?(:SHARPEDO)
     
    Back
    Top