• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Essentials Tutorial] Pokémon: Essentials coding 101

Rai Rai

Master of everything!
  • 261
    Posts
    14
    Years
    • Seen Aug 29, 2012
    Well, today I announce myself here to give all of you game developers the basics of coding within Essentials. The main aim is to teach those how to make a simple window script with the day to day functions many other developers out there use to make their menus have that extra touch.
    Enjoy.
    Ps. If you want the code to keep reference without having to keep coming back here, I've put it in at the bottom of the thread.
    Made a mistake on the code, on the last end of the code delete it, that will fix the error I made.
    [PokeCommunity.com] Pokémon: Essentials coding 101

    Spoiler:
     
    Last edited:
    I'd have to be a downer, but there are quite a few thigs up there which would either give you a syntax error or an unwanted result. Good try though, the code is really clean. Now onto the fixes:

    1. Quite an easy mistake to do with @frame. You started performing math functions without defining the variable. You first need to put @frame=0 somewhere before the update starts.

    2. No text will be drawn as you forgot to place pbDrawText after textpositions have been defined, not to mention the lack of @overlay.clear to refresh the text.

    3. The 51.times do command will not make the opacity go up smoothly, instead it will be filled in one frame, as there should be a pbWait(1) command before the end, that will make the whole function ladt 51 frames. Plus since it's in a loop, that function will repeat infinately, freezing your game, which is not what you want.

    4. I have no idea what you put @frame in there for as it just resets when it reaches a number, don't know if that was intentional.

    That's all I can see wrong/inaccurate for now.
     
    I'd have to be a downer, but there are quite a few thigs up there which would either give you a syntax error or an unwanted result. Good try though, the code is really clean. Now onto the fixes:

    1. Quite an easy mistake to do with @frame. You started performing math functions without defining the variable. You first need to put @frame=0 somewhere before the update starts.

    2. No text will be drawn as you forgot to place pbDrawText after textpositions have been defined, not to mention the lack of @overlay.clear to refresh the text.

    3. The 51.times do command will not make the opacity go up smoothly, instead it will be filled in one frame, as there should be a pbWait(1) command before the end, that will make the whole function ladt 51 frames. Plus since it's in a loop, that function will repeat infinately, freezing your game, which is not what you want.

    4. I have no idea what you put @frame in there for as it just resets when it reaches a number, don't know if that was intentional.

    That's all I can see wrong/inaccurate for now.

    Heh yeah, was pretty late at the time of doing it XD. I'll change up all the errors once I get back tonight. Was a 5 minute whip up type thing cause I was asked questions :P.
     
    Back
    Top