Okay, so the good news is that you had the right first step!
When adding a new ability or move, the best thing to first do is look at the ones already there!
1) With that mentality, we also look at the second step
The mistake you then made was to set Sea Of Fire as a terrain, which it isn't. It is a field (or a side?) effect
We want to have the Sea Of Fire added, so let's look at the move effect for it
We can find the move effect by searching "seaoffire" in the all scripts section
NOTE: If that doesn't work, try it with spaces. Sometimes Maruno adds these things as comments, so search "sea of fire" if the last line doesn't work!
2) So we see about twenty options come up, but don't worry, as most of them aren't relevant. We are specifically looking for the Move Effect
In the options, about ten of them have anything to do with move effects (As you see on the left), so first we will look at where we most think the lines will be. If it's not there, we search again
My Spidops senses tell me it is in the BaseEffects page, in the clump around Line 600
Found it! So what I like to do is copy the whole thing to a Notepad file so the scripts arent messed with
3) So I have moved the entire MoveEffects class over. Most of it we won't be using
The bits we are interested in are the parts that check if the pledge effect happens (ie. is it already there?) and the bits that set up the effect
So, we have a look and cut out the irrelevant bits (Just trust that I did this!)
... A lot of it is irrelevant to us, as we are only after the effects
So the lines we cut out are:
Code:
msg = nil
animName = nil
case @comboEffect
when :SeaOfFire # Grass + Fire
if user.pbOpposingSide.effects[PBEffects::SeaOfFire] == 0
user.pbOpposingSide.effects[PBEffects::SeaOfFire] = 4
msg = _INTL("A sea of fire enveloped {1}!", user.pbOpposingTeam(true))
animName = (user.opposes?) ? "SeaOfFire" : "SeaOfFireOpp"
end
when :Rainbow # Fire + Water
if user.pbOwnSide.effects[PBEffects::Rainbow] == 0
user.pbOwnSide.effects[PBEffects::Rainbow] = 4
msg = _INTL("A rainbow appeared in the sky on {1}'s side!", user.pbTeam(true))
animName = (user.opposes?) ? "RainbowOpp" : "Rainbow"
end
when :Swamp # Water + Grass
if user.pbOpposingSide.effects[PBEffects::Swamp] == 0
user.pbOpposingSide.effects[PBEffects::Swamp] = 4
msg = _INTL("A swamp enveloped {1}!", user.pbOpposingTeam(true))
animName = (user.opposes?) ? "Swamp" : "SwampOpp"
end
end
@battle.pbDisplay(msg) if msg
@battle.pbCommonAnimation(animName) if animName
4) These are useful, as they contain both the lines that ask if it is possible to set up a Pledge move, and the ones that do the effect!
It also contains the lines for the other Pledge Moves!
So, we now go back to our bestie Misty Surge! You have already found that so we have it here:
Code:
Battle::AbilityEffects::OnSwitchIn.add(:MISTYSURGE,
proc { |ability, battler, battle, switch_in|
next if battle.field.terrain == :Misty
battle.pbShowAbilitySplash(battler)
battle.pbStartTerrain(battler, :Misty)
# NOTE: The ability splash is hidden again in def pbStartTerrain.
}
)
We will add that to the bottom of our Notepad file
5) Now is the hard/fun part! We do a Frankenstein of Misty Surge and the Pledge Effects!
And because you used the correct spelling of honour in your ability name, I will be generous, and do all three Pledge Moves for you!
For the benefit of you/anyone watching, I'll do a step-by-step!
a) Change Misty Surge to your ability name (You already did this!)
b) It is a switch in effect, so first two lines can stay the same
c) We can still set this ability during Misty Surge, so line 3 gets deleted
d) It is still a switch in ability, so line 4 stays
e) The fifth line is to be replaced by our Pledge move effect
6) Our Frankenstein ability now looks like this:
Code:
Battle::AbilityEffects::OnSwitchIn.add(:BLAZINGHONOUR,
proc { |ability, battler, battle, switch_in|
next if battle.field.terrain == :Misty
battle.pbShowAbilitySplash(battler)
if user.pbOpposingSide.effects[PBEffects::SeaOfFire] == 0
user.pbOpposingSide.effects[PBEffects::SeaOfFire] = 4
msg = _INTL("A sea of fire enveloped {1}!", user.pbOpposingTeam(true))
animName = (user.opposes?) ? "SeaOfFire" : "SeaOfFireOpp"
end
# NOTE: The ability splash is hidden again in def pbStartTerrain.
}
)
There are quite a few problems!
a) The local variable "user" which isn't any of the words next to the proc!
This means that the game would crash with a pesky NoMethodError should this ability run
So, we have to replace every instance of "user" with "battler"
b) The ability splash comes up before checking to see if there is already a Sea of Fire
This would not crash the game, but would confuse a player wondering what the ability did, as the splash would show up and appear to do nothing
So, let's copy Misty Surge, and have it ignore the ability completely if there is already a Sea of Fire there
We swap former Lines 4 and 5, and add a "next" in front of our new Line 4, a bit like Misty Surge did
c) "next if" would do the opposite of what we want it to do (We want it to NOT run IF the effect is NOT 0. So "next unless" or " > 0" would work BUT NOT BOTH!
d) We now no longer need the "end" that was in Line 9, so we get rid of that line entirely, and then indent it properly, because even beginners should correctly indent lines or else you look at your code 3 years later and have a meltdown
7) Let's look at Frankenstein again
Code:
Battle::AbilityEffects::OnSwitchIn.add(:BLAZINGHONOUR,
proc { |ability, battler, battle, switch_in|
next unless battler.pbOpposingSide.effects[PBEffects::SeaOfFire] == 0
battle.pbShowAbilitySplash(battler)
battler.pbOpposingSide.effects[PBEffects::SeaOfFire] = 4
msg = _INTL("A sea of fire enveloped {1}!", battler.pbOpposingTeam(true))
animName = (battler.opposes?) ? "SeaOfFire" : "SeaOfFireOpp"
# NOTE: The ability splash is hidden again in def pbStartTerrain.
}
)
This code will not crash the game, but will definitely not work as intended
a) We have set the name and animation to local variables, but nothing is then done about it
b) And Maruno left us a nice note saying that we basically have to turn off the splash!
Let's fix a) by looking at the Pledge Move effect code, and copying that at the end
We also remove the @ in front of the "battle" to avoid confusing local and class variables!
And for b), we look for literally any code that hides the ability hash. The opposite of "show" is "hide" so logically it would be called "pbHideAbilitySplash" Let's look for it in the all search function
It is there! So, after checking that, we replace Maruno's NOTE line with the hiding of the ability splash by copying line 4 and replacing "Show" with "Hide"
8) And here we are!
Blazing Honour
This should work. There are a few minor nerdy nitpicks in here (eg. No need to have the "if msg") but other than that, this should be good to go!
Just put it somewhere, and it should work
After a few times doing it, all those steps will become more obvious and will take less time and thinking and be more obvious and practise makes perfect etc.
So, using this same logic, we can do the other Pledge moves! We might as well!
NOTE: None of the abilities I've done here have been tested, so please make sure to test it! Do this with all your stuff!
Rainbow Honour
Swamp Honour (shoutout to my boy Shrek!)
Hope this helps!
Swdfm
I do like to be credited, but only for resources, so don't worry too much about crediting me this time around!
I would like your permission to make this into a Tutorial though! This was a lot of fun!