• 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] Ev and Iv question

44
Posts
6
Years
Hello everyone!
I was modifying the Ev and Iv system for opponents' pokemon when I read for both Iv/Ev the "FOR" cycle like this:
Code:
for i in 0...6
        pokemon.iv[i]= ....
I am not understanding why the cycle goes to 6! I imagine that the game wants to assign a value to Ivs/EVs in position 0,1,2,3,4,5 because they are representing the stats HP, Atk,Def, Speed, Sp.atk, Sp.def ..
But why 6?

Thanks in advance!

P.S. Is there a way to determine the EVs of Opponent's pokemon to have a back test (and verify that the new system I created works fine) ?
 
Last edited:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
If you want a switch, in 'PField_EncounterModifiers' add and edit:

Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   pokemon=e[0]
   if $game_switches[B][COLOR="Red"][300] #edit the number if you want[/COLOR][/B]
       pokemon.iv = [31,31,31,31,31,31]
       pokemon.ev = [31,31,31,31,31,31]
       pokemon.calcStats
   end
}

Create a Parallel Process with that SWITCH ON and all pokemon will have that IV's and EV's. When you leave into the map, create event, put switch OFF in other map.
Or put 'if $game_map.map_id==[ID MAP, ID MAP]' below 'if $game_switches[300]' and a end, (obviously lol)

About the EV's and IV's for the trainers maybe this help ya:
https://www.pokecommunity.com/showthread.php?t=359588
 
44
Posts
6
Years
Ohhhhhhhh.. Now I understand! That was so easy.. I would have never imagined such an answer..
Thanks so much! I will be able to complete in the correct way the formula!

If you want a switch, in 'PField_EncounterModifiers' add and edit:

Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   pokemon=e[0]
   if $game_switches[B][COLOR="Red"][300] #edit the number if you want[/COLOR][/B]
       pokemon.iv = [31,31,31,31,31,31]
       pokemon.ev = [31,31,31,31,31,31]
       pokemon.calcStats
   end
}

Create a Parallel Process with that SWITCH ON and all pokemon will have that IV's and EV's. When you leave into the map, create event, put switch OFF in other map.
Or put 'if $game_map.map_id==[ID MAP, ID MAP]' below 'if $game_switches[300]' and a end, (obviously lol)

About the EV's and IV's for the trainers maybe this help ya:
https://www.pokecommunity.com/showthread.php?t=359588

Thanks for the help, but I have already built a formula to calculate the EVs (and IVs) in a consistent manner. My purpose was to find a common formula for every trainer without the need to use simplicistic switches or too tedious methods like the manual choice for EVERY trainers' pokémon. The latter method you linked is although very good if one has the dedication to write down EVs one by one.

I will post in these days the formula on another post. Maybe someone will find it helpful.
Thanks again to everyone :)
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
Ohhhhhhhh.. Now I understand! That was so easy.. I would have never imagined such an answer..
Thanks so much! I will be able to complete in the correct way the formula!



Thanks for the help, but I have already built a formula to calculate the EVs (and IVs) in a consistent manner. My purpose was to find a common formula for every trainer without the need to use simplicistic switches or too tedious methods like the manual choice for EVERY trainers' pokémon. The latter method you linked is although very good if one has the dedication to write down EVs one by one.

I will post in these days the formula on another post. Maybe someone will find it helpful.
Thanks again to everyone :)

Oh! I undestand... I agree about 'manual choice' lol its really tedious.
So i will be waiting for your script :D
 
Back
Top