- 318
- Posts
- 5
- Years
- Germany
- Seen today
Can I have a custom character player Sprite for these as they use The normal hm sprites?
Sure. Feel free to include it.
Can I have a custom character player Sprite for these as they use The normal hm sprites?
Sure. Feel free to include it.
You have to move the method "pbHiddenMoveAnimation(movefinder)" for your preferences.But how?
You have to move the method "pbHiddenMoveAnimation(movefinder)" for your preferences.
Can I have a custom character player Sprite for these as they use The normal hm sprites?
attr_accessor :surfingOnItem
attr_accessor :surfing
@surfingOnItem = false
@surfing = false
$PokemonGlobal.surfingOnItem = false
$PokemonGlobal.surfing = false
@surfonitembitmap = (pbResolveBitmap("Graphics/Characters/base_surf_on_item")) ? AnimatedBitmap.new("Graphics/Characters/base_surf_on_item") : @surfbitmap
@cwi = @surfonitembitmap.width/4
@chi = @surfonitembitmap.height/4
update
@surfonitembitmap.dispose
@surfbitmap.dispose
@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
$PokemonGlobal.surfingOnItem = false if !$PokemonGlobal.surfingOnItem
if $PokemonGlobal.surfingOnItem==true
@sprite.bitmap = @surfonitembitmap.bitmap; cw = @cwi; ch = @chi
else
@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
end
def pbStartSurfingOnItem
Kernel.pbCancelVehicles
$PokemonEncounters.clearStepCount
$PokemonGlobal.surfing = true
$PokemonGlobal.surfingOnItem = true
$PokemonTemp.surfJump = $MapFactory.getFacingCoords($game_player.x,$game_player.y,$game_player.direction)
Kernel.pbUpdateVehicle
Kernel.pbJumpToward
$PokemonTemp.surfJump = nil
Kernel.pbUpdateVehicle
$game_player.check_event_trigger_here([1,2])
end
$PokemonGlobal.surfingOnItem = true
pbHiddenMoveAnimation(nil)
pbStartSurfing
$PokemonGlobal.surfingOnItem == true ? pbStartSurfingOnItem : pbStartSurfing
pbStartSurfing
pbStartSurfingOnItem
class PokemonGlobalMetadata
attr_accessor :bicycle
attr_accessor :surfing
#-------------------------
#added for surfitem-sprite
attr_accessor :surfingOnItem
#-------------------------
attr_accessor :diving
attr_accessor :sliding
attr_accessor :fishing
attr_accessor :runtoggle
attr_accessor :repel
attr_accessor :flashUsed
attr_accessor :bridge
attr_accessor :runningShoes
attr_accessor :snagMachine
attr_accessor :seenStorageCreator
attr_accessor :startTime
attr_accessor :creditsPlayed
attr_accessor :playerID
attr_accessor :coins
attr_accessor :sootsack
attr_accessor :mailbox
attr_accessor :pcItemStorage
attr_accessor :stepcount
attr_accessor :happinessSteps
attr_accessor :pokerusTime
attr_accessor :daycare
attr_accessor :daycareEgg
attr_accessor :daycareEggSteps
attr_accessor :pokedexUnlocked # Array storing which Dexes are unlocked
attr_accessor :pokedexViable # All Dexes of non-zero length and unlocked
attr_accessor :pokedexDex # Dex currently looking at (-1 is National Dex)
attr_accessor :pokedexIndex # Last species viewed per Dex
attr_accessor :pokedexMode # Search mode
attr_accessor :healingSpot
attr_accessor :escapePoint
attr_accessor :pokecenterMapId
attr_accessor :pokecenterX
attr_accessor :pokecenterY
attr_accessor :pokecenterDirection
attr_accessor :visitedMaps
attr_accessor :mapTrail
attr_accessor :nextBattleBGM
attr_accessor :nextBattleME
attr_accessor :nextBattleBack
attr_accessor :safariState
attr_accessor :bugContestState
attr_accessor :partner
attr_accessor :challenge
attr_accessor :lastbattle
attr_accessor :phoneNumbers
attr_accessor :phoneTime
attr_accessor :eventvars
attr_accessor :safesave
def initialize
@bicycle = false
@surfing = false
#----------------------------
#added for surfitem-sprite
@surfingOnItem = false
#----------------------------
@diving = false
@sliding = false
@fishing = false
@runtoggle = false
@repel = 0
@flashused = false
@bridge = 0
@runningShoes = false
@snagMachine = false
@seenStorageCreator = false
@startTime = Time.now
@creditsPlayed = false
@playerID = -1
@coins = 0
@sootsack = 0
@mailbox = nil
@pcItemStorage = nil
@stepcount = 0
@happinessSteps = 0
@pokerusTime = nil
@daycare = [[nil,0],[nil,0]]
@daycareEgg = false
@daycareEggSteps = 0
numRegions = 0
pbRgssOpen("Data/regionals.dat","rb"){|f| numRegions = f.fgetw }
@pokedexUnlocked = []
@pokedexViable = []
@pokedexDex = (numRegions==0) ? -1 : 0
@pokedexIndex = []
@pokedexMode = 0
for i in 0...numRegions+1 # National Dex isn't a region, but is included
@pokedexIndex[i] = 0
@pokedexUnlocked[i] = (i==0)
end
@healingSpot = nil
@escapePoint = []
@pokecenterMapId = -1
@pokecenterX = -1
@pokecenterY = -1
@pokecenterDirection = -1
@visitedMaps = []
@mapTrail = []
@nextBattleBGM = nil
@nextBattleME = nil
@nextBattleBack = nil
@safariState = nil
@bugContestState = nil
@partner = nil
@challenge = nil
@lastbattle = nil
@phoneNumbers = []
@phoneTime = 0
@eventvars = {}
@safesave = false
end
def bridge
@bridge = 0 if !@bridge
return @bridge
end
end
#--------------------------------------------------
def Kernel.pbCancelVehicles(destination=nil)
$PokemonGlobal.surfing = false
#----------------------------------
#added for surfitem-sprite
$PokemonGlobal.surfingOnItem = false
#----------------------------------
$PokemonGlobal.diving = false
$PokemonGlobal.bicycle = false if !destination || !pbCanUseBike?(destination)
Kernel.pbUpdateVehicle
end
#--------------------------------------------------
class Sprite_SurfBase
attr_reader :visible
attr_accessor :event
def initialize(sprite,event,viewport=nil)
@rsprite = sprite
@sprite = nil
@event = event
@viewport = viewport
@disposed = false
@surfbitmap = AnimatedBitmap.new("Graphics/Characters/base_surf")
@divebitmap = AnimatedBitmap.new("Graphics/Characters/base_dive")
@cws = @surfbitmap.width/4
@chs = @surfbitmap.height/4
@cwd = @divebitmap.width/4
@chd = @divebitmap.height/4
#---------------------------------
#added for surfitem-sprite
@surfonitembitmap = (pbResolveBitmap("Graphics/Characters/base_surf_on_item")) ? AnimatedBitmap.new("Graphics/Characters/base_surf_on_item") : @surfbitmap
@cwi = @surfonitembitmap.width/4
@chi = @surfonitembitmap.height/4
#---------------------------------
update
end
def dispose
if !@disposed
@sprite.dispose if @sprite
@sprite = nil
@surfbitmap.dispose
#---------------------------------
#added for surfitem-sprite
@surfonitembitmap.dispose
#---------------------------------
@disposed = true
end
end
def disposed?
@disposed
end
def visible=(value)
@visible = value
@sprite.visible = value if @sprite && [email protected]?
end
def update
return if disposed?
if !$PokemonGlobal.surfing && !$PokemonGlobal.diving
# Just-in-time disposal of sprite
if @sprite
@sprite.dispose
@sprite = nil
end
return
end
# Just-in-time creation of sprite
@sprite = Sprite.new(@viewport) if !@sprite
if @sprite
if $PokemonGlobal.surfing
#---------------------------------------
#replaced for surfitem-sprite
#@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
#by
#$PokemonGlobal.surfingOnItem = false if !$PokemonGlobal.surfingOnItem
if $PokemonGlobal.surfingOnItem==true
@sprite.bitmap = @surfonitembitmap.bitmap; cw = @cwi; ch = @chi
else
@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
end
#---------------------------------
elsif $PokemonGlobal.diving
@sprite.bitmap = @divebitmap.bitmap; cw = @cwd; ch = @chd
end
sx = @event.pattern_surf*cw
sy = ((@event.direction-2)/2)*ch
@sprite.src_rect.set(sx,sy,cw,ch)
if $PokemonTemp.surfJump
@sprite.x = ($PokemonTemp.surfJump[0]*[email protected]_x+3)/4+(Game_Map::TILEWIDTH/2)
@sprite.y = ($PokemonTemp.surfJump[1]*[email protected]_y+3)/4+(Game_Map::TILEHEIGHT/2)+16
else
@sprite.x = @rsprite.x
@sprite.y = @rsprite.y
end
@sprite.ox = cw/2
@sprite.oy = ch-16 # Assume base needs offsetting
@sprite.oy -= @event.bob_height
@sprite.z = @event.screen_z(ch)-1
@sprite.zoom_x = @rsprite.zoom_x
@sprite.zoom_y = @rsprite.zoom_y
@sprite.tone = @rsprite.tone
@sprite.color = @rsprite.color
@sprite.opacity = @rsprite.opacity
end
end
end
#---------------------------------------------------------------------
def Kernel.pbSurf
return false if $game_player.pbHasDependentEvents? && (IUSEFOLLOWINGPOKEMON ? !$game_switches[Following_Activated_Switch] : true)
#return false if $game_player.pbHasDependentEvents? && !$game_switches[Following_Activated_Switch]
move = getID(PBMoves,:SURF)
movefinder = Kernel.pbCheckMove(move)
if !pbCheckHiddenMoveBadge(BADGEFORSURF,false) || (!$DEBUG && !movefinder && $PokemonBag.pbQuantity(PBItems::SURFITEM)==0)
return false
end
if Kernel.pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
if $PokemonBag.pbQuantity(PBItems::SURFITEM)>0
Kernel.pbMessage(_INTL("{1} starts surfing!",$Trainer.name))
Kernel.pbCancelVehicles
#----------------------------------
#added for surfitem-sprite
$PokemonGlobal.surfingOnItem = true
#----------------------------------
pbHiddenMoveAnimation(nil)
else
speciesname = (movefinder) ? movefinder.name : $Trainer.name
Kernel.pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
Kernel.pbCancelVehicles
pbHiddenMoveAnimation(movefinder)
end
surfbgm = pbGetMetadata(0,MetadataSurfBGM)
$PokemonTemp.dependentEvents.check_surf(true) if IUSEFOLLOWINGPOKEMON == true
pbCueBGM(surfbgm,0.5) if surfbgm
#----------------------------------
#replaced for surfitem-sprite
#pbStartSurfing
# by
$PokemonGlobal.surfingOnItem == true ? pbStartSurfingOnItem : pbStartSurfing
#----------------------------------
return true
end
return false
end
def useMoveSurf
$game_temp.in_menu = false
Kernel.pbCancelVehicles
if !pbHiddenMoveAnimation(nil)
Kernel.pbMessage(_INTL("{1} used {2}!",$Trainer.name,PBItems.getName(PBItems::SURFITEM)))
end
surfbgm = pbGetMetadata(0,MetadataSurfBGM)
pbCueBGM(surfbgm,0.5) if surfbgm
#----------------------------------
#replace for surfitem-sprite
#pbStartSurfing
#by
pbStartSurfingOnItem
#----------------------------------
return true
end
The script for me doesn't work at all. I placed above main, and below Follow. I used the name you said, have the items on the PBS with icons, but any of them use. I can't use them from the bag, any of them...
What version of Pokemon Essentials do you use? This script is for Pokemon Essentials version 17.2 and is not tested with version 18.1.
If you want HM-Moves as Items for Pokemon Essentials, then you have to upgrade this script or create a new one. For the latter, there is this tutorial by FL:
https://www.pokecommunity.com/threads/304725
I'm using 17.2, so that's why I'm worried about it :(
I've been testing and I was wrong about items not working, where they don't work is using them from the bag. For example, I can interact with the water, and use Surf, but I can't use the Surf item from the bag.
This is ok for Cut, Rocksmash, Strenght...But for Flash and Fly it's a big problem, do you know where I could start to search in order to fix it?
I tested it with Fly and Surf and Flash in Pokemon Essentials v17.2. It works from the bag. Try to install it again.