Diegou18
Forever Chandelure lover.
- 75
- Posts
- 7
- Years
- Seen Aug 16, 2021
Hello. I've modified a part of a script item created by me:
ItemHandlers::UseOnPokemon.add(:TRUECRISTAL,proc{|item,pokemon,scene|
if isConst?(pokemon.species,PBSpecies,:ROTOM)
if pokemon.hp>0
pokemon.form=(pokemon.form==0) ? 6 : 0
scene.pbRefresh
scene.pbDisplay(_INTL("{1} changed Form!",pokemon.name))
next true
else
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
end
else
scene.pbDisplay(_INTL("It had no effect."))
next false
end
})
I modified this part:
pokemon.form=(pokemon.form<=5) ? 6 : 0
I did it because Rotom has 5 forms, and I want that my item works with all forms, no only with the normal form (form 0).
After that, I tested if my item was working like I wanted, and it was. Then, I went to a Pokémon Center, and when I enter, the event of the door changed its graphics (the door opening) and Essentials gave me an error before that my player appeared in the map of the Pokémon Center:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]
Exception: ArgumentError
Message: comparison of String with 5 failed
Game_Event:152:in `<'
Game_Event:152:in `nf_particles_game_map_refresh'
Game_Event:139:in `each'
Game_Event:139:in `nf_particles_game_map_refresh'
ParticleEngine:596:in `refresh'
Game_Event:20:in `nf_particles_game_map_initialize'
ParticleEngine:591:in `initialize'
Game_Map:57:in `new'
Game_Map:57:in `setup'
Game_Map:56:in `each'
This exception was logged in...
What is wrong? Did my modification do anything? Thanks for answer.
ItemHandlers::UseOnPokemon.add(:TRUECRISTAL,proc{|item,pokemon,scene|
if isConst?(pokemon.species,PBSpecies,:ROTOM)
if pokemon.hp>0
pokemon.form=(pokemon.form==0) ? 6 : 0
scene.pbRefresh
scene.pbDisplay(_INTL("{1} changed Form!",pokemon.name))
next true
else
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
end
else
scene.pbDisplay(_INTL("It had no effect."))
next false
end
})
I modified this part:
pokemon.form=(pokemon.form<=5) ? 6 : 0
I did it because Rotom has 5 forms, and I want that my item works with all forms, no only with the normal form (form 0).
After that, I tested if my item was working like I wanted, and it was. Then, I went to a Pokémon Center, and when I enter, the event of the door changed its graphics (the door opening) and Essentials gave me an error before that my player appeared in the map of the Pokémon Center:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]
Exception: ArgumentError
Message: comparison of String with 5 failed
Game_Event:152:in `<'
Game_Event:152:in `nf_particles_game_map_refresh'
Game_Event:139:in `each'
Game_Event:139:in `nf_particles_game_map_refresh'
ParticleEngine:596:in `refresh'
Game_Event:20:in `nf_particles_game_map_initialize'
ParticleEngine:591:in `initialize'
Game_Map:57:in `new'
Game_Map:57:in `setup'
Game_Map:56:in `each'
This exception was logged in...
What is wrong? Did my modification do anything? Thanks for answer.