sonicfan7895
Just a dude, I guess
- 120
- Posts
- 14
- Years
- He/Him/His
- Akala Island, Alola
- Seen Feb 22, 2025
Hello!
I'm having a bit of trouble getting a weather-induced form change to work, similar to the likes of Castform and Cherrim.
For this example, since there is only one weather effect that causes a form change, I took from Cherrim's form-changing script and changed the appropriate sections to fit my need.
This is what the script looks like, under my PokeBattle_Battler script:
But whenever I try to initiate the form change with my desired weather effect, I get this error when playtesting:
Any ideas for a fix? Not in a huge rush, but would like a bit of help. I don't know what I'm doing wrong, considering I took from a script that I know works from Cherrim.
Running Essentials 16.2, as porting all the work we have done to the new versions will most likely take way too much time.
Any help would be greatly appreciated! Thanks in advance!
EDIT: Just now thinking it's because I don't have any sprites in the Battlers folder. Testing if this is the case.
EDIT 2: This was the case. Mods, do your thing and close this down. I feel like an idiot for posting in the first place and not testing it myself first.
I'm having a bit of trouble getting a weather-induced form change to work, similar to the likes of Castform and Cherrim.
For this example, since there is only one weather effect that causes a form change, I took from Cherrim's form-changing script and changed the appropriate sections to fit my need.
This is what the script looks like, under my PokeBattle_Battler script:
Code:
# Lycamb
if isConst?(self.species,PBSpecies,:LYCAMB)
if self.hasWorkingAbility(:LYCANTHROPY) && @battle.pbWeather==PBWeather::FULLMOON
if self.form!=1
self.form=1; transformed=true
end
else
if self.form!=0
self.form=0; transformed=false
end
end
end
But whenever I try to initiate the form change with my desired weather effect, I get this error when playtesting:
Code:
---------------------------
Pokemon Zen
---------------------------
Exception: NoMethodError
Message: undefined method `width' for nil:NilClass
PokeBattle_Scene:2866:in `pbChangePokemon'
PokeBattle_Battler:948:in `pbCheckForm'
PokeBattle_Battler:3483:in `__shadow_pbEndTurn'
PokeBattle_Battler:3482:in `each'
PokeBattle_Battler:3482:in `__shadow_pbEndTurn'
Pokemon_ShadowPokemon:539:in `pbEndTurn'
PokeBattle_Battler:3417:in `pbUseMove'
PokeBattle_Battler:3519:in `pbProcessTurn'
PokeBattle_Battler:3518:in `logonerr'
PokeBattle_Battler:3518:in `pbProcessTurn'
Any ideas for a fix? Not in a huge rush, but would like a bit of help. I don't know what I'm doing wrong, considering I took from a script that I know works from Cherrim.
Running Essentials 16.2, as porting all the work we have done to the new versions will most likely take way too much time.
Any help would be greatly appreciated! Thanks in advance!
EDIT: Just now thinking it's because I don't have any sprites in the Battlers folder. Testing if this is the case.
EDIT 2: This was the case. Mods, do your thing and close this down. I feel like an idiot for posting in the first place and not testing it myself first.
Last edited: