• 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.

Script for Disguise

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
With a bit of trial and error, I've managed to put together a working script for Mimikyu's Disguise ability.

There have been a few threads about this topic, and I posted a partial solution to this question here. However, there were some shortcomings with that script, mainly that Disguise was reset every time the Mimikyu switched out of battle, unlike in SM where it only works once per battle. My new script fixes that so that Disguise works a bit more like Mega Evolution - as a form change that lasts for the duration of battle and resets on end of battle, fainting, or capture. If you previously applied the steps from that linked thread, you'll want to undo them before trying this one, as this new approach uses an entirely different mechanic that is not compatible with the previous fix.

To pull off this ability, a number of crucial scripts have to be tweaked, so this is unfortunately not a plug & play script, but I will try to spell out the steps as clearly as possible:

#1 Check and Change the Pokemon's Form
Spoiler:

#2 Check and Change the Pokemon in Battle
Spoiler:

#3 Revert to Base Form
Spoiler:

#4 Break Disguise
Spoiler:

Conclusion
With all that finished, you should now have functioning code for the Disguise ability. Enjoy and use responsibly!
And of course, credit is appreciated if you use it.
 

mybusiness

Guest
0
Posts
Good job. Additionally, I have made a 'def revertOtherForms' in Pokemon_MegaEvolution that includes Mimikyu, Greninja and Zygarde (reverting to what specific form you had before battle). This way, you have to put just one code at pbThrowPokeBall and pbAfterBattle. Now I go to the threads concerning Greninja and Zygarde, since Mimikyu is busted, in this sense.
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
He applied what we had talked about in past threads! Great script Poq, as always helping all devs!
I will test when I have time, and I think it will be able to add the other types of pokemons that can use this script, like Greninja (Battle Bonde) and Zygarde (Power Construct).
If I do this successfully, I will gladly share it with all of you!

I know than doenst exist a icon sprite to Burst Form, so i drew one. Credit is appreciated if you use it.

Also, we need to create to Ultra Burst too :D

Cya!

EDIT:
How to add Ash-Greninja:

In Ability.txt, paste (193 will be changed for your last number):
Code:
[COLOR="Red"]193[/COLOR],BATTLEBOND,Battle Bond,"Defeating an opposing Pokémon strengthens the Pokémon's bond with its Trainer."

In pokemon.txt, search to Greninja and add your hidden abilities:
Spoiler:


Now, in pokemonforms.txt add Ash-Greninja form:
Spoiler:


After install Disguise script (made by Poq. Give credit to him), search to 'def getBustedForm' and add the red line:
Spoiler:


Search 'def pbBust' and add the red line:
Spoiler:


Finally, search to 'def pbEffectsAfterHit(user,target,thismove,turneffects)' and below Moxie ability script paste. Something like (red line):
Spoiler:


To script, click here to give credits: https://www.pokecommunity.com/showthread.php?t=387706
Credit to Poq to created the script
Credit for me to adapted Battle Bondt ability script, usin Poq's script. :D

Battle sprite in Attachments (credit to Smogon: https://www.smogon.com/forums/threads/xy-sprite-project-read-1st-post-release-v1-1-on-post-3240.3486712/)
Ash Greninja Icon sprite in Attachments (check for the credits https://www.deviantart.com/meem123/art/POKEMON-GEN-6-7-MENU-SPRITES-ICONS-V10-435245381)
 

Attachments

  • 658_1.png
    658_1.png
    2.2 KB · Views: 30
  • 658b_1.png
    658b_1.png
    2 KB · Views: 15
  • 658s_1.png
    658s_1.png
    2.2 KB · Views: 13
  • 658sb_1.png
    658sb_1.png
    2.1 KB · Views: 12
  • icon658_1.png
    icon658_1.png
    1.6 KB · Views: 15
  • icon778_1.png
    icon778_1.png
    1 KB · Views: 21
Last edited:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
Sorry about the flood but it is other script, to Zygarde (we still need to finish):

First, ability.txt add (212 will be changed for your last number):
Code:
[COLOR="red"]212[/COLOR],POWERCONSTRUCT,Power Construct,"Other Cells gather to aid when its HP becomes half or less."

Second, pokemonforms.txt add:
Code:
#-------------------------------
[ZYGARDE-1]
FormName=10% Forme
BaseStats=54,100,71,115,61,85
Height=1.2
Weight=33.5
Shape=8
Pokedex=This is Zygarde when about 10% of its pieces have been assembled. It leaps at its opponent's chest and sinks its sharp fangs into them.
BattlerPlayerY=13
BattlerEnemyY=16
#-------------------------------
[ZYGARDE-2]
FormName=Complete Forme
BaseStats=216,100,121,85,91,95
Abilities=POWERCONSTRUCT
Height=4.5
Weight=610.0
Pokedex=Born when all of Zygarde's cells have been gathered together, it uses force to neutralize those who harm the ecosystem.
BattlerPlayerY=7
BattlerEnemyY=4
#-------------------------------

After install Disguise script (made by Poq. Give credit to him), search to 'def getBustedForm' and add the red line:
Spoiler:


Then, search to 'def pbBust'. Add:
Spoiler:


Now, the last one: search to 'def pbReduceHPDamage(damage,attacker,opponent)' and add the red line:
Spoiler:


We need to find a way to how to script when we have zygarde forme 50% (form=0) and zygarde forme 10% (form=1) and after battle, back to normal (form 1 or 0).
Always it will back to form 1, because this:
Code:
  def getDisguiseForm
    return -1 if !isBusted?
[COLOR="red"]      disguiseform = self.form-1[/COLOR]
    return disguiseform   # form number
  end

or this:
Code:
  def getBustedForm
    if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE) ||
     isConst?(self.species,PBSpecies,:GRENINJA) && self.hasAbility?(:BATTLEBOND)
      return 1
    elsif isConst?(self.species,PBSpecies,:ZYGARDE) && self.hasAbility?(:POWERCONSTRUCT)
      return 2
[COLOR="red"]    else
      return-1[/COLOR]
    end
  end

idk how to script that part.

Credit to Poq to created the script
Credit for me to created a script to Power Construct ability, usin Poq's script. :D

Battle sprite in Attachments (credit to Smogon: https://www.smogon.com/forums/threa...d-1st-post-release-v1-1-on-post-3240.3486712/)
Zygarde Icon sprite (check for the credits https://www.deviantart.com/meem123/art/POKEMON-GEN-6-7-MENU-SPRITES-ICONS-V10-435245381)

BETTER SCRIPT TO ZYGARDE HERE
https://www.pokecommunity.com/showpost.php?p=9968463&postcount=20
Credis goes to mybusiness
 

Attachments

  • 718_1.png
    718_1.png
    1.6 KB · Views: 5
  • 718b_1.png
    718b_1.png
    1.5 KB · Views: 2
  • 718_2.png
    718_2.png
    3.5 KB · Views: 3
  • 718b_2.png
    718b_2.png
    2.8 KB · Views: 2
  • 718s_1.png
    718s_1.png
    1.6 KB · Views: 2
  • 718sb_1.png
    718sb_1.png
    1.5 KB · Views: 3
  • 718s_2.png
    718s_2.png
    3.5 KB · Views: 2
  • 718sb_2.png
    718sb_2.png
    2.8 KB · Views: 3
Last edited:

Team Embrace

Team Embrace Boss
30
Posts
5
Years
  • Age 35
  • Seen Nov 14, 2022
I get a syntax error in pokebattle_battler line 3400? any ideas on how to fix this? Thanks!
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
I get a syntax error in pokebattle_battler line 3400? any ideas on how to fix this? Thanks!

Give us your message error. We dont know about your script line 3400.

Example:

Spoiler:
 

Team Embrace

Team Embrace Boss
30
Posts
5
Years
  • Age 35
  • Seen Nov 14, 2022
I don't that kind of error message it just says syntax error PBDebug.log("[Form changed] #{pbThis} changed to Blade Forme")
elsif isConst?(thismove.id,PBMoves,:KINGSSHIELD) && self.form!=0
self.form=0
pbUpdate(true)
@battle.scene.pbChangePokemon(self,@pokemon)
@battle.pbDisplay(_INTL("{1} changed to Shield Forme!",pbThis))
PBDebug.log("[Form changed] #{pbThis} changed to Shield Forme")
end
end
# Record that user has used a move this round (ot at least tried to)
[email protected]
# Try to use the move
if !pbTryUseMove(choice,thismove,turneffects)
self.lastMoveUsed=-1
self.lastMoveUsedType=-1
if !turneffects[PBEffects::SpecialUsage]
self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
self.lastRegularMoveUsed=-1
end
pbCancelMoves
@battle.pbGainEXP
pbEndTurn(choice)
@battle.pbJudge # @battle.pbSwitch
return
end
if !turneffects[PBEffects::SpecialUsage]
if !pbReducePP(thismove)
@battle.pbDisplay(_INTL("{1} used\r\n{2}!",pbThis,thismove.name))
@battle.pbDisplay(_INTL("But there was no PP left for the move!"))
self.lastMoveUsed=-1
self.lastMoveUsedType=-1
self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
self.lastRegularMoveUsed=-1
pbEndTurn(choice)
@battle.pbJudge # @battle.pbSwitch
PBDebug.log("[Move failed] #{thismove.name} has no PP left")
return
end
end
# Remember that user chose a two-turn move
if thismove.pbTwoTurnAttack(self)
# Beginning use of two-turn attack
@effects[PBEffects::TwoTurnAttack]=thismove.id
@currentMove=thismove.id
else
@effects[PBEffects::TwoTurnAttack]=0 # Cancel use of two-turn attack
end
# Charge up Metronome item
if self.lastMoveUsed==thismove.id
self.effects[PBEffects::Metronome]+=1
else
self.effects[PBEffects::Metronome]=0
end
# "X used Y!" message
case thismove.pbDisplayUseMessage(self)
when 2 # Continuing Bide
return
when 1 # Starting Bide
self.lastMoveUsed=thismove.id
self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
if !turneffects[PBEffects::SpecialUsage]
self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
self.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=self.index
@battle.successStates[self.index].useState=2
@battle.successStates[self.index].typemod=8
return
when -1 # Was hurt while readying Focus Punch, fails use
self.lastMoveUsed=thismove.id
self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
if !turneffects[PBEffects::SpecialUsage]
self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
self.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=self.index
@battle.successStates[self.index].useState=2 # somehow treated as a success
@battle.successStates[self.index].typemod=8
PBDebug.log("[Move failed] #{pbThis} was hurt while readying Focus Punch")
return
end
# Find the user and target(s)
targets=[]
user=pbFindUser(choice,targets)
# Battle Arena only - assume failure
@battle.successStates[user.index].useState=1
@battle.successStates[user.index].typemod=8
# Check whether Selfdestruct works
if !thismove.pbOnStartUse(user) # Selfdestruct, Natural Gift, Beat Up can return false here
PBDebug.log(sprintf("[Move failed] Failed pbOnStartUse (function code %02X)",thismove.function))
user.lastMoveUsed=thismove.id
user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
if !turneffects[PBEffects::SpecialUsage]
user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
user.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=user.index
return
end
# Primordial Sea, Desolate Land
if thismove.pbIsDamaging?
case @battle.pbWeather
when PBWeather::HEAVYRAIN
if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
PBDebug.log("[Move failed] Primordial Sea's rain cancelled the Fire-type #{thismove.name}")
@battle.pbDisplay(_INTL("The Fire-type attack fizzled out in the heavy rain!"))
user.lastMoveUsed=thismove.id
user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
if !turneffects[PBEffects::SpecialUsage]
user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
user.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=user.index
return
end
when PBWeather::HARSHSUN
if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:WATER)
PBDebug.log("[Move failed] Desolate Land's sun cancelled the Water-type #{thismove.name}")
@battle.pbDisplay(_INTL("The Water-type attack evaporated in the harsh sunlight!"))
user.lastMoveUsed=thismove.id
user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
if !turneffects[PBEffects::SpecialUsage]
user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
user.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=user.index
return
end
end
end
# Powder
if user.effects[PBEffects::Powder] && isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
PBDebug.log("[Lingering effect triggered] #{pbThis}'s Powder cancelled the Fire move")
@battle.pbCommonAnimation("Powder",user,nil)
@battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
user.pbReduceHP(1+(user.totalhp/4).floor) if !user.hasWorkingAbility(:MAGICGUARD)
user.lastMoveUsed=thismove.id
user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
if !turneffects[PBEffects::SpecialUsage]
user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
user.lastRegularMoveUsed=thismove.id
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=user.index
user.pbFaint if user.isFainted?
pbEndTurn(choice)
return
end
# Protean
if user.hasWorkingAbility(:PROTEAN) &&
thismove.function!=0xAE && # Mirror Move
thismove.function!=0xAF && # Copycat
thismove.function!=0xB0 && # Me First
thismove.function!=0xB3 && # Nature Power
thismove.function!=0xB4 && # Sleep Talk
thismove.function!=0xB5 && # Assist
thismove.function!=0xB6 # Metronome
movetype=thismove.pbType(thismove.type,user,nil)
if !user.pbHasType?(movetype)
typename=PBTypes.getName(movetype)
PBDebug.log("[Ability triggered] #{pbThis}'s Protean made it #{typename}-type")
user.type1=movetype
user.type2=movetype
user.effects[PBEffects::Type3]=-1
@battle.pbDisplay(_INTL("{1} transformed into the {2} type!",user.pbThis,typename))
end
end
# Try to use move against user if there aren't any targets
if targets.length==0
user=pbChangeUser(thismove,user)
if thismove.target==PBTargets::SingleNonUser ||
thismove.target==PBTargets::RandomOpposing ||
thismove.target==PBTargets::AllOpposing ||
thismove.target==PBTargets::AllNonUsers ||
thismove.target==PBTargets::Partner ||
thismove.target==PBTargets::UserOrPartner ||
thismove.target==PBTargets::SingleOpposing ||
thismove.target==PBTargets::OppositeOpposing
@battle.pbDisplay(_INTL("But there was no target..."))
else
PBDebug.logonerr{
thismove.pbEffect(user,nil)
}
end
else
# We have targets
showanimation=true
alltargets=[]
for i in 0...targets.length
alltargets.push(targets.index) if !targets.include?(targets.index)
end
# For each target in turn
i=0; loop do break if i>=targets.length
# Get next target
userandtarget=[user,targets]
success=pbChangeTarget(thismove,userandtarget,targets)
user=userandtarget[0]
target=userandtarget[1]
if i==0 && thismove.target==PBTargets::AllOpposing
# Add target's partner to list of targets
pbAddTarget(targets,target.pbPartner)
end
# If couldn't get the next target
if !success
i+=1
next
end
# Get the number of hits
numhits=thismove.pbNumHits(user)
# Reset damage state, set Focus Band/Focus Sash to available
target.damagestate.reset
# Use move against the current target
pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,false,alltargets,showanimation)
showanimation=false
i+=1
end
end
# Pokémon switching caused by Roar, Whirlwind, Circle Throw, Dragon Tail, Red Card
if !user.isFainted?
switched=[]
for i in 0...4
if @battle.battlers.effects[PBEffects::Roar]
@battle.battlers.effects[PBEffects::Roar]=false
@battle.battlers.effects[PBEffects::Uturn]=false
next if @battle.battlers.isFainted?
next if [email protected]?(i,-1,false)
choices=[]
[email protected](i)
for j in 0...party.length
choices.push(j) if @battle.pbCanSwitchLax?(i,j,false)
end
if choices.length>0
newpoke=choices[@battle.pbRandom(choices.length)]
newpokename=newpoke
if isConst?(party[newpoke].ability,PBAbilities,:ILLUSION)
newpokename=pbGetLastPokeInTeam(i)
end
switched.push(i)
@battle.battlers.pbResetForm
@battle.pbRecallAndReplace(i,newpoke,newpokename,false,user.hasMoldBreaker)
@battle.pbDisplay(_INTL("{1} was dragged out!",@battle.battlers.pbThis))
@battle.choices=[0,0,nil,-1] # Replacement Pokémon does nothing this round
end
end
end
for i in @battle.pbPriority
next if !switched.include?(i.index)
i.pbAbilitiesOnSwitchIn(true)
end
end
# Pokémon switching caused by U-Turn, Volt Switch, Eject Button
switched=[]
for i in 0...4
if @battle.battlers.effects[PBEffects::Uturn]
@battle.battlers.effects[PBEffects::Uturn]=false
@battle.battlers.effects[PBEffects::Roar]=false
if [email protected].isFainted? && @battle.pbCanChooseNonActive?(i) &&
[email protected]?(@battle.pbOpposingParty(i))
# TODO: Pursuit should go here, and negate this effect if it KO's attacker
@battle.pbDisplay(_INTL("{1} went back to {2}!",@battle.battlers.pbThis,@battle.pbGetOwner(i).name))
newpoke=0
[email protected](i,true,false)
newpokename=newpoke
if isConst?(@battle.pbParty(i)[newpoke].ability,PBAbilities,:ILLUSION)
newpokename=pbGetLastPokeInTeam(i)
end
switched.push(i)
@battle.battlers.pbResetForm
@battle.pbRecallAndReplace(i,newpoke,newpokename,@battle.battlers.effects[PBEffects::BatonPass])
@battle.choices=[0,0,nil,-1] # Replacement Pokémon does nothing this round
end
end
end
for i in @battle.pbPriority
next if !switched.include?(i.index)
i.pbAbilitiesOnSwitchIn(true)
end
# Baton Pass
if user.effects[PBEffects::BatonPass]
user.effects[PBEffects::BatonPass]=false
if !user.isFainted? && @battle.pbCanChooseNonActive?(user.index) &&
[email protected]?(@battle.pbParty(user.index))
newpoke=0
[email protected](user.index,true,false)
newpokename=newpoke
if isConst?(@battle.pbParty(user.index)[newpoke].ability,PBAbilities,:ILLUSION)
newpokename=pbGetLastPokeInTeam(user.index)
end
user.pbResetForm
@battle.pbRecallAndReplace(user.index,newpoke,newpokename,true)
@battle.choices[user.index]=[0,0,nil,-1] # Replacement Pokémon does nothing this round
user.pbAbilitiesOnSwitchIn(true)
end
end
# Record move as having been used
user.lastMoveUsed=thismove.id
user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
if !turneffects[PBEffects::SpecialUsage]
user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
user.lastRegularMoveUsed=thismove.id
user.movesUsed.push(thismove.id) if !user.movesUsed.include?(thismove.id) # For Last Resort
end
@battle.lastMoveUsed=thismove.id
@battle.lastMoveUser=user.index
# Gain Exp
@battle.pbGainEXP
# Battle Arena only - update skills
for i in 0...4
@battle.successStates.updateSkill
end
# End of move usage
pbEndTurn(choice)
@battle.pbJudge # @battle.pbSwitch
return
end

def pbCancelMoves
# If failed pbTryUseMove or have already used Pursuit to chase a switching foe
# Cancel multi-turn attacks (note: Hyper Beam effect is not canceled here)
@effects[PBEffects::TwoTurnAttack]=0 if @effects[PBEffects::TwoTurnAttack]>0
@effects[PBEffects::Outrage]=0
@effects[PBEffects::Rollout]=0
@effects[PBEffects::Uproar]=0
@effects[PBEffects::Bide]=0
@currentMove=0
# Reset counters for moves which increase them when used in succession
@effects[PBEffects::FuryCutter]=0
PBDebug.log("Cancelled using the move")
end

################################################################################
# Turn processing
################################################################################
def pbBeginTurn(choice)
# Cancel some lingering effects which only apply until the user next moves
@effects[PBEffects::DestinyBond]=false
@effects[PBEffects::Grudge]=false
# Reset Parental Bond's count
@effects[PBEffects::ParentalBond]=0
# Encore's effect ends if the encored move is no longer available
if @effects[PBEffects::Encore]>0 &&
@moves[@effects[PBEffects::EncoreIndex]].id!=@effects[PBEffects::EncoreMove]
PBDebug.log("Resetting Encore effect")
@effects[PBEffects::Encore]=0
@effects[PBEffects::EncoreIndex]=0
@effects[PBEffects::EncoreMove]=0
end
# Wake up in an uproar
if self.status==PBStatuses::SLEEP && !self.hasWorkingAbility(:SOUNDPROOF)
for i in 0...4
if @battle.battlers.effects[PBEffects::Uproar]>0
pbCureStatus(false)
@battle.pbDisplay(_INTL("{1} woke up in the uproar!",pbThis))
end
end
end
end

def pbEndTurn(choice)
# True end(?)
if @effects[PBEffects::ChoiceBand]<0 && @lastMoveUsed>=0 && !self.isFainted? &&
(self.hasWorkingItem(:CHOICEBAND) ||
self.hasWorkingItem(:CHOICESPECS) ||
self.hasWorkingItem(:CHOICESCARF))
@effects[PBEffects::ChoiceBand]=@lastMoveUsed
end
@battle.pbPrimordialWeather
for i in 0...4
@battle.battlers.pbBerryCureCheck
end
for i in 0...4
@battle.battlers.pbAbilityCureCheck
end
for i in 0...4
@battle.battlers.pbAbilitiesOnSwitchIn(false)
end
for i in 0...4
@battle.battlers.pbCheckForm
end
end

def pbProcessTurn(choice)
# Can't use a move if fainted
return false if self.isFainted?
# Wild roaming Pokémon always flee if possible
if [email protected] && @battle.pbIsOpposing?(self.index) &&
@battle.rules["alwaysflee"] && @battle.pbCanRun?(self.index)
pbBeginTurn(choice)
@battle.pbDisplay(_INTL("{1} fled!",self.pbThis))
@battle.decision=3
pbEndTurn(choice)
PBDebug.log("[Escape] #{pbThis} fled")
return true
end
# If this battler's action for this round wasn't "use a move"
if choice[0]!=1
# Clean up effects that end at battler's turn
pbBeginTurn(choice)
pbEndTurn(choice)
return false
end
# Turn is skipped if Pursuit was used during switch
if @effects[PBEffects::Pursuit]
@effects[PBEffects::Pursuit]=false
pbCancelMoves
pbEndTurn(choice)
@battle.pbJudge # @battle.pbSwitch
return false
end
# Use the move
# @battle.pbDisplayPaused("Before: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
PBDebug.log("#{pbThis} used #{choice[2].name}")
PBDebug.logonerr{
pbUseMove(choice,choice[2][email protected])
}
# @battle.pbDisplayPaused("After: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
return true
end
line 3400 end
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
I don't that kind of error message it just says syntax error

Spoiler:

line 3400 end

Put your script between ['spoiler']['code']HERE, EXAMPLE['/code']['/spoiler'], without " ' "

So, Syntax error could be did you forgot to insert a 'end';'if'; 'elsif'; 'else' or something like that. Check your script again.
 
180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
the disguise script gives me this error:
---------------------------
Error
---------------------------
Script 'Interpreter' line 276: RuntimeError occurred.

Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

Exception: NameError

Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

***Full script:

pbWildBattle(:MIMIKYU,4)


Interpreter:243:in `pbExecuteScript'

EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

PokeBattle_Battle:2082:in `pbOnActiveAll'

PokeBattle_Battle:2081:in `each'

PokeBattle_Battle:2081:in `pbOnActiveAll'

EliteBattle_0:256:in `pbStartBattleCore'

PokeBattle_Battle:2353:in `pbStartBattle'

PField_Battles:98:in `pbWildBattle_ebs'

PField_Battles:97:in `pbSceneStandby'

PField_Battles:99:in `pbWildBattle_ebs'


---------------------------
Aceptar
---------------------------
 

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
the disguise script gives me this error:
Spoiler:
Spoiler:


So, I can't tell you exactly what's wrong with your script, but this error message references pbAbilitiesOnSwitchIn, which my script doesn't touch at all. So I would start there.
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
the disguise script gives me this error:
---------------------------
Error
---------------------------
Script 'Interpreter' line 276: RuntimeError occurred.

Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

Exception: NameError

Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

***Full script:

pbWildBattle(:MIMIKYU,4)


Interpreter:243:in `pbExecuteScript'

EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

PokeBattle_Battle:2082:in `pbOnActiveAll'

PokeBattle_Battle:2081:in `each'

PokeBattle_Battle:2081:in `pbOnActiveAll'

EliteBattle_0:256:in `pbStartBattleCore'

PokeBattle_Battle:2353:in `pbStartBattle'

PField_Battles:98:in `pbWildBattle_ebs'

PField_Battles:97:in `pbSceneStandby'

PField_Battles:99:in `pbWildBattle_ebs'


---------------------------
Aceptar
---------------------------

[/SPOILER]

So, I can't tell you exactly what's wrong with your script, but this error message references pbAbilitiesOnSwitchIn, which my script doesn't touch at all. So I would start there.

Its about EBS (Elite Battle System) script...
 

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
Its about EBS (Elite Battle System) script...
Ah, probably a good disclaimer then that I haven't tested this with EBS - only with base Essentials.

EDIT: but it still shouldn't interact with Abilities on Switch In
 
Last edited:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
the disguise script gives me this error:
Spoiler:

Done!

Just add ':DISGUISE' in 'if EFFECTMESSAGES' inside 'def pbAbilitiesOnSwitchIn(*args)':

Code:
  def pbAbilitiesOnSwitchIn(*args)
    if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,
                              :GRASSYSURGE,:ELECTRICSURGE,:MISTYSURGE,:PSYCHICSURGE,:SOULHEART,
                              :BEASTBOOST,:DESOLATELAND,:PRIMORDIALSEA,[COLOR="Red"]:DISGUISE,:BATTLEBOND,
                              :POWERCONSTRUCT[/COLOR])
      @battle.abilityTrick = self
    else
      @battle.abilityMessage = self
    end
    ret = pbAbilitiesOnSwitchIn_ebs(*args)
    @battle.abilityTrick = nil
    @battle.abilityMessage = nil
    return ret    
  end
 
Last edited:
180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
Done!

Just add ':DISGUISE' in 'if EFFECTMESSAGES' inside 'def pbAbilitiesOnSwitchIn(*args)':

Code:
  def pbAbilitiesOnSwitchIn(*args)
    if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,
                              :GRASSYSURGE,:ELECTRICSURGE,:MISTYSURGE,:PSYCHICSURGE,:SOULHEART,
                              :BEASTBOOST,:DESOLATELAND,:PRIMORDIALSEA,[COLOR="Red"]:DISGUISE,:BATTLEBOND,
                              :POWERCONSTRUCT[/COLOR])
      @battle.abilityTrick = self
    else
      @battle.abilityMessage = self
    end
    ret = pbAbilitiesOnSwitchIn_ebs(*args)
    @battle.abilityTrick = nil
    @battle.abilityMessage = nil
    return ret    
  end
it does not work... i got the same error
 
180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
I don´t know how but... It works now!
but the animation and the message of "mimikyu transformed" shows before and after mimikyu do any move...
Sometimes it shows twice
 
Last edited:

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
I don´t know how but... It works now!
but the animation and the message of "mimikyu transformed" shows before and after mimikyu do any move...
Sometimes it shows twice
Glad it's working!
If you're getting the message twice, you can look in the scripts you edited and see if the message is in there more than once. If it is, just remove it from wherever it's firing inappropriately.
A follow up question: is it possible that you had previously installed a Disguise script that uses a different method? That might lead to some of the issues you've encountered.
 
Back
Top