- 90
- Posts
- 7
- Years
- Seen Nov 24, 2023
I want to implement a new type of weather in my game. I've made a new move for it and have also created the script for the new type of weather to appear inbattle.
Here are some of the scripts that I had to modify:
PBWeather
PokeBattle_Battle
PokeBattle_MoveEffects
PField_Weather
The problem is that when I try to run the game, I keep getting a SyntaxError. The main issue from the "when PBWeather::BLACKSKY" from PokeBattle_Battle. I really don't know what it is, since I've been following the instructions I found on the Essentials Wiki. Does anyone know what's wrong?
Here are some of the scripts that I had to modify:
PBWeather
Code:
#11045744
begin
module PBWeather
SUNNYDAY = 1
RAINDANCE = 2
SANDSTORM = 3
HAIL = 4
HARSHSUN = 5
HEAVYRAIN = 6
STRONGWINDS = 7
BLACKSKY = 9 #Made it number 9 because 8 was taken by Shadow Sky
# Shadow Sky is weather 8
end
rescue Exception
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
raise $!
end
end
PokeBattle_Battle
Code:
if @weather==PBWeather::SUNNYDAY
pbCommonAnimation("Sunny",nil,nil)
pbDisplay(_INTL("The sunlight is strong."))
elsif @weather==PBWeather::BLACKSKY
pbCommonAnimation("Darkness",nil,nil)
pbDisplay(_INTL("It is pitch black."))
Code:
when PBWeather::BLACKSKY
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The darkness faded away."))
@weather=0
PBDebug.log("[End of effect]")
else
pbCommonAnimation("Darkness",nil,nil)
# pbDisplay(_INTL("The battlefield is covered in darkness."))
end
PokeBattle_MoveEffects
Code:
lass PokeBattle_Move_159 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
case @battle.weather
when PBWeather::HEAVYRAIN
@battle.pbDisplay(_INTL("There is no relief from this heavy rain!"))
return -1
when PBWeather::HARSHSUN
@battle.pbDisplay(_INTL("The extremely harsh sunlight was not lessened at all!"))
return -1
when PBWeather::STRONGWINDS
@battle.pbDisplay(_INTL("The mysterious air current blows on regardless!"))
return -1
when PBWeather::SUNNYDAY
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.weather=PBWeather::BLACKSKY
@battle.weatherduration=5
@battle.weatherduration=8 if attacker.hasWorkingItem(:HEATROCK)
@battle.pbCommonAnimation("Darkness",nil,nil)
@battle.pbDisplay(_INTL("The battlefield was engulfed in darkness!"))
return 0
end
end
PField_Weather
Code:
begin
module PBFieldWeather
None = 0 # None must be 0 (preset RMXP weather)
Rain = 1 # Rain must be 1 (preset RMXP weather)
Storm = 2 # Storm must be 2 (preset RMXP weather)
Snow = 3 # Snow must be 3 (preset RMXP weather)
Blizzard = 4
Sandstorm = 5
HeavyRain = 6
Sun = Sunny = 7
Darkness = 8
The problem is that when I try to run the game, I keep getting a SyntaxError. The main issue from the "when PBWeather::BLACKSKY" from PokeBattle_Battle. I really don't know what it is, since I've been following the instructions I found on the Essentials Wiki. Does anyone know what's wrong?
Last edited: