• 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.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Pokemon Contests and Pokeblocks [Beta]

Resource Pokemon Contests and Pokeblocks [Beta] 0.7.1

Tlozyp_Tina

Rookie
Member
Joined
Sep 16, 2023
Posts
5
Hello! First of all I want to say I'm deeply thankful for you creating this plugin! And the documentation doc has been really useful since I'm a complete novice in fangame making so I haven't gotten a grasp on anything yet, haha...
Now, please forgive the question but, which .rb document or script would I have to slightly edit to move the heart reactions for the contests?
I'm using HGSS style sprites and when testing the plugin, the heart animation in the presentation round clips ever so slightly on the NPCs, so I'd like to change the y position, but I'm unsure where I have to make such change.

Thank you for your hard work!
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
Hello! First of all I want to say I'm deeply thankful for you creating this plugin! And the documentation doc has been really useful since I'm a complete novice in fangame making so I haven't gotten a grasp on anything yet, haha...
Now, please forgive the question but, which .rb document or script would I have to slightly edit to move the heart reactions for the contests?
I'm using HGSS style sprites and when testing the plugin, the heart animation in the presentation round clips ever so slightly on the NPCs, so I'd like to change the y position, but I'm unsure where I have to make such change.

Thank you for your hard work!
In 008_Contest_Core, in the ShowCrowdHearts function, in both places where event.y is, just adjust that value as you need
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
wrigty12 updated Pokemon Contests and Pokeblocks [Beta] with a new update entry:

Update 0.7 - Berry Core and Dex requirement; Crash handling; Animated Crowd

BEFORE UPDATING ANY FILES: If you have made any edits to files related to this plugin, including movex_contest.txt in PBS or the Settings for the plugin, make sure to make a backup of those files before updating the plugin. If you copy over files to update, it will overwrite your changes.

Change Log:
  • Pokeblocks plugin now requires the...

Read the rest of this update entry...
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
wrigty12 updated Pokemon Contests and Pokeblocks [Beta] with a new update entry:

Update 0.7.1 - New animation options setting, some moved code

BEFORE UPDATING ANY FILES: If you have made any edits to files related to this plugin, including movex_contest.txt in PBS or the Settings for the plugin, make sure to make a backup of those files before updating the plugin. If you copy over files to update, it will overwrite your changes.

Change Log:
  • Added an in-game setting to allow disabling animations during a Contest.
  • Moved some code to...

Read the rest of this update entry...
 

lvl30bear

Novice
Member
Joined
Oct 7, 2022
Posts
10
Hi! I don't know if the gain pokeblock command is working?

Ruby:
Expand Collapse Copy
[2023-11-14 20:29:59 -0600]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Script error in event 5 (coords 18,11), map 19 (contest hall)
Exception: NoMethodError
Message: undefined method `color' for Pokeblock:Class

***Full script:
pbCreatePokeblock(:Red,[5,0,0,0,0])
pbGainPokeblock(Pokeblock)

Backtrace:
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `block in sortPokeblocks'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `each'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sort_by'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sort_by!'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sortPokeblocks'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:38:in `gainPokeblock'
[Pokeblocks v20.1] 007_Pokeblock_Items_and_Commands.rb:27:in `pbGainPokeblock'
(eval):2:in `execute_script'
033:Interpreter:143:in `eval'
033:Interpreter:143:in `execute_script'

Am I putting these script events in the correct order, or is something else going amiss?
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
Hi! I don't know if the gain pokeblock command is working?

Ruby:
Expand Collapse Copy
[2023-11-14 20:29:59 -0600]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Script error in event 5 (coords 18,11), map 19 (contest hall)
Exception: NoMethodError
Message: undefined method `color' for Pokeblock:Class

***Full script:
pbCreatePokeblock(:Red,[5,0,0,0,0])
pbGainPokeblock(Pokeblock)

Backtrace:
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `block in sortPokeblocks'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `each'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sort_by'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sort_by!'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:46:in `sortPokeblocks'
[Pokeblocks v20.1] 005_Pokeblock_Data.rb:38:in `gainPokeblock'
[Pokeblocks v20.1] 007_Pokeblock_Items_and_Commands.rb:27:in `pbGainPokeblock'
(eval):2:in `execute_script'
033:Interpreter:143:in `eval'
033:Interpreter:143:in `execute_script'

Am I putting these script events in the correct order, or is something else going amiss?
Can you show me what event/script you're calling this in? color is definitely a function of the Pokeblock class.

If your event looks something like this:
1700021744653.png

Then your problem is you're passing "Pokeblock" which isn't defined. You need to either set it up assigning the pokeblock you created to a variable and pass that, like this:
1700021827737.png

Ruby:
Expand Collapse Copy
block = pbCreatePokeblock(:Red,[5,0,0,0,0])
pbGainPokeblock(block)

Or you just stick in the pbCreatePokeblock command directly into the pbGainPokeblock, like this:
1700021880211.png

Ruby:
Expand Collapse Copy
pbGainPokeblock(pbCreatePokeblock(:Red,[5,0,0,0,0]))
 
Last edited:

lvl30bear

Novice
Member
Joined
Oct 7, 2022
Posts
10
Can you show me what event/script you're calling this in? color is definitely a function of the Pokeblock class.

If your event looks something like this:
View attachment 22643
Then your problem is you're passing "Pokeblock" which isn't defined. You need to either set it up assigning the pokeblock you created to a variable and pass that, like this:
View attachment 22644
Ruby:
Expand Collapse Copy
block = pbCreatePokeblock(:Red,[5,0,0,0,0])
pbGainPokeblock(block)

Or you just stick in the pbCreatePokeblock command directly into the pbGainPokeblock, like this:
View attachment 22645
Ruby:
Expand Collapse Copy
pbGainPokeblock(pbCreatePokeblock(:Red,[5,0,0,0,0]))
this works! It was a problem of it not being formatted correctly (and in two scripts)
It might be worth putting this as a example in the documentation because I didnt know you had to define what (block) meant, or that I could do the last event in that order, though that might be a reading comprehension problem from me
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
this works! It was a problem of it not being formatted correctly (and in two scripts)
It might be worth putting this as a example in the documentation because I didnt know you had to define what (block) meant, or that I could do the last event in that order, though that might be a reading comprehension problem from me
I went back and read through my documentation when writing out my steps to help you, and I agree an example would be great to include. I'll do so in the next update!
 

lvl30bear

Novice
Member
Joined
Oct 7, 2022
Posts
10
Is there currently a way to have a event know if it won the last contest or not? Not in the way that the posters do it, but if I have a trainer be included in the next contest, is there a array or variable that tracks if said trainer won or lost(or at least not first, or below in ranking to the player)? If there is, how would I go about including it? I want a trainer to reference if they lost in the next contest they are included in, and reward a item if they lost to the trainer, or gloat that they won. If its not possible, then thats ok!
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
Is there currently a way to have a event know if it won the last contest or not? Not in the way that the posters do it, but if I have a trainer be included in the next contest, is there a array or variable that tracks if said trainer won or lost(or at least not first, or below in ranking to the player)? If there is, how would I go about including it? I want a trainer to reference if they lost in the next contest they are included in, and reward a item if they lost to the trainer, or gloat that they won. If its not possible, then thats ok!
pbGetLastContestWinner would be the closest that exists right now. The array it returns includes the trainer object that won. So you could do pbGetLastContestWinner[0] to get a trainer object and then check it. Or, if you wanted to just look at the name, you could do something like pbGetLastContestWinner(namesOnly: true)[0] == "Ash"
 

lavendersiren

Mage of Light
Member
Joined
Apr 17, 2023
Posts
9
Alright, I'm going to try getting this to work in v21 because I have the time for it and want to add contests to my new game anyways.

- First of all, the initial error is in regards to Struggle. According to the changelog for v21, struggle was removed from moves.txt.
After that was removed, I was able to testplay without instant errors.
  • libpng complained about the srgb profile of a bunch of stuff in the output window, though that seems of relatively low concern.
  • However, upon starting up the berry blender, the game takes a very very long time to do the countdown.
I later found out that pbwait was recently changed to use seconds instead of frames in v21, which forced me to change all the wait times.
- I ran into some issues regarding a change in how the UI stuff is now in its own folder in v21. To remedy that, I pasted the summary pictures into the Bag folder under UI. The reminder stuff had a significantly different file name structure than the rest.

  • Also, where is crowd_animated? That particular asset was just straight-up missing.
  • The current issue I'm stuck at is during the appeal section, which has a really long wait before the animation for a move takes place, but I can't find the pbWait associated with waiting for a move, and there's an issue with pbWaitCrowd still being frames-based, though that might just be sloppy conversion on my part.
  • Another thing, the prebaked move event stuff needs to be in all-caps rather than title caps.

Hopefully this covers enough to be useful.
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
550
Alright, I'm going to try getting this to work in v21 because I have the time for it and want to add contests to my new game anyways.

- First of all, the initial error is in regards to Struggle. According to the changelog for v21, struggle was removed from moves.txt.
After that was removed, I was able to testplay without instant errors.
  • libpng complained about the srgb profile of a bunch of stuff in the output window, though that seems of relatively low concern.
  • However, upon starting up the berry blender, the game takes a very very long time to do the countdown.
I later found out that pbwait was recently changed to use seconds instead of frames in v21, which forced me to change all the wait times.
- I ran into some issues regarding a change in how the UI stuff is now in its own folder in v21. To remedy that, I pasted the summary pictures into the Bag folder under UI. The reminder stuff had a significantly different file name structure than the rest.

  • Also, where is crowd_animated? That particular asset was just straight-up missing.
  • The current issue I'm stuck at is during the appeal section, which has a really long wait before the animation for a move takes place, but I can't find the pbWait associated with waiting for a move, and there's an issue with pbWaitCrowd still being frames-based, though that might just be sloppy conversion on my part.
  • Another thing, the prebaked move event stuff needs to be in all-caps rather than title caps.

Hopefully this covers enough to be useful.
Yep, the frame changes with pbWait was one of the biggest reasons I've put updating this off.

Libpng errors are benign. I never used to make sure they were corrected, but I started doing so with my more recent plugins

I thought I re-uploaded the zip file with the crowd_animated file.. it was reported to be missing a while ago. I'll have to double check tonight.

Thanks for the list though, if/when I ever get around to updating it, it's nice to have that investigation already!
 

lavendersiren

Mage of Light
Member
Joined
Apr 17, 2023
Posts
9
Okay, I got everything in the contest scene working without crashes now!
In move_functions, I found a bunch of wtnp[30]'s, which were the cause of the extra long pauses. I mass converted them to wtnp[0.3] and now things are so much quicker.
Something of note is I'm getting these sorta messages:
Exception `RangeError' at [Pokemon Contests Script] 008_Contest_Core.rb:302 - "40540" is recycled object
Not sure what that means, especially since line 302 just has @viewport.dispose on it.

In regards to pokeblocks, I wound up getting an error during berry blender with the gym leaders in the contest lobby, with Lite Blue being an unknown ID? I was able to blend an olive pokeblock just fine.

One thing for sure, I am so glad that notepad++ has such good search and replace tools. It definitely made things easier for me.
 

GratefulTrainer

Rookie
Member
Joined
Oct 17, 2024
Posts
1
Hi! Thanks for updating and maintaining this script!

I'm playing around with the sample project and trying to understand the required methods and generally getting to know how plugins work (as opposed to scripts). I can use the berry blender and it consumes berries but how do I view the resulting items in inventory, consume them, and view pokeblock effects on my pokemon in the sample project? I don't see any resulting items in Red's inventory after playing the berry blending minigame.
Found it! I could just add an event to the sample map with script "pbPokeblockKit()" to trigger the kit for pokeblock UI.
 
Last edited:

dragonice11259

Rookie
Member
Joined
Nov 28, 2024
Posts
2
I have a problem wanting to adapt this to my version 21 of essentials, when the contest ends and the tape is received, I get an error on the line 71 aprox
$stats.pokemon_contests_won_total += 1 it says that is not defined, but when i set it to =0 and then =1 it has no problem, how can i fix this to work normally?
 
Back
Top