Jump to content
Rpg²S Forum
  • 0

VS. Animation (pokemon essential V14)


Gemini-air
 Share

Question

Ciao a tutti ragazzi!

Vi spiego il mio problema...ho scaricato l'ultima versione di pokemon essentials e, fortuna ha voluto, che implementassero l'animazione VS. (stile B/W). Il mio problema sussiste proprio nell'attivazione perchè o non mi si attiva o mi si attiva per ogni combattimento contro ogni allenatore!

Io vorrei capire come attivarlo SOLO con determinati allenatori (gym leaders, elite four, ecc...)

Qui sotto vi ho linkato la parte interessata dello script...HELP ME!!!!!!!!!!!!!

 

 

if trainerid>=0

tbargraphic=sprintf("Graphics/Transitions/vsBar",getConstantName(PBTrainers,trainerid)) rescue nil
tbargraphic=sprintf("Graphics/Transitions/vsBar",trainerid) if !pbResolveBitmap(tbargraphic)
tgraphic=sprintf("Graphics/Transitions/vsTrainer",getConstantName(PBTrainers,trainerid)) rescue nil
tgraphic=sprintf("Graphics/Transitions/vsTrainer",trainerid) if !pbResolveBitmap(tgraphic)
if pbResolveBitmap(tbargraphic) && pbResolveBitmap(tgraphic)
outfit=$Trainer ? $Trainer.outfit : 0
# Set up
viewplayer=Viewport.new(0,Graphics.height/3,Graphics.width/2,128)
viewplayer.z=viewport.z
viewopp=Viewport.new(Graphics.width/2,Graphics.height/3,Graphics.width/2,128)
viewopp.z=viewport.z
viewvs=Viewport.new(0,0,Graphics.width,Graphics.height)
viewvs.z=viewport.z
xoffset=(Graphics.width/2)/10
xoffset=xoffset.round
xoffset=xoffset*10
fade=Sprite.new(viewport)
fade.bitmap=BitmapCache.load_bitmap("Graphics/Transitions/vsFlash")
fade.tone=Tone.new(-255,-255,-255)
fade.opacity=100
overlay=Sprite.new(viewport)
overlay.bitmap=Bitmap.new(Graphics.width,Graphics.height)
pbSetSystemFont(overlay.bitmap)
bar1=Sprite.new(viewplayer)
pbargraphic=sprintf("Graphics/Transitions/vsBar",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil
pbargraphic=sprintf("Graphics/Transitions/vsBar",$Trainer.trainertype,outfit) if !pbResolveBitmap(pbargraphic)
if !pbResolveBitmap(pbargraphic)
pbargraphic=sprintf("Graphics/Transitions/vsBar",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil
end
pbargraphic=sprintf("Graphics/Transitions/vsBar%d",$Trainer.trainertype) if !pbResolveBitmap(pbargraphic)
bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)
bar1.x=-xoffset
bar2=Sprite.new(viewopp)
bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)
bar2.x=xoffset
vs=Sprite.new(viewvs)
vs.bitmap=BitmapCache.load_bitmap("Graphics/Transitions/vs")
vs.ox=vs.bitmap.width/2
vs.oy=vs.bitmap.height/2
vs.x=Graphics.width/2
vs.y=Graphics.height/1.5
vs.visible=false
flash=Sprite.new(viewvs)
flash.bitmap=BitmapCache.load_bitmap("Graphics/Transitions/vsFlash")
flash.opacity=0
# Animation
10.times do
bar1.x+=xoffset/10
bar2.x-=xoffset/10
pbWait(1)
end
pbSEPlay("Flash2")
pbSEPlay("Sword2")
flash.opacity=255
bar1.dispose
bar2.dispose
bar1=AnimatedPlane.new(viewplayer)
bar1.bitmap=BitmapCache.load_bitmap(pbargraphic)
player=Sprite.new(viewplayer)
pgraphic=sprintf("Graphics/Transitions/vsTrainer%s_%d",getConstantName(PBTrainers,$Trainer.trainertype),outfit) rescue nil
pgraphic=sprintf("Graphics/Transitions/vsTrainer%d_%d",$Trainer.trainertype,outfit) if !pbResolveBitmap(pgraphic)
if !pbResolveBitmap(pgraphic)
pgraphic=sprintf("Graphics/Transitions/vsTrainer%s",getConstantName(PBTrainers,$Trainer.trainertype)) rescue nil
end
pgraphic=sprintf("Graphics/Transitions/vsTrainer%d",$Trainer.trainertype) if !pbResolveBitmap(pgraphic)
player.bitmap=BitmapCache.load_bitmap(pgraphic)
player.x=-xoffset
bar2=AnimatedPlane.new(viewopp)
bar2.bitmap=BitmapCache.load_bitmap(tbargraphic)
trainer=Sprite.new(viewopp)
trainer.bitmap=BitmapCache.load_bitmap(tgraphic)
trainer.x=xoffset
trainer.tone=Tone.new(-255,-255,-255)
25.times do
flash.opacity-=51 if flash.opacity>0
bar1.ox-=16
bar2.ox+=16
pbWait(1)
end
11.times do
bar1.ox-=16
bar2.ox+=16
player.x+=xoffset/10
trainer.x-=xoffset/10
pbWait(1)
end
2.times do
bar1.ox-=16
bar2.ox+=16
player.x-=xoffset/20
trainer.x+=xoffset/20
pbWait(1)
end
10.times do
bar1.ox-=16
bar2.ox+=16
pbWait(1)
end
val=2
flash.opacity=255
vs.visible=true
trainer.tone=Tone.new(0,0,0)
textpos=[
[_INTL("{1}",$Trainer.name),Graphics.width/4,(Graphics.height/1.5)+10,2,
Color.new(248,248,248),Color.new(12*6,12*6,12*6)],
[_INTL("{1}",trainername),(Graphics.width/4)+(Graphics.width/2),(Graphics.height/1.5)+10,2,
Color.new(248,248,248),Color.new(12*6,12*6,12*6)]
]
pbDrawTextPositions(overlay.bitmap,textpos)
pbSEPlay("Sword2")
70.times do
bar1.ox-=16
bar2.ox+=16
flash.opacity-=25.5 if flash.opacity>0
vs.x+=val
vs.y-=val
val=2 if vs.x<=(Graphics.width/2)-2
val=-2 if vs.x>=(Graphics.width/2)+2
pbWait(1)
end
30.times do
bar1.ox-=16
bar2.ox+=16
vs.zoom_x+=0.2
vs.zoom_y+=0.2
pbWait(1)
end
flash.tone=Tone.new(-255,-255,-255)
10.times do
bar1.ox-=16
bar2.ox+=16
flash.opacity+=25.5
pbWait(1)
end
# End
player.dispose
trainer.dispose
flash.dispose
vs.dispose
bar1.dispose
bar2.dispose
overlay.dispose
fade.dispose
viewvs.dispose
viewopp.dispose
viewplayer.dispose
viewport.color=Color.new(0,0,0,255)
handled=true
end
end
# End of VS. sequence script
if !handled
if Sprite.method_defined?(:wave_amp) && rand(15)==0
viewport.color=Color.new(0,0,0,255)
sprite = Sprite.new
bitmap=Graphics.snap_to_bitmap
bm=bitmap.clone
sprite.z=99999
sprite.bitmap = bm
sprite.wave_speed=500
for i in 0..25
sprite.opacity-=10
sprite.wave_amp+=60
sprite.update
sprite.wave_speed+=30
2.times do
Graphics.update
end
end
bitmap.dispose
bm.dispose
sprite.dispose
elsif Bitmap.method_defined?(:radial_blur) && rand(15)==0
viewport.color=Color.new(0,0,0,255)
sprite = Sprite.new
bitmap=Graphics.snap_to_bitmap
bm=bitmap.clone
sprite.z=99999
sprite.bitmap = bm
for i in 0..15
bm.radial_blur(i,2)
sprite.opacity-=15
2.times do
Graphics.update
end
end
bitmap.dispose
bm.dispose
sprite.dispose
elsif rand(15)==0
scroll=["ScrollDown","ScrollLeft","ScrollRight","ScrollUp"]
Graphics.freeze
viewport.color=Color.new(0,0,0,255)
Graphics.transition(50,sprintf("Graphics/Transitions/%s",scroll[rand(4)]))
elsif rand(15)==0
scroll=["ScrollDownRight","ScrollDownLeft","ScrollUpRight","ScrollUpLeft"]
Graphics.freeze
viewport.color=Color.new(0,0,0,255)
Graphics.transition(50,sprintf("Graphics/Transitions/%s",scroll[rand(4)]))
else
transitions=["021-Normal01","022-Normal02",
"Battle","battle1","battle2","battle3","battle4",
"computertr","computertrclose",
"hexatr","hexatrc","hexatzr",
"Image1","Image2","Image3","Image4",
"Splash","Random_stripe_v","Random_stripe_h",
"RotatingPieces","ShrinkingPieces",
"BreakingGlass","Mosaic","zoomin"
]
rnd=rand(transitions.length)
Graphics.freeze
viewport.color=Color.new(0,0,0,255)
Graphics.transition(40,sprintf("Graphics/Transitions/%s",transitions[rnd]))
end
5.times do
Graphics.update
Input.update
pbUpdateSceneMap
end
end
pbPushFade
yield if block_given?
pbPopFade
if $game_system && $game_system.is_a?(Game_System)
$game_system.bgm_resume(playingBGM)
$game_system.bgs_resume(playingBGS)
end
$PokemonGlobal.nextBattleBGM=nil
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
$PokemonEncounters.clearStepCount
for j in 0..17
viewport.color=Color.new(0,0,0,(17-j)*15)
Graphics.update
Input.update
pbUpdateSceneMap
end
viewport.dispose
end
def pbPrepareBattle(battle)
if $game_screen.weather_type==1 || $game_screen.weather_type==2
battle.weather=PBWeather::RAINDANCE
battle.weatherduration=-1
elsif $game_screen.weather_type==3
battle.weather=PBWeather::HAIL
battle.weatherduration=-1
elsif $game_screen.weather_type==4
battle.weather=PBWeather::SANDSTORM
battle.weatherduration=-1
elsif $game_screen.weather_type==5
battle.weather=PBWeather::SUNNYDAY
battle.weatherduration=-1
end
battle.shiftStyle=($PokemonSystem.battlestyle==0)
battle.battlescene=($PokemonSystem.battlescene==0)
battle.environment=pbGetEnvironment
end
def pbGetEnvironment
return PBEnvironment::None if !$game_map
if $PokemonGlobal && $PokemonGlobal.diving
return PBEnvironment::Underwater
elsif $PokemonEncounters && $PokemonEncounters.isCave?
return PBEnvironment::Cave
elsif !pbGetMetadata($game_map.map_id,MetadataOutdoor)
return PBEnvironment::None
else
terrain=$game_player.terrain_tag
if terrain==PBTerrain::Grass # Normal grass
return PBEnvironment::Grass
elsif terrain==PBTerrain::TallGrass # Tall grass
return PBEnvironment::TallGrass
elsif terrain==PBTerrain::DeepWater || terrain==PBTerrain::Water
return PBEnvironment::MovingWater
elsif terrain==PBTerrain::StillWater
return PBEnvironment::StillWater
elsif terrain==PBTerrain::Rock
return PBEnvironment::Rock
elsif terrain==PBTerrain::Sand
return PBEnvironment::Sand
end
return PBEnvironment::None
end
end
def pbGenerateWildPokemon(species,level)
genwildpoke=PokeBattle_Pokemon.new(species,level,$Trainer)
items=genwildpoke.wildHoldItems
chances=[50,5,1]
chances=[60,20,5] if !$Trainer.party[0].egg? &&
isConst?($Trainer.party[0].ability,PBAbilities,:COMPOUNDEYES)
itemrnd=rand(100)
if itemrnd<chances[0] || (items[0]==items[1] && items[1]==items[2])
genwildpoke.item=items[0]
elsif itemrnd<(chances[0]+chances[1])
genwildpoke.item=items[1]
elsif itemrnd<(chances[0]+chances[1]+chances[2])
genwildpoke.item=items[2]
end
if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbQuantity(PBItems::SHINYCHARM)>0
for i in 0...2 # 3 times as likely
break if genwildpoke.isShiny?
genwildpoke.personalID=rand(65536)|(rand(65536)<<16)
end
end
if rand(65536)<POKERUSCHANCE
genwildpoke.givePokerus
end
Events.onWildPokemonCreate.trigger(nil,genwildpoke)
return genwildpoke
end
def pbWildBattle(species,level,variable=nil,canescape=true,canlose=false)
if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
if $Trainer.pokemonCount>0
Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
end
pbSet(variable,1)
$PokemonGlobal.nextBattleBGM=nil
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
return true
end
handled=[nil]
Events.onWildBattleOverride.trigger(nil,species,level,handled)
if handled[0]!=nil
return handled[0]
end
currentlevels=[]
for i in $Trainer.party
currentlevels.push(i.level)
end
genwildpoke=pbGenerateWildPokemon(species,level)
Events.onStartBattle.trigger(nil,genwildpoke)
scene=pbNewBattleScene
battle=PokeBattle_Battle.new(scene,$Trainer.party,[genwildpoke],$Trainer,nil)
battle.internalbattle=true
battle.cantescape=!canescape
pbPrepareBattle(battle)
decision=0
pbBattleAnimation(pbGetWildBattleBGM(species)) {
pbSceneStandby {
decision=battle.pbStartBattle(canlose)
}
for i in $Trainer.party; (i.makeUnmega rescue nil); end
if $PokemonGlobal.partner
pbHealAll
for i in $PokemonGlobal.partner[3]
i.heal
i.makeUnmega rescue nil
end
end
if decision==2 || decision==5 # if loss or draw
if canlose
for i in $Trainer.party; i.heal; end
for i in 0...10
Graphics.update
end
else
$game_system.bgm_unpause
$game_system.bgs_unpause
Kernel.pbStartOver
end
end
Events.onEndBattle.trigger(nil,decision)
}
Input.update
pbSet(variable,decision)
Events.onWildBattleEnd.trigger(nil,species,level,decision)
return (decision!=2)
end
def pbDoubleWildBattle(species1,level1,species2,level2,variable=nil,canescape=true,canlose=false)
if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
if $Trainer.pokemonCount>0
Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
end
pbSet(variable,1)
$PokemonGlobal.nextBattleBGM=nil
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
return true
end
currentlevels=[]
for i in $Trainer.party
currentlevels.push(i.level)
end
genwildpoke=pbGenerateWildPokemon(species1,level1)
genwildpoke2=pbGenerateWildPokemon(species2,level2)
Events.onStartBattle.trigger(nil,genwildpoke)
scene=pbNewBattleScene
if $PokemonGlobal.partner
othertrainer=PokeBattle_Trainer.new(
$PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
othertrainer.id=$PokemonGlobal.partner[2]
othertrainer.party=$PokemonGlobal.partner[3]
combinedParty=[]
for i in 0...$Trainer.party.length
combinedParty=$Trainer.party
end
for i in 0...othertrainer.party.length
combinedParty[6+i]=othertrainer.party
end
battle=PokeBattle_Battle.new(scene,combinedParty,[genwildpoke,genwildpoke2],
[$Trainer,othertrainer],nil)
battle.fullparty1=true
else
battle=PokeBattle_Battle.new(scene,$Trainer.party,[genwildpoke,genwildpoke2],
$Trainer,nil)
end
battle.internalbattle=true
battle.doublebattle=battle.pbDoubleBattleAllowed?()
battle.cantescape=!canescape
pbPrepareBattle(battle)
decision=0
pbBattleAnimation(pbGetWildBattleBGM(species1)) {
pbSceneStandby {
decision=battle.pbStartBattle(canlose)
}
for i in $Trainer.party; (i.makeUnmega rescue nil); end
if $PokemonGlobal.partner
pbHealAll
for i in $PokemonGlobal.partner[3]
i.heal
i.makeUnmega rescue nil
end
end
if decision==2 || decision==5
if canlose
for i in $Trainer.party; i.heal; end
for i in 0...10
Graphics.update
end
else
$game_system.bgm_unpause
$game_system.bgs_unpause
Kernel.pbStartOver
end
end
Events.onEndBattle.trigger(nil,decision)
}
Input.update
pbSet(variable,decision)
return (decision!=2 && decision!=5)
end
def pbCheckAllFainted()
if pbAllFainted
Kernel.pbMessage(_INTL("{1} has no usable Pokémon!\1",$Trainer.name))
Kernel.pbMessage(_INTL("{1} blacked out!",$Trainer.name))
pbBGMFade(1.0)
pbBGSFade(1.0)
pbFadeOutIn(99999){
Kernel.pbStartOver
}
end
end
def pbEvolutionCheck(currentlevels)
# Check conditions for evolution
for i in 0...currentlevels.length
pokemon=$Trainer.party
if pokemon && (!currentlevels || pokemon.level!=currentlevels)
newspecies=Kernel.pbCheckEvolution(pokemon)
if newspecies>0
# Start evolution scene
evo=PokemonEvolutionScene.new
evo.pbStartScreen(pokemon,newspecies)
evo.pbEvolution
evo.pbEndScreen
end
end
end
end
def pbDynamicItemList(*args)
ret=[]
for i in 0...args.length
if hasConst?(PBItems,args)
ret.push(getConst(PBItems,args.to_sym))
end
end
return ret
end
# Runs the Pickup event after a battle if a Pokemon has the ability Pickup.
def Kernel.pbPickup(pokemon)
return if !isConst?(pokemon.ability,PBAbilities,:PICKUP) || pokemon.egg?
return if pokemon.item!=0
return if rand(10)!=0
pickupList=pbDynamicItemList(
:POTION,
:ANTIDOTE,
:SUPERPOTION,
:GREATBALL,
:REPEL,
:ESCAPEROPE,
:FULLHEAL,
:HYPERPOTION,
:ULTRABALL,
:REVIVE,
:RARECANDY,
:SUNSTONE,
:MOONSTONE,
:HEARTSCALE,
:FULLRESTORE,
:MAXREVIVE,
:PPUP,
:MAXELIXIR
)
pickupListRare=pbDynamicItemList(
:HYPERPOTION,
:NUGGET,
:KINGSROCK,
:FULLRESTORE,
:ETHER,
:IRONBALL,
:PRISMSCALE,
:ELIXIR,
:PRISMSCALE,
:LEFTOVERS,
:PRISMSCALE
)
return if pickupList.length!=18
return if pickupListRare.length!=11
randlist=[30,10,10,10,10,10,10,4,4,1,1]
items=[]
plevel=[100,pokemon.level].min
rnd=rand(100)
itemstart=(plevel-1)/10
itemstart=0 if itemstart<0
for i in 0...9
items.push(pickupList[i+itemstart])
end
items.push(pickupListRare[itemstart])
items.push(pickupListRare[itemstart+1])
cumnumber=0
for i in 0...11
cumnumber+=randlist
if rnd<cumnumber
pokemon.item=items
break
end
end
end
class PokemonTemp
attr_accessor :encounterType
attr_accessor :evolutionLevels
end
def pbEncounter(enctype)
if $PokemonGlobal.partner
encounter1=$PokemonEncounters.pbEncounteredPokemon(enctype)
return false if !encounter1
encounter2=$PokemonEncounters.pbEncounteredPokemon(enctype)
return false if !encounter2
$PokemonTemp.encounterType=enctype
pbDoubleWildBattle(encounter1[0],encounter1[1],encounter2[0],encounter2[1])
$PokemonTemp.encounterType=-1
return true
else
encounter=$PokemonEncounters.pbEncounteredPokemon(enctype)
return false if !encounter
$PokemonTemp.encounterType=enctype
pbWildBattle(encounter[0],encounter[1])
$PokemonTemp.encounterType=-1
return true
end
end
Events.onStartBattle+=proc {|sender,e|
$PokemonTemp.evolutionLevels=[]
for i in 0...$Trainer.party.length
$PokemonTemp.evolutionLevels=$Trainer.party.level
end
}
Events.onEndBattle+=proc {|sender,e|
decision=e[0]
if decision!=2 && decision!=5 # not a loss or a draw
if $PokemonTemp.evolutionLevels
pbEvolutionCheck($PokemonTemp.evolutionLevels)
$PokemonTemp.evolutionLevels=nil
end
end
if decision==1
for pkmn in $Trainer.party
Kernel.pbPickup(pkmn)
if isConst?(pkmn.ability,PBAbilities,:HONEYGATHER) && !pkmn.egg? && pkmn.item==0
if hasConst?(PBItems,:HONEY)
chance = 5 + ((pkmn.level-1)/10)*5
pkmn.item=getConst(PBItems,:HONEY) if rand(100)<chance
end
end
end
end
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Ti consiglio di mettere sotto spoiler tutto lo script se no la gente impiega 20 anni a scorrere...

Ho appena letto lo wiki, e sembra facile.

Hai letto la sezione giusta?

Io purtoppo non ho molto tempo ora.

Edited by Seanbb
Link to comment
Share on other sites

  • 0

in base al nome che dai alle picture che si trovano nella cartella "transition".

 

vsBar0 = barra di sfondo dell'trainer n°0
vsTrainer0 = immagine dell'allenatore corrispondente al trainer n°0

 

se si scontrano due persone, entrambe con la loro immagine di riferimento, compare automaticamente il VS.

 

es.

Il PG è il trainer 0

Brock è il trainer 3
se hai vsBar0,vsBar3,vsTrainer0 e vsTrainer3 nella cartella transition allora compare il VS tra il tuo PG e Brock
con Pigliamosche che è il trainer 4 non comparirà niente perchè non esiste il vsBar4 e il vsTrainer4



http://www.webgif.org/gif_animate/animali/insetti/immagini/10.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...