• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

Surf specific sprites

benictron

Rookie
Member
Joined
Jan 30, 2025
Posts
7
i want to see the pokemon that is surfing, like if i surf with gyarados i want, instead of the default fish/whale i want to see the gyarados sprite, it is possible??
 
i want to see the pokemon that is surfing, like if i surf with gyarados i want, instead of the default fish/whale i want to see the gyarados sprite, it is possible??
Yes, it is completely possible and simple. This script:

Ruby:
Expand Collapse Copy
def pbGetPlayerCharset(charset, trainer = nil, force = false)
  trainer = $player if !trainer
  outfit = (trainer) ? trainer.outfit : 0
  return nil if !force && $game_player&.charsetData &&
                $game_player.charsetData[0] == trainer.character_ID &&
                $game_player.charsetData[1] == charset &&
                $game_player.charsetData[2] == outfit
  $game_player.charsetData = [trainer.character_ID, charset, outfit] if $game_player
  ret = charset
  if pbResolveBitmap("Graphics/Characters/" + ret + "_" + outfit.to_s)
    ret = ret + "_" + outfit.to_s
  end
  #---- Mount Sprite ----#
  ret = getSurfSprite   if $PokemonGlobal&.surfing
  return ret
end

Now you just need to define which sprites the game will initially recognize in a new getSurfSprite method
 
Yes, it is completely possible and simple. This script:

Ruby:
Expand Collapse Copy
def pbGetPlayerCharset(charset, trainer = nil, force = false)
  trainer = $player if !trainer
  outfit = (trainer) ? trainer.outfit : 0
  return nil if !force && $game_player&.charsetData &&
                $game_player.charsetData[0] == trainer.character_ID &&
                $game_player.charsetData[1] == charset &&
                $game_player.charsetData[2] == outfit
  $game_player.charsetData = [trainer.character_ID, charset, outfit] if $game_player
  ret = charset
  if pbResolveBitmap("Graphics/Characters/" + ret + "_" + outfit.to_s)
    ret = ret + "_" + outfit.to_s
  end
  #---- Mount Sprite ----#
  ret = getSurfSprite   if $PokemonGlobal&.surfing
  return ret
end

Now you just need to define which sprites the game will initially recognize in a new getSurfSprite method
thank you but i have two questions
1)Where i put this script
2)What i have to do (In easy terms) with getSurfSprite
 
Last edited:
thank you but i have two questions
1)Where i put this script
2)What i have to do (In easy terms) with getSurfSprite
Hello again! def pbGetPlayerCharset is a method that exists in your default Pokémon Essentials, so you should just add this line to it:
Ruby:
Expand Collapse Copy
ret = getSurfSprite if $PokemonGlobal&.surfing
Now to define getSurfSprite you must create a method above Main.

Ruby:
Expand Collapse Copy
def getSurfSprite
  finder = $player.get_pokemon_with_compatible_move(:SURF)
  return if !finder 
  surf   = finder.species
  player_id   = $player.character_ID
  path        = "Graphics/Characters/Surf/"
  ret = "boy_surf"  if $player.character_ID == 1 
  ret = "girl_surf" if $player.character_ID == 2 
  ret = "#{player_id}_#{surf}" if pbResolveBitmap(path + "#{player_id}_#{surf}")
  ret = "Surf/" + ret 
  return ret 
end

Here you should create a folder called Surf inside Characters and put your character's ID, 1 for male and 2 for female (default essentials) and the target species.
For example:
1_GYARADOS.png
2_GYRADOS.png
These would be the names of the files in the folder. With this, when you surf with a Gyarados and the game recognizes that there is a sprite for it, it will run it.
Also drop the boy_surf and girl_surf files into Surf to centralize your surf graphs there.
 
I put this:

#===============================================================================
#
#===============================================================================
def pbGetPlayerCharset(charset, trainer = nil, force = false)
trainer = $player if !trainer
outfit = (trainer) ? trainer.outfit : 0
return nil if !force && $game_player&.charsetData &&
$game_player.charsetData[0] == trainer.character_ID &&
$game_player.charsetData[1] == charset &&
$game_player.charsetData[2] == outfit
[imath]game_player.charsetData = [trainer.character_ID, charset, outfit] if[/imath]game_player
ret = charset
if pbResolveBitmap("Graphics/Characters/" + ret + "_" + outfit.to_s)
ret = ret + "_" + outfit.to_s
end
ret = getSurfSprite if $PokemonGlobal&.surfing
return ret
end

def getSurfSprite
finder = $player_get.pokemon.with.compatible.move(:SURF)
return if !finder
surf = finder.species
player_id = $player.character_ID
path = "Graphics/Characters/Surf/"
ret = "boy_surf" if $player.character_ID == 1
ret = "girl_surf" if $player.character_ID == 2
ret = "#{player_id}#{surf}" if pbResolveBitmap(path + "#{player_id}#{surf}")
ret = "Surf/" + ret
return ret
end

And gives me this error:
[Pokémon Essentials version 21.1][v21.1 Hotfixes 1.0.9]Exception: NoMethodErrorMessage: undefined method `get_pokemon_with_compatible_move' for #<Player Pokémon Trainer Beni @party=[:PIKACHU, :PIDGEOTTO, :KADABRA, :GYARADOS, :DIGLETT, :CHANSEY]>Backtrace:Game_Player:575:in `getSurfSprite'Game_Player:570:in `pbGetPlayerCharset'Game_Player:79:in `set_movement_type'Game_Player:591:in `pbUpdateVehicle'Overworld_FieldMoves:710:in `pbStartSurfing'[Following Pokemon EX] Field Moves.rb:30:in `pbStartSurfing'Overworld_FieldMoves:699:in `pbSurf'[Following Pokemon EX] Field Moves.rb:11:in `pbSurf'Overworld_FieldMoves:733:in `block in <main>'Event_Handlers:89:in `block in trigger'
 
Last edited:
Back
Top