v20.1 [SOLVED] How do I make an event that establishes whether a static encounter is generated or not+shininess?

This thread pertains to v20.1 of Pokémon Essentials.

Jelly

Novice
Member
Joined
Mar 7, 2021
Posts
17
Age
28
This is a bit hard to explain but I'm not sure I did this right, it took me so long ;-;
What I want to make is an event that the player walks on and it will determine:

1. Whether a specific static encounter Pokémon will appear on the map or not;
2. If the overworld Pokémon was rolled to appear, whether it will be shiny or not.

I know shininess can be set upon battling the Pokémon, but I want it to show up with its shiny overworld sprite in that case, which is why I want to establish shininess on this event through a switch instead (unless there's another way to do it?).

This is the static encounter Event, I have set two different Switches depending on whether the Pokémon appearing is always Shiny or not:
1699382651599.png
1699381819870.png

1699381890467.png


Whether they appear or not, should be controlled by this event (located on a different map) which should roll a chance anytime the player walks on it:

1699382005714.png


After endless attempts, this seems to work, I tried it by copy-pasting the Commands above on a different event that simply requires smashing the interaction button to roll the Clauncher to make the testing faster ... But I'm not super sure I did this correctly so I'd love to know if I made any mistake and if there's another method to do it.
Thank you very much.

... Also, is there a way to be 100% sure the Clauncher that spawns without the Forced Shiny Switch is, in fact, never Shiny? I don't mind it if it's not possible, since the chance of that happening would be very low anyway, but I'm curious.
 

drdoom76

Cooltrainer
Member
Joined
Aug 1, 2023
Posts
194
Age
35
There's multiple ways to prevent Clauncher from being shiny.
First, modifying the Pokemon class, def shiny? method. Adding something like return false if self.isSpecies(:CLAUNCHER) should work.
Also, modifying the Overworld_EncounterModifider script, adding something along the lines of
Ruby:
EventHandlers.add(:on_wild_pokemon_created, :clauncher_no_shiny,
proc { |pkmn|
    if pkmn.species == :CLAUNCHER
        pkmn.shiny = false
    end
})
Should work as well.
Second one might be easiest.
Didn't test them yet, but seems like they should work. If not, let me know.

For the using switch part, you should be able to do the same as the second.
Ruby:
EventHandlers.add(:on_wild_pokemon_created, :no_shiny_pokemon_switch,
  proc { |pkmn|
    pkmn.shiny = false if $game_switches[xxx] # Where XXX is your switch number
  }
)
 
Top