• 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.
  • Apologies if you've had troubles connecting to the site, you may need a VPN to access it. Staff are also facing issues connecting, so if it's urgent please message Cat on-site or through Discord directly.
  • Hey Guest, staff applications are open! If you are interested in becoming a forum staff member and/or Discord staff member, please apply through this Google Form before April 2! You can also message Cat with any questions.

Idea Just dance plugin

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
59
I'm trying to create a Just Dance mini game, but I'm having a lot of problems.

The mini game would work as follows: calling pbDanceGame(ID, Speed) would start the plugin, which would open a simple interface with the sequence name and then a countdown, after which the mini game would begin. For example, calling pbDanceGame(1, 1) would use sequence 1 with its respective name and a speed of 1, which is normal speed, though any value can be used here.

The basic mechanics of the mini game are working, and by downloading this file, you can test and see the problems I'm having.

  1. The interface opens abruptly, and I can't create a fade-in and fade-out transition; it just opens, runs the mini game, and closes.
  2. Along with the transitions, I'm trying to add sounds for entering and exiting the mini game: a sound effect for entering and a closemenu sound effect for exiting, but that's not working either.
I tried to create most of it on my own, modifying some things from other plugins and asking for help from ChatGPT (which I don't recommend). ChatGPT has introduced 30 different problems into the mini game.

In the old RC, there was a thread explaining how methods work and how to create a scene or UI, but I couldn't find that post here.

I would like to ask for help to get this mini game working, as I had the idea to use it in a Fairy-type gym where the player would have a dance competition with an NPC. If the player fails too much, they would end up in a battle against the NPC.

My strong suits are not English or programming; I handle tilesets and sprites better (I'm also preparing a tileset pack to share).

The images I am using here are not of my own creation but are only placeholders for the development of the plugin.


Sorry if there are any inconsistencies or if it is confusing; I don't speak English and I'm translating everything.
 
Last edited:

Atlat

Novice
Member
Joined
Jan 8, 2023
Posts
36
My #1 rule of using ChatGPT to help with code is to use it as a base to help give you a general idea of where to go, and then scrap about half of it as it has that many problems.

On a slightly more serious note, here are some tricks that may help here.

First, regarding the fading, take a look at UI_PauseMenu. There is this code:
pbFadeOutIn do
CODE
end
I tried putting it around your function and it... sort of worked. Only a little, honestly. You could take a look here (def pbFadeOutIn(z = 99999, nofadeout = false)) and implement some of that code within your code. However, I'm not particularily confident on that.

Next, go to Audio_Play and head to the very bottom. There are functions down there that call certain sound effects. You can even make your own quite easily since they aren't in any class.

Finally, there's the variable stuff. First, I would suggest adding an s to the end of @current_move, though that's more my hyperfixation on consistency than anything else. More importantly, the variables seem to be working perfectly fine. If you want to check for a 100% score rating, just check if @correct_moves == @current_move. Honestly, you really don't even need @error_moves since that's basically just current - correct. You check to see if the number of incorrect moves exceeds a certain number (how many misses you allow), and if it does you battle a trainer.

Now, if you want to do that in an event, I would just suggest saving the scores to game variables and then doing what I said above, but with those game variables instead of @correct_moves and the like.
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
325
The way that you did a fade out/fade in are pretty different from standard Essentials scene structures. I suggest looking at my Diploma (and how to do a simple scene) script and try to use some more standard ways of doing scenes:

Basically, to fade out and fade in the map scene, I put the script call in
Ruby:
Expand Collapse Copy
pbFadeOutIn(99999) {
    scene = DiplomaScene.new
    screen = DiplomaScreen.new(scene)
    screen.pbStartScreen(main_text, image_path)
}
To fade in/out the scene sprites, in scene start, after creating the sprites I call 'pbFadeInAndShow(@sprites) { update }'. And at scene end I call 'pbFadeOutAndHide(@sprites) { update }'.
 

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
59
The way that you did a fade out/fade in are pretty different from standard Essentials scene structures. I suggest looking at my Diploma (and how to do a simple scene) script and try to use some more standard ways of doing scenes:

Basically, to fade out and fade in the map scene, I put the script call in
Ruby:
Expand Collapse Copy
pbFadeOutIn(99999) {
    scene = DiplomaScene.new
    screen = DiplomaScreen.new(scene)
    screen.pbStartScreen(main_text, image_path)
}
To fade in/out the scene sprites, in scene start, after creating the sprites I call 'pbFadeInAndShow(@sprites) { update }'. And at scene end I call 'pbFadeOutAndHide(@sprites) { update }'.
So, I saw that the way I was doing it was quite different from the Essentials standards, but I tried a few times and didn’t succeed. After almost a year, I went back to working on this plugin, determined to make changes, and I saw your post. That’s why I asked for help—I knew you would help me. I finally understood how it works, although I still need to refine some things. My plugin turned out like this thanks to you:



Sorry for my English, the little I used is not good enough for me to write, I can only read, so I use the translator.

Again, I want to thank you very much, for managing to do something that I had been trying for months, sometimes a silly thing can make us very unmotivated to continue using Pokemon Essentials, I thank you very much, my plugin is almost ready to publish, just a few small details are missing.
 
Back
Top