FL
Pokémon Island Creator
- 2,548
- Posts
- 14
- Years
- Seen today
How to make overworlds appears at the stadiums between rounds
Spoiler:
PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
At the script, change
to
Change
to
Change line 'full_list = TRAINER_LIST[@tournament_type]' into 'full_list = TRAINER_LIST[@tournament_type].clone'. Change line '@trainer_list.push("Leader_#{@trainer_list[1]}") if @trainer_list[6].nil?' into '@trainer_list[6]="Leader_#{@trainer_list[1]}" if @trainer_list[6].nil?'.
So we need to create three events with one page each. One is the guide at the counter. The other two are in another map, the stadium. One is an empty invisible event called "Opponent", and the second is an invisible autostart event called "Controller". Look at the attachment about the "Guide" and "Controller" commands.
You can set three more parameters for each trainer array: The speech before battle, speech after you win and the speech after you lose. Each one can be a single string or an array with strings, an example:
At the script, change
Code:
def initialize(announce=false)
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=9999
@sprites["scoreboard"]=Sprite.new(@viewport)
@sprites["scoreboard"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
@sprites["scoreboard"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
@sprites["scoreboard"].opacity=0
$Trainer.battle_points=0 if !$Trainer.battle_points
if !$Trainer.pwt_wins or $Trainer.pwt_wins.length<BATTLE_LIST.length
$Trainer.pwt_wins=[]
for i in 0...BATTLE_LIST.length
$Trainer.pwt_wins.push(0)
end
end
@current_party = $Trainer.party
self.generateWorldLeaders if BATTLE_LIST.include?("World Leaders")
self.generateRentalMasters if BATTLE_LIST.include?("Rental Masters")
self.generateMixMasters if BATTLE_LIST.include?("Mix Masters")
self.introduction
@tournament_type = chooseTournament
return cancelEntry if !@tournament_type
@battle_type = chooseBattle
return cancelEntry if !@battle_type
@modified_party = choosePokemon
if @modified_party=="notEligible"
Kernel.pbMessage(_INTL("We're terribly sorry, but your Pokemon are not eligible for the Tournament."))
Kernel.pbMessage(_INTL(showBanList))
Kernel.pbMessage(_INTL("Please come back once your Pokemon Party has been adjusted."))
elsif !@modified_party
cancelEntry
else
self.generateRounds
ret=self.startTournament(announce)
end
@sprites["scoreboard"].bitmap.clear
@sprites["scoreboard"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
15.times do
@sprites["scoreboard"].opacity-=17
pbWait(1)
end
case ret
when "win"
Kernel.pbMessage(_INTL("Congratulations on today's win."))
Kernel.pbMessage(_INTL("For your victory you have earned 3 BP."))
Kernel.pbMessage(_INTL("We hope to see you again."))
$Trainer.pwt_wins[@tournament_type]+=1
$Trainer.battle_points+=3
when "loss"
Kernel.pbMessage(_INTL("I'm sorry that you lost this tournament."))
Kernel.pbMessage(_INTL("Maybe you'll have better luck next time."))
cancelEntry
end
$Trainer.party = @current_party
end
Code:
attr_accessor :round
attr_accessor :won
attr_accessor :finished
def initialize(announce=false)
@announce=announce
@finished=false
@won=false
end
def start
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=9999
@sprites["scoreboard"]=Sprite.new(@viewport)
@sprites["scoreboard"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
@sprites["scoreboard"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
@sprites["scoreboard"].opacity=0
$Trainer.battle_points=0 if !$Trainer.battle_points
if !$Trainer.pwt_wins or $Trainer.pwt_wins.length<BATTLE_LIST.length
$Trainer.pwt_wins=[]
for i in 0...BATTLE_LIST.length
$Trainer.pwt_wins.push(0)
end
end
@current_party = $Trainer.party
self.generateWorldLeaders if BATTLE_LIST.include?("World Leaders")
self.generateRentalMasters if BATTLE_LIST.include?("Rental Masters")
self.generateMixMasters if BATTLE_LIST.include?("Mix Masters")
self.introduction
@tournament_type = chooseTournament
return cancelEntry if !@tournament_type
@battle_type = chooseBattle
return cancelEntry if !@battle_type
@modified_party = choosePokemon
if @modified_party=="notEligible"
Kernel.pbMessage(_INTL("We're terribly sorry, but your Pokemon are not eligible for the Tournament."))
Kernel.pbMessage(_INTL(showBanList))
Kernel.pbMessage(_INTL("Please come back once your Pokemon Party has been adjusted."))
elsif !@modified_party
cancelEntry
else
self.generateRounds
return true
end
return false
end
def endTournament(win)
@sprites["scoreboard"].bitmap.clear
@sprites["scoreboard"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
if win
Kernel.pbMessage(_INTL("Congratulations on today's win."))
Kernel.pbMessage(_INTL("For your victory you have earned 3 BP."))
Kernel.pbMessage(_INTL("We hope to see you again."))
$Trainer.pwt_wins[@tournament_type]+=1
$Trainer.battle_points+=3
else # loss
Kernel.pbMessage(_INTL("I'm sorry that you lost this tournament."))
Kernel.pbMessage(_INTL("Maybe you'll have better luck next time."))
cancelEntry
end
$Trainer.party = @current_party
end
Change
Code:
def startTournament(announce)
@round=0
doublebattle=false
doublebattle=true if @battle_type==1
15.times do
@sprites["scoreboard"].opacity+=17
pbWait(1)
end
Kernel.pbMessage(_INTL("Announcer: Welcome to the #{BATTLE_LIST[@tournament_type]} Tournament!"))
Kernel.pbMessage(_INTL("Announcer: Today we have 8 very eager contestants, waiting to compete for the title of \"Champion\"."))
Kernel.pbMessage(_INTL("Announcer: Let us turn our attention to the scoreboard, to see who will be competing today."))
self.createScoreBoard(@trainer_list)
for i in 0...8
announceContest(@trainer_list[i],i) if announce
end
Kernel.pbMessage(_INTL("Announcer: Without further ado, let the first match begin."))
trainer=self.generateRound1
Kernel.pbMessage(_INTL("Announcer: This will be a battle between #{$Trainer.name} and #{trainer[1]}."))
outcome=pbPWTTrainerBattle(trainer[0],trainer[1],trainer[2],trainer[3],doublebattle)
if outcome==1
@round=1
Kernel.pbMessage(_INTL("Announcer: Wow! What an exciting first round!"))
Kernel.pbMessage(_INTL("Announcer: The stadium is getting heated up, and the contestants are on fire!"))
Kernel.pbMessage(_INTL("Announcer: Let us turn our attention back to the scoreboard for the results."))
trainer=self.generateRound2
self.createScoreBoard(@trainer_list)
Kernel.pbMessage(_INTL("Announcer: It looks like the next match will be between #{$Trainer.name} and #{trainer[1]}."))
Kernel.pbMessage(_INTL("Announcer: Let the battle begin!"))
outcome=pbPWTTrainerBattle(trainer[0],trainer[1],trainer[2],trainer[3],doublebattle)
if outcome==1
@round=2
Kernel.pbMessage(_INTL("Announcer: What spectacular matches!"))
Kernel.pbMessage(_INTL("Announcer: These trainers are really giving it all."))
Kernel.pbMessage(_INTL("Announcer: Let's direct our attention at the scoreboard one final time."))
trainer=self.generateRound3
self.createScoreBoard(@trainer_list)
Kernel.pbMessage(_INTL("Announcer: Alright! It's all set!"))
Kernel.pbMessage(_INTL("Announcer: The final match of this tournament will be between #{$Trainer.name} and #{trainer[1]}!"))
Kernel.pbMessage(_INTL("Announcer: May the best trainer win!"))
outcome=pbPWTTrainerBattle(trainer[0],trainer[1],trainer[2],trainer[3],doublebattle)
if outcome==1
Kernel.pbMessage(_INTL("Announcer: What an amazing battle!"))
Kernel.pbMessage(_INTL("Announcer: Both the trainers put up a great fight, but our very own #{$Trainer.name} was the one to come out on top!"))
Kernel.pbMessage(_INTL("Announcer: Congratulations #{$Trainer.name}! You have certainly earned today's title of \"Champion\"!"))
Kernel.pbMessage(_INTL("Announcer: That's all we have time for. I hope you enjoyed todays contest. And we hope to see you again soon."))
return "win"
end
end
end
return "loss"
end
to
Code:
def announcerRound1
Kernel.pbMessage(_INTL("Announcer: Welcome to the #{BATTLE_LIST[@tournament_type]} Tournament!"))
Kernel.pbMessage(_INTL("Announcer: Today we have 8 very eager contestants, waiting to compete for the title of \"Champion\"."))
Kernel.pbMessage(_INTL("Announcer: Let us turn our attention to the scoreboard, to see who will be competing today."))
self.createScoreBoard(@trainer_list)
@sprites["scoreboard"].opacity=255
for i in 0...8
announceContest(@trainer_list[i],i) if @announce
end
Kernel.pbMessage(_INTL("Announcer: Without further ado, let the first match begin."))
@nextTrainer=self.generateRound1
Kernel.pbMessage(_INTL("Announcer: This will be a battle between #{$Trainer.name} and #{@nextTrainer[1]}."))
@sprites["scoreboard"].opacity=0
end
def announcerRound2
Kernel.pbMessage(_INTL("Announcer: Wow! What an exciting first round!"))
Kernel.pbMessage(_INTL("Announcer: The stadium is getting heated up, and the contestants are on fire!"))
Kernel.pbMessage(_INTL("Announcer: Let us turn our attention back to the scoreboard for the results."))
@nextTrainer=self.generateRound2
self.createScoreBoard(@trainer_list)
@sprites["scoreboard"].opacity=255
Kernel.pbMessage(_INTL("Announcer: It looks like the next match will be between #{$Trainer.name} and #{@nextTrainer[1]}."))
Kernel.pbMessage(_INTL("Announcer: Let the battle begin!"))
@sprites["scoreboard"].opacity=0
end
def announcerRound3
Kernel.pbMessage(_INTL("Announcer: What spectacular matches!"))
Kernel.pbMessage(_INTL("Announcer: These trainers are really giving it all."))
Kernel.pbMessage(_INTL("Announcer: Let's direct our attention at the scoreboard one final time."))
@nextTrainer=self.generateRound3
self.createScoreBoard(@trainer_list)
@sprites["scoreboard"].opacity=255
Kernel.pbMessage(_INTL("Announcer: Alright! It's all set!"))
Kernel.pbMessage(_INTL("Announcer: The final match of this tournament will be between #{$Trainer.name} and #{@nextTrainer[1]}!"))
Kernel.pbMessage(_INTL("Announcer: May the best trainer win!"))
@sprites["scoreboard"].opacity=0
end
def winTournament
Kernel.pbMessage(_INTL("Announcer: What an amazing battle!"))
Kernel.pbMessage(_INTL("Announcer: Both the trainers put up a great fight, but our very own #{$Trainer.name} was the one to come out on top!"))
Kernel.pbMessage(_INTL("Announcer: Congratulations #{$Trainer.name}! You have certainly earned today's title of \"Champion\"!"))
Kernel.pbMessage(_INTL("Announcer: That's all we have time for. I hope you enjoyed todays contest. And we hope to see you again soon."))
end
def beforeBattleMessage
outbattleMessage(7)
end
def afterBattleWinMessage
outbattleMessage(8)
end
def afterBattleLoseMessage
outbattleMessage(9)
end
def outbattleMessage(listIndex)
if @nextTrainer[listIndex]
dialogueLines=@nextTrainer[listIndex].is_a?(Array) ? @nextTrainer[listIndex] : [@nextTrainer[listIndex]]
for line in dialogueLines
Kernel.pbMessage(line)
end
end
end
def battle
trainerid=@nextTrainer[0]
trainername=@nextTrainer[1]
endspeech=@nextTrainer[2]
endspeechwin=@nextTrainer[3]
doublebattle=@battle_type==1
return pbPWTTrainerBattle(trainerid,trainername,endspeech,endspeechwin, doublebattle)
end
def setEventGraphic(event)
filename = @nextTrainer[6]
begin
bitmap=BitmapCache.load_bitmap("Graphics/Characters/#{filename}")
bitmap.dispose
event.character_name=filename
rescue
event.character_name="trchar000"
end
end
Change line 'full_list = TRAINER_LIST[@tournament_type]' into 'full_list = TRAINER_LIST[@tournament_type].clone'. Change line '@trainer_list.push("Leader_#{@trainer_list[1]}") if @trainer_list[6].nil?' into '@trainer_list[6]="Leader_#{@trainer_list[1]}" if @trainer_list[6].nil?'.
So we need to create three events with one page each. One is the guide at the counter. The other two are in another map, the stadium. One is an empty invisible event called "Opponent", and the second is an invisible autostart event called "Controller". Look at the attachment about the "Guide" and "Controller" commands.
You can set three more parameters for each trainer array: The speech before battle, speech after you win and the speech after you lose. Each one can be a single string or an array with strings, an example:
Code:
[PBTrainers::LEADER_0,"Brock","Looks like you were the sturdier of us.","My barrier was tough to break. Maybe next time.","Kanto","Pewter City",nil,["I'm Brock, the Pewter Gym Leader.", "I'm an expert on Rock-type Pokémon.","My Pokémon are impervious to most physical attacks.","You'll have a hard time inflicting any damage."," Come on!"],"Your Pokémon's powerful attacks overcame my rock-hard resistance..."],