• 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.

Pokemon Contests Script 1.5

31
Posts
8
Years
Yeah that one is caused by the Elite Battle System I believe. Because without the System it all works fine.
I tested it in v16.1 without the Elite Battle System and the Contests work.
 
Last edited:
31
Posts
8
Years
I found a fix.
In Main Contest Script
Before the second def update add:
Code:
def pbSpriteSetAnimFrames(sprite,frame,user=nil,target=nil,ineditor=false)
  return if !sprite
  if !frame
    sprite.visible=false
    sprite.src_rect=Rect.new(0,0,1,1)
    return
  end
  sprite.blend_type=frame[AnimFrame::BLENDTYPE]
  sprite.angle=frame[AnimFrame::ANGLE]
  sprite.mirror=(frame[AnimFrame::MIRROR]>0)
  sprite.opacity=frame[AnimFrame::OPACITY]
  sprite.visible=true
  if !frame[AnimFrame::VISIBLE]==1 && ineditor
    sprite.opacity/=2
  else
    sprite.visible=(frame[AnimFrame::VISIBLE]==1)
  end
  pattern=frame[AnimFrame::PATTERN]
  if pattern>=0
#    if sprite.bitmap && !sprite.bitmap.disposed?
#      animwidth=sprite.bitmap.width/5
#      #echo(animwidth.inspect+"\r\n")
#    else
#      animwidth=192
#    end
    animwidth=192
    sprite.src_rect.set((pattern%5)*animwidth,(pattern/5)*animwidth,
       animwidth,animwidth)
  else
    sprite.src_rect.set(0,0,
       sprite.bitmap ? sprite.bitmap.width : 128,
       sprite.bitmap ? sprite.bitmap.height : 128)
  end
  sprite.zoom_x=frame[AnimFrame::ZOOMX]/100.0
  sprite.zoom_y=frame[AnimFrame::ZOOMY]/100.0
  sprite.color.set(
     frame[AnimFrame::COLORRED],
     frame[AnimFrame::COLORGREEN],
     frame[AnimFrame::COLORBLUE],
     frame[AnimFrame::COLORALPHA]
  )
  sprite.tone.set(
     frame[AnimFrame::TONERED],
     frame[AnimFrame::TONEGREEN],
     frame[AnimFrame::TONEBLUE],
     frame[AnimFrame::TONEGRAY] 
  )
  sprite.ox=sprite.src_rect.width/2
  sprite.oy=sprite.src_rect.height/2
  sprite.x=frame[AnimFrame::X]
  sprite.y=frame[AnimFrame::Y]
  if sprite!=user && sprite!=target
    case frame[AnimFrame::PRIORITY]
    when 0   # Behind everything
      sprite.z=5
    when 1   # In front of everything
      sprite.z=35
    when 2   # Just behind focus
      if frame[AnimFrame::FOCUS]==1 # Focused on target
        sprite.z=(target) ? target.z-1 : 5
      elsif frame[AnimFrame::FOCUS]==2 # Focused on user
        sprite.z=(user) ? user.z-1 : 5
      else # Focused on user and target, or screen
        sprite.z=5
      end
    when 3   # Just in front of focus
      if frame[AnimFrame::FOCUS]==1 # Focused on target
        sprite.z=(target) ? target.z+1 : 35
      elsif frame[AnimFrame::FOCUS]==2 # Focused on user
        sprite.z=(user) ? user.z+1 : 35
      else # Focused on user and target, or screen
        sprite.z=35
      end
    else
      sprite.z=35
    end
  end
end
And change:
pbSpriteSetAnimFrame(sprite,cel,@usersprite,@targetsprite)
To
pbSpriteSetAnimFrames(sprite,cel,@usersprite,@targetsprite)

And it will now work with the Elite Battle System ( If not maybe I can still help... )
 
Last edited:
79
Posts
8
Years
  • Age 26
  • Seen Jan 17, 2017
Wow thx :3 Its working with ebs now :3
Just one question.
Can I make the sprites somehow animated?
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Well After a few tries I just changed (in both v15.1 and v16.1)
for i in 0
to
for i in 1
both of them in the script and it worked.

This is working great! Thank you for the fix!

When you have some time, could you please post screenshots of how you set up the Events for the contests?

I am struggling to put an end to the contest. It keeps looping. The contest works fine, but straight after the results screen, it starts again...
 
31
Posts
8
Years
Have you looked at the Complete Zipped Version(includes everything) ?
I didn't need to do anything with those events.
You can copy and paste them into your game project.
All I did was copy the Contest Hall map and Fixed the Tileset in the Database.
Then made sure the Transfer Player locations was right.
But as far as when the finish of the contest happens after the Text: Announcer says congrats to the winner it should have Set Move Route to take the player out of the contest hall.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Oh, thank you very much!

Okay it is working now. A last question is, by chance, did you find a way to include the contest condition screen in the script? I don't think it is by default:

200px-Condition4.png
 
155
Posts
9
Years
  • Age 31
  • Seen Jun 11, 2021
Speaking of contest condition screen, I also wouldn't mind a functioning Pokeblock case. I even made a layout for it.
tOc58Oq.png

It just needs to be scaled up 200x200 for use with Essentials. I'd code it myself, but I don't really have the skills to do so. I tried editing the bag into a functioning Pokeblock case, and that ended horribly.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
This error message pops up sometimes (15.1) after using a move during the contest:

Exception: TypeError
Message: Section173:1354:in `[]'no implicit conversion from nil to integer
***Full script:
pbContest(50,PBSpecies::AMPHAROS,20,PBSpecies::INFERNAPE,20,PBSpecies:: SLAKING,30,1)


Interpreter:243:in `pbExecuteScript'
Contest Main:1354:in `pbFunctionsAdjustHearts'
Contest Main:1353:in `each'
Contest Main:1353:in `pbFunctionsAdjustHearts'
Contest Main:316:in `pbTurn'
Contest Main:122:in `pbStartContest'
Contest Main:2482:in `pbStartContest'
Contest Main:2493:in `pbContest'
(eval): 1:in `pbExecuteScript'
Interpreter:1606:in `eval'

Interpreter:276:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
QuickSave:26:in `main'
 
31
Posts
8
Years
Alright I know what is going on.
The error hit because it was looking for a message that doesn't exist.
So if you get messages like that you need to look at what move caused it.
So it was Infernape with the move taunt.
well in contestmoves.txt you will see it's function code of 017.
Then all you need to do is go to the Main Contest script and add to
Code:
when 17
Kernel.pbCustomMessage(_INTL("\\l[3]It tried to make the other Pokemon nervous!"),"Graphics/Pictures/Contest/choice 29",newx=nil,340) 
if @currentpos==1
And the error should go away.
(feel free to change the text to what you want)
 
Last edited:
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Thank you for the reply!

I understand your reasoning. However I have this in the Main Contest script, so the message it is looking for does already exist:

Code:
when 17
    if @currentpos==1
       for j in 1..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==2
        for i in 2..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[3].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[3]=true
       end
       pbNervousGraphic
 
31
Posts
8
Years
Thank you for the reply!

I understand your reasoning. However I have this in the Main Contest script, so the message it is looking for does already exist:

Code:
when 17
    if @currentpos==1
       for j in 1..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==2
        for i in 2..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[3].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[3]=true
       end
       pbNervousGraphic

Yes but when I changed that to:
Code:
  when 17
    Kernel.pbCustomMessage(_INTL("\\l[3]It tried to make the other Pokemon nervous!"),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
    if @currentpos==1
       for j in 1..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==2
        for i in 2..3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[j].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[j]=true
       end
     elsif @currentpos==3
    Kernel.pbCustomMessage(_INTL("\\l[3]{1} became nervous.",@pokeorder[3].name),"Graphics/Pictures/Contest/choice 29",newx=nil,340)
         @nervous[3]=true
       end
       pbNervousGraphic

It worked fine with no more problems for me.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Thank you, it looks like it's working! I wonder if it isn't because the code as it is doesn't envisage "if @currenpos==4".
 
31
Posts
8
Years
Well I am trying to help as I learn so np. I am happy to help.
I just wish it could have been updated and not have to struggle with it lol.
But I think it is because it isn't taking in the current position of pokemon in some areas of the code.
Well as long we can find them and find the work around. I am just happy it does work.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Another question, are the "stars" working correctly in your version? Did you make any change to the stars system?

The game does not display them at any time during the contests, yet I have the correct graphics in the Pictures folder.
 
31
Posts
8
Years
Another question, are the "stars" working correctly in your version? Did you make any change to the stars system?

The game does not display them at any time during the contests, yet I have the correct graphics in the Pictures folder.

Yes the stars do work and I have seen it happen in the Cool Contest with Gary's Butterscortch when "Butterscortch really caught the judges attention!" and I have noticed that not all the moves are listed in the Combos at the bottom of the Main Contest script.

could someone explain how to make this work for version 16.1?

Just do the first part.
And you can get the demo downloaded and just open it up.
Copy and paste the map from the window in the bottom left.
Then just fix the tileset to match.
Open the Contest Lady event and use extendtext.exe to fix:
script pbChoosePokemon(36,2,proc {|poke|!
poke.isEgg? && !(poke.isShadow? rescue false) && !poke.hasRibbon?(4)}) for each contest.
Just make sure from "poke.isEgg? && !(poke.isShadow? rescue false) && !poke.hasRibbon?(4)})" is on one line.
(and change poke.egg? to poke.isEgg?)
(forgot I did this step)
Then open the Berry Mixer script and change both
for i in 0...PBItems.maxValue
to
for i in 1...PBItems.maxValue
(the other one doesn't matter)

After that then let me know how it went.
 
Last edited:

mewlover22

Pokemon Creator
455
Posts
15
Years
Yes the stars do work and I have seen it happen in the Cool Contest with Gary's Butterscortch when "Butterscortch really caught the judges attention!" and I have noticed that not all the moves are listed in the Combos at the bottom of the Main Contest script.



Just do the first part.
And you can get the demo downloaded and just open it up.
Copy and paste the map from the window in the bottom left.
Then just fix the tileset to match.
Open the Contest Lady event and use extendtext.exe to fix:
script pbChoosePokemon(36,2,proc {|poke|!
poke.isEgg? && !(poke.isShadow? rescue false) && !poke.hasRibbon?(4)}) for each contest.
Just make sure from "poke.isEgg? && !(poke.isShadow? rescue false) && !poke.hasRibbon?(4)})" is on one line.
(and change poke.egg? to poke.isEgg?)
(forgot I did this step)
Then open the Berry Mixer script and change both
for i in 0...PBItems.maxValue
to
for i in 1...PBItems.maxValue
(the other one doesn't matter)

After that then let me know how it went.

I will later on im not currently working on the games i making right now because of the news of the new games.
 
Back
Top