• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] New Encounter Types Not Working (v18.1)

  • 4
    Posts
    4
    Years
    • Seen Jan 22, 2022
    So I've been troubleshooting this for a couple days now and I've hit a wall.

    I want a desert terrain with a day/night cycle. I can add a working desert type that's essentially just copy of the caves, but once I attempt to add DesertDay and DesertNight types, it suddenly breaks the entire desert encounter type and no encounters will spawn.

    All I'm doing is essentially copying the day/night script sections from the land encounters section, so I can't understand why this is not working. I'm completely at a loss at this point. Does anyone have an idea of what I'm doing wrong ? I'm putting my scripts from PField_Encounters below with my edits in red.

    Where I suspect the problem may be:

    Spoiler:


    Entire PField_Encounters Script:

    Spoiler:
     
    Last edited:
    So I've been troubleshooting this for a couple days now and I've hit a wall.

    I want a desert terrain with a day/night cycle. I can add a working desert type that's essentially just copy of the caves, but once I attempt to add DesertDay and DesertNight types, it suddenly breaks the entire desert encounter type and no encounters will spawn.

    All I'm doing is essentially copying the day/night script sections from the land encounters section, so I can't understand why this is not working. I'm completely at a loss at this point. Does anyone have an idea of what I'm doing wrong ? I'm putting my scripts from PField_Encounters below with my edits in red.

    Where I suspect the problem may be:

    Spoiler:
    You are right, the problem is here! Look closely, you have:

    Code:
        elsif self.isDesert?
          time = pbGetTimeNow
          enctype = EncounterTypes::Desert
          enctype = EncounterTypes::DesertNight if self.hasEncounter?(EncounterTypes::**LandNight**) && PBDayNight.isNight?(time) # Replace LandNight with DesertNight
          enctype = EncounterTypes::DesertDay if self.hasEncounter?(EncounterTypes::**LandDay**) && PBDayNight.isDay?(time) # Replace LandDay with DesertDay

    PS: It's a great effort to put colors on the stuff you've edited, however this forum doesn't show colors in Spoiler brackets.
     
    Ah yes, you were correct about that, but unfortunately that did not resolve the issue. I've done and redone this about five times now, so that was just a careless error this time around. However, once I fixed it, it still did not resolve my issue. I still get no encounters at all in the maps where I try and use DesertDay and DesertNight.

    Any other ideas as to what might be causing this?

    (Also, thanks for telling me about the colors in spoilers. It's weird though because I can see the red. Is it just me because I posted it? Not important really, but still strange.)
     
    Oh, I did see one problem, but actually, there where two in the same place!
    It's because you don't return enctype in the case of desert:

    Code:
        elsif self.isDesert?
          time = pbGetTimeNow
          enctype = EncounterTypes::Desert
          enctype = EncounterTypes::DesertNight if self.hasEncounter?(EncounterTypes::DesertNight) && PBDayNight.isNight?(time)
          enctype = EncounterTypes::DesertDay if self.hasEncounter?(EncounterTypes::DesertDay) && PBDayNight.isDay?(time)
          return enctype # HERE
     
    Back
    Top