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

I broke the Pokémon capture system

Peeky Chew

Master of Palettes
829
Posts
14
Years
  • For my game I changed the entire menu system and the layouts of the battles. Somewhere along the way I must have changed something essential, as capturing Pokémon is now not possible. You can still be given them, but when you throw a Poké ball, it'll say you've caught it, go to the background for the description page, and then just end the battle. The 'mon won't appear in your party or Poké box.

    So I was wondering if anyone knows which script I've edited, and it possible, where. I can upload my scripts if that would help. And I'm using the January 2010 version by the way.
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Unfortunately, I don't know what to tell you what you changed, and I'm pretty sure no one will. If you don't know what script you edited that caused it, or what you changed, there's nothing we can do.

    With that said, I'm guessing you probably changed something in Pokebattle_ActualScene, did you? If you made any code changes you may have done something that created a logical error, since from my experience the battle system doesn't normally crash from that. Again, I can't tell you what you might've done, but it's just a thought.
     

    xdanx

    But you can call me Dan :)
    42
    Posts
    19
    Years
    • Seen Jul 25, 2012
    You could start thinking exactly what scripts did you edited (you can check what are each one of them for and see which battle/capture related scritps you modified) and then compare them with the original scripts.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    Try looking at the end of def pbThrowPokeBall, in the script section PokeBattle_Battle. Compare it with a clean version of Essentials to see what's changed. That's the part that shows the Pokédex entry and stores the Pokémon.

    That's all I can suggest. "I've changed the scripts" is incredibly unhelpful.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • Thanks for all of the help guys, but unfortunately it wasn't in any of those scripts. To fix it I've had to simply replace all of the scripts are work backwards to get the scripts I needed back in.

    For some reason I now have another error. When I try to run the game as an application outside of RMXP, it opens, plays the title screen music, but just shows black and you can't continue. Is there any specific reason this would happen, because all of the scripts I'm now using are either clean or worked before.
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Thanks for all of the help guys, but unfortunately it wasn't in any of those scripts. To fix it I've had to simply replace all of the scripts are work backwards to get the scripts I needed back in.

    For some reason I now have another error. When I try to run the game as an application outside of RMXP, it opens, plays the title screen music, but just shows black and you can't continue. Is there any specific reason this would happen, because all of the scripts I'm now using are either clean or worked before.

    My first guess is that the window your game is in is not in focus. When an RPG Maker XP game is not in focus, the game intentionally stops until it is returned. In lamen's terms, click on the window and see if that fixes anything.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • My first guess is that the window your game is in is not in focus. When an RPG Maker XP game is not in focus, the game intentionally stops until it is returned. In lamen's terms, click on the window and see if that fixes anything.
    I wish it were that simple, but sadly it isn't. It's really annoying that as soon as one error is fixed an even bigger one arises.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • To answer your question Peeky, your game sounds like it is in an infinite game loop Before the title screen, look in your script to see where the infinite loop is happening, otherwise your problem will never be fixed.

    EDIT: I meant before, does your title screen show?
    To clarify, the games windows opens, shows black and plays the title screen music on a loop.

    Do you have any idea which script that would be in. Because since I just switched all of my scripts to an older back-up I can simply change the problem script to the newer one.
     

    KingCharizard

    C++ Developer Extraordinaire
    1,229
    Posts
    14
    Years
  • To clarify, the games windows opens, shows black and plays the title screen music on a loop.

    Do you have any idea which script that would be in. Because since I just switched all of my scripts to an older back-up I can simply change the problem script to the newer one.

    I have not used essentials in awhile, and yes I still think your game in in an infinite loop. Or the graphic rendered code is broken, can you press the C button or the action button and proceed past the title screen? If you cannot I still support my infinite loop theory. Look for a script named title screen or has title in the name somewhere. If your still having trouble perhaps someone who still uses essentials can be of farther help.

    Is is possible someone not only deleted my last post but edited it also? Hmm I wonder why?
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • I have not used essentials in awhile, and yes I still think your game in in an infinite loop. Or the graphic rendered code is broken, can you press the C button or the action button and proceed past the title screen? If you cannot I still support my infinite loop theory. Look for a script named title screen or has title in the name somewhere. If your still having trouble perhaps someone who still uses essentials can be of farther help.

    Is is possible someone not only deleted my last post but edited it also? Hmm I wonder why?
    I quoted out the rest, so it must have been deleted while I was writing my reply.

    Nope, neither work. I'll have a look around and also see if anyone else has an idea where the script would be or what the problem is. Thanks for your help.
     
    10,673
    Posts
    15
    Years
    • Seen Dec 30, 2023
    I have not used essentials in awhile, and yes I still think your game in in an infinite loop. Or the graphic rendered code is broken, can you press the C button or the action button and proceed past the title screen? If you cannot I still support my infinite loop theory. Look for a script named title screen or has title in the name somewhere. If your still having trouble perhaps someone who still uses essentials can be of farther help.

    Is is possible someone not only deleted my last post but edited it also? Hmm I wonder why?

    1) If you do not use Essentials, don't reply. It means you're taking a stab in the dark and it's completely unhelpful.
    2) Nobody edited your post. When you quote a post you have the option to edit what is in the quote box.
    3) Don't bother replying to this, in this thread, as you will once again be off-topic. I'm sure Peeky Chew just wanted to edit out the part where you got pretty insulting. But to let you know, a layman wouldn't know the meaning of window focus either, so you're just being wrong also.

    If you don't actually have the answer to this thread don't post. Simple as that, because taking guesses at what is wrong in an engine you do not use is really pointless.
     

    KingCharizard

    C++ Developer Extraordinaire
    1,229
    Posts
    14
    Years
  • I did not say I have not never used essentials I said I haven't in awhile. I also dont think I am wrong about the loop. To clarify about my post read below. I was simply trying to offer a solution to a problem.

    the main cause for an infinite game loop is it has no escape such as a variable is not being changed so the loop can exit. If you find your problem make sure you have not changed a variable name or it has not been changed from an older version. Remember maruno has been changing some variables and what not also im sure poccill had changed some in each new release. That is my advice on what could be causing the problem. I wish i could be of more assistance.
     
    Last edited by a moderator:

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Are you "mixing scripts", i.e, using some scripts from an older essentials and some from a newer one? That could definitely be a cause.

    If you haven't made any edits to the title screen, it's unlikely that is is an infinite loop. Still possible, since we really know nothing about what exactly Peeky Chew done at this point.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    Aside from "use a version that works" (which is a better solution than you might think), all I can offer in addition to previous comments is that perhaps you included a dual screen script. This could make the game be displaying the title screen properly, but just off-screen. It doesn't explain the unresponsiveness, though.

    The title screen is in the script section Scene_Intro, and I haven't touched it since I took over Essentials back in July 2011.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • @IceGod64: PokeBattle_ActualScene and the scripts which control the trainer card, bag, and party are all from the January 2010 version. The rest are November 2009. All I've changed apart from that is the screen res in sprite resizer, the rest are clean.

    @Maruno: I haven't installed the dual screen script. I tried replacing the Scene_Intro script with two other newer versions (which happened to be a lot longer) but each came up with an error when the game was run. Since it is such a short script I thought I'd include it here just in-case there are any glaring problems:

    Code:
    class Scene_Intro
      def main
        data_system = pbLoadRxData("Data/System")
        pbBGMPlay(data_system.title_bgm)
        @phase = "splash"
        @startphase = 0
        @frames = 0
        @image = IconSprite.new(0, 0)
        @image.setBitmap("Graphics/Titles/Pic_1")
        @image.opacity = 0
        @start = IconSprite.new
        @start.setBitmap("Graphics/Titles/Start")
        @start.y = (320 - 60)
        @start.opacity = 0
        Graphics.transition
        loop do
          Graphics.update
          Input.update
          @start.y = (320 - 19)
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @image.dispose
        @start.dispose
      end
      def update_command
        if Input.trigger?(Input::C)
          pbBGMStop()
          sscene=PokemonLoadScene.new
          sscreen=PokemonLoad.new(sscene)
          sscreen.pbStartLoadScreen
        end
      end
      def update
        if @phase == "splash"
          if @image.opacity < 250
            @image.opacity += 10
          end
          if @image.opacity == 250
            Graphics.wait(120)
            @phase = "fadeoutsplash"
          end
        elsif @phase == "fadeoutsplash"
          if @image.opacity > 0
            @image.opacity -= 10
          elsif @image.opacity == 0
            @image.setBitmap("Graphics/Titles/Pic_2")
            @phase = "title"
          end
        elsif @phase == "title"
          if @image.opacity < 250
            @image.opacity += 10
          elsif @image.opacity == 250
            @start.z = 99999
            @phase = "waitforinput"
          end
        elsif @phase == "waitforinput"
          update_command
          if @start.opacity < 255 && @startphase == 0
            @start.opacity += 10
          elsif @start.opacity > 0 && @startphase == 1
            @start.opacity -= 10
          end
          if @start.opacity == 0
            @image.update
            @startphase = 0
          elsif @start.opacity == 250
            @startphase = 1
          end
        end
      end
    end
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    @IceGod64: PokeBattle_ActualScene and the scripts which control the trainer card, bag, and party are all from the January 2010 version. The rest are November 2009. All I've changed apart from that is the screen res in sprite resizer, the rest are clean.

    @Maruno: I haven't installed the dual screen script. I tried replacing the Scene_Intro script with two other newer versions (which happened to be a lot longer) but each came up with an error when the game was run. Since it is such a short script I thought I'd include it here just in-case there are any glaring problems:

    Code:
    class Scene_Intro
      def main
        data_system = pbLoadRxData("Data/System")
        pbBGMPlay(data_system.title_bgm)
        @phase = "splash"
        @startphase = 0
        @frames = 0
        @image = IconSprite.new(0, 0)
        @image.setBitmap("Graphics/Titles/Pic_1")
        @image.opacity = 0
        @start = IconSprite.new
        @start.setBitmap("Graphics/[COLOR=Black]Titles/Start")
        [/COLOR][COLOR=Black]@start.y = (320 - 60)[/COLOR]
        @start.opacity = 0
        Graphics.transition
        loop do
          [COLOR=Red]update[/COLOR]
          Graphics.update
          Input.update[COLOR=Black]
          [COLOR=Red]update_command[/COLOR]
          [/COLOR][COLOR=Black]@start.y = (320 - 19)[/COLOR]
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @image.dispose
        @start.dispose
      end
    
      def update_command
        if Input.trigger?(Input::C)
          pbBGMStop()
          sscene=PokemonLoadScene.new
          sscreen=PokemonLoad.new(sscene)
          sscreen.pbStartLoadScreen
        end
      end
    
      def update
        if @phase == "splash"
          if @image.opacity < 250
            @image.opacity += 10
          end
          if @image.opacity == 250
            Graphics.wait(120)
            @phase = "fadeoutsplash"
          end
        elsif @phase == "fadeoutsplash"
          if @image.opacity > 0
            @image.opacity -= 10
          elsif @image.opacity == 0
            @image.setBitmap("Graphics/Titles/Pic_2")
            @phase = "title"
          end
        elsif @phase == "title"
          if @image.opacity < 250
            @image.opacity += 10
          elsif @image.opacity == 250
            @start.z = 99999
            @phase = "waitforinput"
          end
        elsif @phase == "waitforinput"
          update_command
          if @start.opacity < 255 && @startphase == 0
            @start.opacity += 10
          elsif @start.opacity > 0 && @startphase == 1
            @start.opacity -= 10
          end
          if @start.opacity == 0
            @image.update
            @startphase = 0
          elsif @start.opacity == 250
            @startphase = 1
          end
        end
      end
    end
    The thing that immediately glares out at me is the two missing lines (which I added in red) - those two call the methods that update the screen (i.e. fade in/out, and do something based on an input). Without them, nothing happens.

    Have a go with that, see what happens.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • @Maruno: Yep, that's fixed it. Thanks again.

    Instead of just posting lots of separate posts, I think I'll just post every single error in my game all at once. Starting with the battle system.

    Battleerror.png

    *The positioning of the players Pokémon's stats is off. I found a part to change this, but that also messes up the enemy one.
    *The exp. gauge is missing. I think I found the part of the script to move it, but changing it does nothing.

    Pokdexerror.png

    *I moved the names of the Pokémon, but it also moved the little Poké Ball too much to the right.
    *The colour of the SEEN, OWN etc. is different to the list and I can't seem to find the part to change that.

    And the title screen is no longer animated. It's a .gif in the titles folder and it has the correct name. I remember someone showing me how to fix this before, but now that I've changed all of the scripts I can't remember how anymore.
     
    Last edited:

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • So to go along with the unsolved errors in my previous post I've found two new ones.

    errors2.png

    This is the first one. It happens when the game is started just after the credits are fading out. Here's the script for the intro:
    Code:
    class Scene_Intro
      def main
        data_system = pbLoadRxData("Data/System")
        pbBGMPlay(data_system.title_bgm)
        @phase = "splash"
        @startphase = 0
        @frames = 0
        @image = IconSprite.new(0, 0)
        @image.setBitmap("Graphics/Titles/Pic_1")
        @image.opacity = 0
        @start = IconSprite.new
        @start.setBitmap("Graphics/Titles/Start")
        @start.y = (320 - 60)
        @start.opacity = 0
        Graphics.transition
        loop do
          update
          Graphics.update
          Input.update
          update_command
          @start.y = (320 - 19)
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @image.dispose
        @start.dispose
      end
    
      def update_command
        if Input.trigger?(Input::C)
          pbBGMStop()
          sscene=PokemonLoadScene.new
          sscreen=PokemonLoad.new(sscene)
          sscreen.pbStartLoadScreen
        end
      end
    
      def update
        if @phase == "splash"
          if @image.opacity < 250
            @image.opacity += 10
          end
          if @image.opacity == 250
            Graphics.wait(120)
            @phase = "fadeoutsplash"
          end
        elsif @phase == "fadeoutsplash"
          if @image.opacity > 0
            @image.opacity -= 10
          elsif @image.opacity == 0
            @image.setGif("Graphics/Titles/Pic_2")
            @phase = "title"
          end
        elsif @phase == "title"
          if @image.opacity < 250
            @image.opacity += 10
          elsif @image.opacity == 250
            @start.z = 99999
            @phase = "waitforinput"
          end
        elsif @phase == "waitforinput"
          update_command
          if @start.opacity < 255 && @startphase == 0
            @start.opacity += 10
          elsif @start.opacity > 0 && @startphase == 1
            @start.opacity -= 10
          end
          if @start.opacity == 0
            @image.update
            @startphase = 0
          elsif @start.opacity == 250
            @startphase = 1
          end
        end
      end
    end
    areaerror.png

    Connecting the maps like this seems to work everywhere else in the game, but won't here.

     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • areaerror.png

    Connecting the maps like this seems to work everywhere else in the game, but won't here.

    Whether it works or not, you shouldn't overlay maps like that. The Visual Editor is not meant to handle maps overlaying each other, and whether it works on other places or not, it's unclean, and simply not good design to do that.
     

    Peeky Chew

    Master of Palettes
    829
    Posts
    14
    Years
  • Whether it works or not, you shouldn't overlay maps like that. The Visual Editor is not meant to handle maps overlaying each other, and whether it works on other places or not, it's unclean, and simply not good design to do that.
    The part that overlaps on the map highlighted in red is white space. Due to the design of this map it has to overlay the other one. Isn't there a way to make it work?
     
    Back
    Top