The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Script Pokétch for Pokémon Essentials

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old October 18th, 2017 (5:42 AM). Edited November 30th, 2017 by Marin.
Marin's Avatar
Marin Marin is offline
Not Bored
  • Moderator
 
Join Date: Nov 2016
Location: The Netherlands
Gender: Male
Nature: Bashful
Posts: 608
Want to help out? I need sound effects for the Pokétch (pretty much everything ranging from button presses to the sound effects in the matchup checker. That sort of things)

You know that thing on your bottom screen in generation 4 (Sinnoh)? That's a Pokétch, or Poké Watch. I thought it'd be funny to try to replicate that in Pokémon Essentials, so that's what I did.

It supports both dual-screen and single-screen, though dual-screen is what it was initially designed for.

This Pokétch currently has a grand total of 23 apps:
  • Clock
  • Clicker
  • Calculator
  • Pedometer
  • Itemfinder
  • Move Tester
  • Rotom (custom)
  • Marking Map
  • Matchup Checker
  • Party
  • Color Changer
  • Kitchen Timer
  • Analog Watch
  • Stat Display (custom)
  • Roulette
  • Day Care Checker
  • Pokémon History
  • Calendar
  • Coin Flip
  • Stopwatch
  • Notepad (custom)
  • Alarm Clock
  • Safari Helper (custom)



Credits
  • Marin
  • Modeling Clay (Sprites for Rotom, Stat Display, and Safari Helper)
  • Luka S.J. (For his Easy Mouse System)




Installation
You'll need to install Luka S.J.'s Easy Mouse System from the Universal Plugin Installer

There are three script sections you'll need to grab:
Pokétch_Main
Pokétch_Utility
Pokétch_Apps
Make sure to put these in new sections above Main, like so:


Next, download the Graphics pack and put it under Graphics/Pictures/Poketch:
Download Graphics

The Roulette app also requires RPG.Net. If you want to be able to use Roulette, you must install this dll and put it into your main, root folder:
RPG.Net.dll



Dual-screen Usage
You will first need to set DEFAULTSCREENHEIGHT in Settings to 768, which is double the normal height (384 * 2).

The script is configured for dual-screen by default. If you don't have the Pokétch, a background will be chosen (the path is in Pokétch_Main, NO_POKETCH_BACKGROUND).
You can also have to define where on the vertical axis the Pokétch will be. By default, this is right underneath the first screen, meaning at a Y value of 384. This is POKETCH_Y in Pokétch_Main.
To actually tell the script that you're using dual-screen, you need to have DUAL_SCREEN in Pokétch_Main set to true.

Now to actually gain ownership of the Pokétch, you simply need to do pbObtainPoketch. By default, this will enable the Clock, Clicker, Calculator, and Analog Watch. You can change this by going in def pbObtainPoketch(animate = true) and changing the pbEnableApp in there.

To take away the Pokétch (and show the no_poketch_background again), you can call pbTakePoketch. This will not disable or enable any apps, but just take away the Pokétch.

IMPORTANT: Dual-screen Pokétch will likely have broken your battle system in terms of Pokémon positioning. To fix this, you'll need to fiddle around with Y values in PokeBattle_SceneConstants.





Single-screen Usage
Using the Pokétch with one screen is also an option. To configure it for single-screen, follow these steps:
  • Set DEFAULTSCREENHEIGHT in Settings to the normal height, 384.
  • Set DUAL_SCREEN in Pokétch_Main to false
  • Set POKETCH_Y in Pokétch_Main to 0
You now have a proper, normal game. The Pokétch is not running in the background anymore.
To call the Pokétch (from something like a pause menu or hotkey), call pbPoketch. This will open up the Pokétch.





General Usage
Each and every Pokétch app can be enabled and disabled. The methods behind this are:
pbEnableApp(app_id)
pbDisableApp(app_id)


You might be wondering, what's this app_id about?
Every Pokétch app has an ID. You could look this up manually in module PoketchApps and fill in the ID you found for your app, but you could also do PoketchApps::appname.
Let's say you want to get the ID of the Pokémon History app, you would do PoketchApps:oketchPokemonHistory. All classes for Pokétch apps I wrote start with Poketch, but that's not a requirement. Spaces aren't allowed, and I didn't use any special characters (such as é).

If you want to enable or disable everything, you can use one of the following methods:
pbEnableAll
pbDisableAll


If you're using Dual-screen mode, you have the ability to force switch to an app by using pbChangeApp(app_id). This bypasses availability and usability, which means that it will switch to this app even if it's disabled, and even if the conditions that might be given in the class aren't met.





Documentation on the apps

Apps in general
Every app inherits from PoketchApp. This class creates the @viewport Viewport and @bg background Sprite in its constructor, def initialize.
Every Pokétch App must call super in its constructor first.
If the app uses click?, it must call super in def update.
Every Pokétch App should call super LAST in def dispose. This disposes @bg and @viewport.

If you want an app only to usable under certain conditions (on top of whether or not the app is enabled/disabled), you can add a method def self.usable?, which should return a boolean (true/false).
  • Clock: This app will show the computer's time. It will refresh whenever it detects the hour or minute has changed since the last time it refreshed. The method that refreshes the app is draw_time.
  • Clicker: This app allows you to click on a button for a variable to be incremented with one for every button press. $PokemonTemp.click_count stores the click count, because it doesn't need to go into the save file, and the variable resets whenever you switch apps, so the PokemonTemp class was fine.
  • Calculator: Yeah, I don't fancy talking about this one. All I can say is that it's one big, working mess.
  • Item Finder: Every event with .hidden in its event name will be picked up by the Itemfinder, if the event isn't unlisted.
    To unlist an event, meaning that it won't be picked up by the itemfinder, use pbUnlist(event_id).
    To list an event, meaning that it will be picked up by the itemfinder, use pbList(event_id). Every event is listed by default (if it has .hidden in the name).
  • Rotom: You can specify messages the Rotom in this app will say to you. For documentation on the methods, please refer to class PoketchRotom in Pokétch_Apps.
  • Move Tester: Allows you to test type effectiveness. Pseudo types are ignored (?????, for example).
  • Pedometer: Counts your steps in variable $Trainer.steps. Adds a proc to Events.onStepTaken to increase the step count.
  • Marking Map: Allows you to drag and drop markings on the map. If you click the sprite, it'll be selected and follow your mouse around. If you click somewhere, it'll go there and be seen as unselected and no longer follow your mouse.
  • Matchup Checker: Only usable if you have 2 or more Pokémon in your party. Checks how well they would breed together. Clicking one of the icons picks the next slot in the Party and plays its cry. You can't check a Pokémon against itself.
  • Party: Shows you your whole party. Shows HP (and fainted), and an item icon if they have an item. Clicking a Pokémon plays their cry.
  • Color Changer: Adds a colored overlay over the screen.
  • Kitchen Timer: Counts down every Graphics.update call.
  • Analog Watch: Display current time. See def position for the formula.
  • Stat Display: Shows you each party member's EVs and IVs. Plays its cry upon switching.
  • Roulette: Only usable if you downloaded RPG.Net.dll.

    You can draw in the circle. If you hit play, it'll spin until you click stop. Clear your drawings with the C button.
  • Day Care Checker: Shows you your Pokémon in the day care. If there's an egg, it'll display it.
  • Pokémon History: Every Pokémon that evolves, is traded, caught, or is hatched, is registered in $Trainer.pokemonhistory. It displays the latest 12 and plays the cry if you touch a Pokémon.
  • Calendar: It's a calendar. The current month has a box around it, and you can mark dates by clicking on them. Does support leap years.
  • Coin Flip: Magikarp or ball. Heads or tails. Flip the coin by clicking on it.
  • Stopwatch: Counts up every Graphics.update.
  • Notepad: As the Memo Pad doesn't appear to be realizeable, I made a notepad instead. You can use your keyboard to write on it. These characters are supported:
    Code:
    AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz
    0123456789)[email protected]#$%^&*(-_=+,<.>/?'"[{]};:`~\|
    You can write if the button is pressed. If it is pressed, you cannot walk or do anything other than write, switch apps, or click the button again to stop writing.
  • Alarm Clock: Goes off at the time you specify. It'll go off for the whole minute, unless you turn it off.
  • Safari Helper: Only usable while in the Safari Zone. It displays the amount of balls you have and the amount of steps you have left. You can also end the safari zone game with it.


Feeling like making your own app?
I hope you'd be able to figure it out by reading the top of Pokétch_Apps and Pokétch_Utility.
If you have made your own app and feel like sharing, please feel free to leave your creations in this thread!
__________________
Reply With Quote

Relevant Advertising!

  #2    
Old October 18th, 2017 (11:52 AM).
Marin's Avatar
Marin Marin is offline
Not Bored
  • Moderator
 
Join Date: Nov 2016
Location: The Netherlands
Gender: Male
Nature: Bashful
Posts: 608
Fixed a couple bugs with apps here and there. If you'd installed it already, make sure to update.
__________________
Reply With Quote
  #3    
Old October 18th, 2017 (11:49 PM). Edited October 20th, 2017 by Soccersam.
Soccersam's Avatar
Soccersam Soccersam is offline
#Hilbert is Badass
     
    Join Date: Oct 2016
    Gender: Male
    Nature: Hasty
    Posts: 56
    Quote:
    Originally Posted by Marin View Post
    Fixed a couple bugs with apps here and there. If you'd installed it already, make sure to update.
    Thanks a lot! This just opened up a whole lot more options for my game!

    EDIT: Poketch_Utilities Script link doesn't work
    __________________
    Pokemon Emerald Adventures
    Coming Soon
    Reply With Quote
      #4    
    Old October 21st, 2017 (3:51 AM).
    Marin's Avatar
    Marin Marin is offline
    Not Bored
    • Moderator
     
    Join Date: Nov 2016
    Location: The Netherlands
    Gender: Male
    Nature: Bashful
    Posts: 608
    Fixed it. Apparently posts there only last two days or something.
    __________________
    Reply With Quote
      #5    
    Old October 22nd, 2017 (12:03 AM).
    Soccersam's Avatar
    Soccersam Soccersam is offline
    #Hilbert is Badass
       
      Join Date: Oct 2016
      Gender: Male
      Nature: Hasty
      Posts: 56
      For some reason, it gives me this error

      ---------------------------
      Pokemon Essentials
      ---------------------------
      Script 'Poketch_Apps' line 42: TypeError occurred.

      undefined superclass `PoketchApp'
      ---------------------------
      OK
      ---------------------------
      __________________
      Pokemon Emerald Adventures
      Coming Soon
      Reply With Quote
        #6    
      Old October 22nd, 2017 (2:14 AM).
      Marin's Avatar
      Marin Marin is offline
      Not Bored
      • Moderator
       
      Join Date: Nov 2016
      Location: The Netherlands
      Gender: Male
      Nature: Bashful
      Posts: 608
      Quote:
      Originally Posted by Soccersam View Post
      For some reason, it gives me this error

      ---------------------------
      Pokemon Essentials
      ---------------------------
      Script 'Poketch_Apps' line 42: TypeError occurred.

      undefined superclass `PoketchApp'
      ---------------------------
      OK
      ---------------------------
      Install it properly. You didn't get Pokétch_Utility or you didn't insert the scripts in the proper order. There's even a screenshot...
      __________________
      Reply With Quote
        #7    
      Old October 22nd, 2017 (3:20 AM).
      Soccersam's Avatar
      Soccersam Soccersam is offline
      #Hilbert is Badass
         
        Join Date: Oct 2016
        Gender: Male
        Nature: Hasty
        Posts: 56
        Quote:
        Originally Posted by Marin View Post
        Install it properly. You didn't get Pokétch_Utility or you didn't insert the scripts in the proper order. There's even a screenshot...
        Okay, you were right. I installed it in the wrong order. Now, everything's right. But it showed this error AT FIRST-

        ---------------------------
        Pokemon Essentials
        ---------------------------
        Script 'Poketch_Main' line 453: NameError occurred.

        uninitialized constant ERRORTEXT
        ---------------------------
        OK
        ---------------------------

        I got into the script editor, and found that line no.453 in Poketch_Main was-

        ERRORTEXT += "[Pokétch v1.0]\r\n" if ERRORTEXT

        So, I deleted that line, and then the game worked just fine, but when I opened the Poketch in-game, it just showed me a blank poketch screen, like this-

        Click image for larger version

Name:	Screenshot_1.png
Views:	192
Size:	18.1 KB
ID:	83534

        How do I fix this?
        __________________
        Pokemon Emerald Adventures
        Coming Soon
        Reply With Quote
          #8    
        Old October 22nd, 2017 (3:37 AM). Edited October 22nd, 2017 by Marin.
        Marin's Avatar
        Marin Marin is offline
        Not Bored
        • Moderator
         
        Join Date: Nov 2016
        Location: The Netherlands
        Gender: Male
        Nature: Bashful
        Posts: 608
        Quote:
        Originally Posted by Soccersam View Post
        Okay, you were right. I installed it in the wrong order. Now, everything's right. But it showed this error AT FIRST-

        ---------------------------
        Pokemon Essentials
        ---------------------------
        Script 'Poketch_Main' line 453: NameError occurred.

        uninitialized constant ERRORTEXT
        ---------------------------
        OK
        ---------------------------

        I got into the script editor, and found that line no.453 in Poketch_Main was-

        ERRORTEXT += "[Pokétch v1.0]\r\n" if ERRORTEXT

        So, I deleted that line, and then the game worked just fine, but when I opened the Poketch in-game, it just showed me a blank poketch screen, like this-

        Attachment 83534

        How do I fix this?
        The ERRORTEXT is a mistake on my end, but the black screen means you don't have any apps. Reinstall Pokétch_Main to fix the issue with ERRORTEXT.
        __________________
        Reply With Quote
          #9    
        Old October 22nd, 2017 (7:41 PM).
        Diegotoon's Avatar
        Diegotoon Diegotoon is offline
           
          Join Date: Feb 2015
          Gender: Male
          Posts: 13
          Hello, I work in a remake of 4gen, but, i use Pokémon Essentials BW V3.1.1
          I dont know how to implement these scripts :sob: I need help please :(
          Reply With Quote
            #10    
          Old October 23rd, 2017 (6:08 AM).
          Soccersam's Avatar
          Soccersam Soccersam is offline
          #Hilbert is Badass
             
            Join Date: Oct 2016
            Gender: Male
            Nature: Hasty
            Posts: 56
            Quote:
            Originally Posted by Diegotoon View Post
            Hello, I work in a remake of 4gen, but, i use Pokémon Essentials BW V3.1.1
            I dont know how to implement these scripts :sob: I need help please
            I think you need to set the script to dual screen?
            __________________
            Pokemon Emerald Adventures
            Coming Soon
            Reply With Quote
              #11    
            Old October 23rd, 2017 (7:25 AM).
            Diverscope's Avatar
            Diverscope Diverscope is offline
            Pardon me
               
              Join Date: Apr 2013
              Gender: Male
              Nature: Rash
              Posts: 80
              Essentials BW Mod won't work, because it's based on Essentials V15.
              __________________
              Reply With Quote
                #12    
              Old October 23rd, 2017 (7:50 PM).
              Diegotoon's Avatar
              Diegotoon Diegotoon is offline
                 
                Join Date: Feb 2015
                Gender: Male
                Posts: 13
                I solved the problem :)
                Reply With Quote
                  #13    
                Old October 24th, 2017 (2:43 AM).
                Soccersam's Avatar
                Soccersam Soccersam is offline
                #Hilbert is Badass
                   
                  Join Date: Oct 2016
                  Gender: Male
                  Nature: Hasty
                  Posts: 56
                  So, do we call the pbEnableAll script in the same command as pbPoketch? Like this-?

                  Click image for larger version

Name:	Capture.PNG
Views:	170
Size:	22.0 KB
ID:	83575

                  I tried it in game, but it didn't show me the list of various options of the Poketch, it straight away started the Poketch clock. And when I exit the clock, it exits the whole poketch altogether.

                  Sorry for being such a moron and bothering you over and over again...
                  __________________
                  Pokemon Emerald Adventures
                  Coming Soon
                  Reply With Quote
                    #14    
                  Old October 24th, 2017 (9:45 AM).
                  Marin's Avatar
                  Marin Marin is offline
                  Not Bored
                  • Moderator
                   
                  Join Date: Nov 2016
                  Location: The Netherlands
                  Gender: Male
                  Nature: Bashful
                  Posts: 608
                  Quote:
                  Originally Posted by Soccersam View Post
                  So, do we call the pbEnableAll script in the same command as pbPoketch? Like this-?

                  Attachment 83575

                  I tried it in game, but it didn't show me the list of various options of the Poketch, it straight away started the Poketch clock. And when I exit the clock, it exits the whole poketch altogether.

                  Sorry for being such a moron and bothering you over and over again...
                  You have to enable apps before opening the Pokétch. And yes, of course it'd close, because that's what the method does. Read the documentation for that.
                  __________________
                  Reply With Quote
                    #15    
                  Old 3 Weeks Ago (6:58 AM).
                  ItzStam's Avatar
                  ItzStam ItzStam is offline
                     
                    Join Date: Dec 2017
                    Posts: 1
                    I just installed the scripts into my game, and wanted to test them out. But when I ran the script to give me the Poketch in game, the Poketch screen wouldn't go away, and the only thing I could do was access the pause menu. So I tried going to my bag, but the clock app, which was the first thing that opened, overlayed on top of the bag menu.

                    I don't know if I installed something wrong or messed with the settings so any help would be appreciated.
                    Reply With Quote
                      #16    
                    Old 3 Weeks Ago (1:05 AM).
                    LucarioTheGreat's Avatar
                    LucarioTheGreat LucarioTheGreat is offline
                       
                      Join Date: Jan 2018
                      Posts: 3
                      Hello,
                      Marin, I think this script is very sweet! It will help a lot of people.
                      I just want to ask when you said 'dual screen' is what this is designed for, I immediately thought of Essentials BW. However, after reading the comments, I found out that Essentials BW will not support this.
                      So, what are the other 'dual screen' engines for pokemon? I do not seem to be able to find any more...
                      __________________
                      I am still learning!
                      Reply With Quote
                      Reply

                      Quick Reply

                      Join the conversation!

                      Create an account to post a reply in this thread, participate in other discussions, and more!

                      Create a PokéCommunity Account

                      Sponsored Links
                      Thread Tools

                      Posting Rules
                      You may not post new threads
                      You may not post replies
                      You may not post attachments
                      You may not edit your posts

                      BB code is On
                      Smilies are On
                      [IMG] code is On
                      HTML code is Off

                      Forum Jump


                      All times are GMT -8. The time now is 2:27 AM.