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

[Scripting Question] Pokemon SwSh like Wild Areas

62
Posts
5
Years
  • Hi, can someone find a way to develop Wild Areas like the ones in Pokèmon SwSh? I mean, areas in which wild Pokèmons change (because of different conditions like the day of the week, getting past a certain point in the story, ecc.). Not necessarily with Pokèmon wandering in the Overworld, even tho that would be great
     
    277
    Posts
    15
    Years
  • I have been experimenting with Pokemon spawning in the over-world with much success, the only real issue I am running into is I don't know how to check the player coordinates on the map so I don't spawn a Pokemon on top of the player.

    As for the Pokemon generated in the grass, I believe you can use a RNG to create modified encounters based on a number of variables.
    This sounds like a fun project, shoot me a pm if you're interested in some help build a Wilds Area.
     
    62
    Posts
    5
    Years
  • I don't know what a RNG is 😅
    However if you figure out how to do it, that would be great, tell me :)
     
    277
    Posts
    15
    Years
  • RNG is Random Number Generator.

    In the script editor find PField_EncounterModifiers.

    Right underneath this.
    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_switches[SHINY_WILD_POKEMON_SWITCH]
         pokemon.makeShiny
       end
    }

    Paste this.
    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_switches[Your_Switch]
         pokemon.species=PBSpecies::BULBASAUR
       end
    }

    This will just turn the Pokemon into Bulbasaur, but you can choose which ever Pokemon you want.
    However it doesn't end there, this will only change the species you will also need to adjust the nickname, moves, and various other elements to make the Pokemon look like they were spawned normally. For what you can change go here.
    https://essentialsdocs.fandom.com/wiki/Editing_a_Pokémon

    Now to use a RNG to get multiple kinds of Pokemon you would need to tweak the code like this.
    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_switches[Your_Switch] && $game_map.map_id == 5 #checks if your event switch is on and your are on the right map.
        r = rand(6) #set how many different outcomes you can have
        if r==1
          pokemon.species=PBSpecies::BULBASAUR
          pokemon.name="Bulbasaur"
          pkmn.resetMoves
          pokemon.pbLearnMove(:LEECHSEED)
        elsif r==2
          pokemon.species=PBSpecies::CHARMANDER
          pokemon.name="Charmander"
          pokemon.resetMoves
          pokemon.pbLearnMove(:EMBER)
        elsif r==3
          pokemon.species=PBSpecies::SQUIRTLE
          pokemon.name="Squirtle"
          pokemon.resetMoves
          pokemon.pbLearnMove(:BUBBLE)
        elsif r==4
          pokemon.species=PBSpecies::PIKACHU
          pokemon.name="Pikachu"
          pokemon.givePokerus
          pokemon.makeShiny
          pokemon.resetMoves
        elsif r==5
          pokemon.species=PBSpecies::EEVEE
          pokemon.name="Eevee"
          pokemon.setItem(:ORANBERRY)
          pokemon.resetMoves
        else
          pokemon.species=PBSpecies::MEOWTH
          pokemon.name="Meowth"
          pokemon.form=1         #spawns Alolan Meowth
          pokemon.resetMoves
       end
    }
     
    Last edited:
    17
    Posts
    9
    Years
  • Hello, i messed with essentials scripts and combining it with a little bit of eventing managed to find a (pretty rustic way) of doing wild area like encounters
    This is the script i created
    Spoiler:

    but you also need to set some events on the map named "WildPokemon" to this work and with conditions to check what pokemon just "spawned"
    and depending on what spawned activate one of the self variables, and in the new event page change the event's sprite and make it call a wild battle of the pokemon it is
    call resetecounters wherever you want to reset the encounters (i wanted to find a way to call this on map reset or something)
    also, you need to add an encounter type called "StaticEncounter" and probably just four possibilities (as there are only four self variables)
     
    62
    Posts
    5
    Years
  • Thank you both. Im not that good at scripting so I guess I'll just try and see if I succeed
     
    Back
    Top