• 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!
  • Akari, Selene, Mint, Solana - 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.

Counting wild encounters

  • 2
    Posts
    9
    Years
    • Seen Mar 17, 2016
    Hello everyone,

    I am currently working on a new idea and I would like to know whether it's possible to count wild encounters.

    What I would like to implement is a map where you can only encounter 5 wild Pokémon. No matter what you do in battle (run, catch the Pokémon or defeat them), once you met 5 Pokémon, there are no more encounters on the map.

    Optional bonus : a switch is activated, allowing me to display a message (for example "Pokémon left on this map : 0.")

    Thanks a lot for helping me out !

    Have a good day,
    Phildu13
     
    Last edited:
    Here is where I am now :

    In EncountersModifiers section, before these lines :

    Spoiler:


    I added these :

    Spoiler:


    But I am given a syntax error on start. But if, instead of doing this, I replace this :


    Spoiler:


    By this :


    Spoiler:


    It doesn't give me a syntax error. And I just don't understand why. Anyone has an idea ?

    So, the latter solution works and I can count encounters. However, the variable $pokemonCount is incremented when the wild Pokémon is created, which actually occurs before I get into battle. I tried to add a parallel process displaying "Number of Pokémon left : 0" right after the 5th, but because of that, it is displayed right before jumping into the 5th battle and it doesn't look right.

    So my question becomes, how to increment $pokemonCount during or after the battle ?

    Thanks a lot !

    Phildu13
     
    It looks like you're on the right track, but I'd like to state that your method will count EVERY wild encounter, whether it is on the map or not.
     
    Back
    Top