Solved Gen 7 Scripts problems

Posts
53
#1
I'm trying to insert this move on my game using this:
# Paste this somewhere in PokeBattle_MoveEffects:

################################################################################
# The user's next move will be a critical hit
################################################################################
class PokeBattle_Move_CF18 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.effects[PBEffects::LaserFocus]>0
@battle.pbDisplay(_INTL("But it failed!"))
return -1
else
attacker.effects[PBEffects::LaserFocus]=1
@battle.pbDisplay(_INTL("{1} began focusing hard!",attacker.pbThis))
return 0
end
end
end


# Next, paste this line in PBEffects (Change the number to the lowest number that's not used)

LaserFocus = 113


# In PokeBattle_Battler, paste this line directly under "def pbEffectsOnMoveEnd":

user.effects[PBEffects::LaserFocus]-=1


# In PokeBattle_Move, paste this uner "def isCritical?":

return true if attacker.effects[PBEffects::LaserFocus]>0

But I can't seem to find where "def EffectsOnMoveEnd" is. I tried using CTRL+Shift+F, nothing. How do I fix it? Do I have to insert it myself? If yes, how?
EDIT: I put all of the scripts in the resource (exept for the codes I can't put because I don't have certain codes) and now it does this error:
---------------------------
Pokemon Unleashed
---------------------------
Error de Script PokeBattle_MoveEffects en la línea 10011 de tipo 'SyntaxError'.
---------------------------
OK
---------------------------

Please, I need help, I'm desperate. :(
 
Last edited:

Marin

kinda done
Administrator
Posts
308
#4
- My gen 7 code was messy and a pain to set up to begin with, hence I discontinued it about a year ago.
- Even then, there was an explicit note that Laser Focus was broken.
 
Posts
53
#5
- My gen 7 code was messy and a pain to set up to begin with, hence I discontinued it about a year ago.
- Even then, there was an explicit note that Laser Focus was broken.
Yeah, I found out recently that you discontinued the script. Well, I guess I'll wait until another resource for gen 7 comes out.
By the way, I remember you saying about 2 months ago that you were working on BW2 mods for v17, how's that going?
 

Marin

kinda done
Administrator
Posts
308
#6
Yeah, I found out recently that you discontinued the script. Well, I guess I'll wait until another resource for gen 7 comes out.
By the way, I remember you saying about 2 months ago that you were working on BW2 mods for v17, how's that going?
Working on it whenever I feel like it. Pause menu and save screen should be about done. I'll be busy for another two months at least probably, because of game jam and vacation. Will see if I can upload is ASAP.
 
Posts
53
#7
Working on it whenever I feel like it. Pause menu and save screen should be about done. I'll be busy for another two months at least probably, because of game jam and vacation. Will see if I can upload is ASAP.[/QUOTE
Working on it whenever I feel like it. Pause menu and save screen should be about done. I'll be busy for another two months at least probably, because of game jam and vacation. Will see if I can upload is ASAP.
Cool, looking forward to it :D
 

MillaLya

The Seagaroo
Member
Posts
5
#8
Sorry for necroposting, but I'll put how I fixed Laser Focus here in case anyone met the same problem.

Follow what's in the pack till you've set up the effect in PBEffects

Then in PokeBattle_Battler, find this line:
Ruby:
@effects[PBEffects::FocusEnergy] = 0
and add this right under it
Ruby:
@effects[PBEffects::LaserFocus] = 0
Finally in PokeBattle_Move, find this
Ruby:
  def pbIsCritical?(attacker,opponent)
and add
Ruby:
    if attacker.effects[PBEffects::LaserFocus]>0
      attacker.effects[PBEffects::LaserFocus]=0
      return true
    end
right under that line.
-------------------------------------
Also, that pbEffectsOnMoveEnd was introduced here.
 
Last edited:
Top