- 68
- Posts
- 6
- Years
- Seen Aug 25, 2023
Hi! Well, i was trying to make 2 moves but it gives me error and i don't know why. I think everything is ok but it just give an error, it say "clone" or something. These are the moves: One is a DoT and one is a Selfheal like recover (but heals 1/4 instead of 1/2)
These are the scripts:
and this is the error (for both)
Exception: TypeError
Message: can't clone Fixnum
DrawText:915:in `clone'
DrawText:915:in `getLineBrokenChunks'
DrawText:1088:in `drawTextEx'
PScreen_Summary:743:in `drawSelectedMove'
PScreen_Summary:960:in `pbMoveSelection'
PScreen_Summary:904:in `loop'
PScreen_Summary:962:in `pbMoveSelection'
PScreen_Summary:1244:in `pbScene'
PScreen_Summary:1231:in `loop'
PScreen_Summary:1298:in `pbScene'
Any idea of whats wrong? :( And ty.
Spoiler:
772,CORRUPTION,Corruption,ZF8,0,DARK,Status,100,15,0,00,0,bce,"Corrupts the target inflicting damage each turn for 5 turns."
772,HEAL,Heal,MD5,0,FAIRY,Status,0,10,0,10,0,d,"Heals the user a little."
772,HEAL,Heal,MD5,0,FAIRY,Status,0,10,0,10,0,d,"Heals the user a little."
These are the scripts:
Spoiler:
class PokeBattle_Move_ZF8 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if opponent.effects[PBEffects::Corruption]>0
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::Corruption]=5
@battle.pbDisplay(_INTL("{1} was corrupted!",opponent.pbThis))
return 0
end
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if opponent.effects[PBEffects::Corruption]>0
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::Corruption]=5
@battle.pbDisplay(_INTL("{1} was corrupted!",opponent.pbThis))
return 0
end
end
Spoiler:
class PokeBattle_Move_MD5 < PokeBattle_Move
def isHealingMove?
return true
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hp==attacker.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored..",attacker.pbThis))
return 0
end
end
def isHealingMove?
return true
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hp==attacker.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored..",attacker.pbThis))
return 0
end
end
and this is the error (for both)
Spoiler:
Exception: TypeError
Message: can't clone Fixnum
DrawText:915:in `clone'
DrawText:915:in `getLineBrokenChunks'
DrawText:1088:in `drawTextEx'
PScreen_Summary:743:in `drawSelectedMove'
PScreen_Summary:960:in `pbMoveSelection'
PScreen_Summary:904:in `loop'
PScreen_Summary:962:in `pbMoveSelection'
PScreen_Summary:1244:in `pbScene'
PScreen_Summary:1231:in `loop'
PScreen_Summary:1298:in `pbScene'
Any idea of whats wrong? :( And ty.
Last edited: