FANDOM


  • So in DPPt, you can change the nest page of the Pokedex to see if Pokemon appear during the day, night(and morning as well, but that's irrelevant). I have tried to incorporate this system into the game, but I'm finding it impossible. I don't even want to have two separate pages, but rather just change the colour of the flashing square/rectangle depending on if they're found in the day, night or both. (eg. blue for day, red for night and green for both). Is someone able to assist me? Any help greatly appreciated.

      Loading editor
    • I'm just looking at it right now, and these are the points of interest.

      In def pbStartScene in class PokemonNestMapScene, lines 49 to 68 define 4 squares of a bright red color. Line 73 loads up each map that has encounters defined (the key is the map id, i peeked at the compiler). Line 83 uses the MapSize metadata to decide which of the predefined squares to use.

      Um, I not 100% sure about this (what would I give for documented code) but, the format for the encounters is encounters[mapid]=[EncounterTypes::EnctypeDensities,[]] and that second array is [enc]=encarray where enc is the encounter type and encarray is an array of encounters. (Compiler line 2567.)

      def pbFindEncounter (PScreen_PokedexNestForm) checks if the encounter type at position encounter[i][j][0]==species. i appears to be the encounter type, j appears to be the line, and 0 is the first section, the species number Wild Encounters

      It's late, hope this helps.


      EDIT: A good 18 hours later, I return refreshed and with more time. encounter[i][j][0]==species is indeed what I predicted, as I stuck in some debugging code to test.

      Adding this code to line 123, just above @sprites["point#{i}"]=s makes the square blue instead of red. 

            for x in 0 .. s.bitmap.width 

              for y in 0 .. s.bitmap.height

                s.bitmap.set_pixel(x,y,Color.new(0,0,255))

              end

            end

      Hope this helps more

        Loading editor
    • it helps a bit, but is there any way of checking for there to be a night encounter/night and day?

        Loading editor
    • Probably. As I mentioned earlier, i is the encounter type. I would start with the code in pbFindEncounter. Instead of returning if the pokemon can be found there, we want to see if it can be found at the right time. I would start with an empty array, and push i if the species is true. If you |= with an empty array, it removes duplicates. Then just check if the arday includes certain numbers, using the constants from PBENCOUNTERS or whatever it's called. I can't check from this device, else I would give you a more concrete answer. 

      Make your own function that does all of this.

      EDIT: Or just wait for me to get back. I did the whole thing. Pastebin I edited a clean v16.2, so if you haven't done anything, you can just replace the section of lines (from under the end of pbFindEncounter to  @sprites["point#{i}"]=s) with the one in the link.

        Loading editor
    • You are an absolute saint. Thank you very much. I will tell you on Monday-ish if it works or not.


      EDIT: Never mind Monday. I can tell you today. It worked a charm. Thank you very much. I have already credited you in my game.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.