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

How to make a Item to escape from battle

9
Posts
7
Years
    • Seen Sep 8, 2016
    Hello,

    i was searching a long time but nothig found about this... its possible to make a item that you can only use at a trainer battle to escape them?

    it would be very awesome if someone can help me...

    Sorry for my bad english :S
     
    296
    Posts
    9
    Years
  • Into PItem_ItemEffects script section, after these lines:

    Code:
    ItemHandlers::BattleUseOnBattler.add(:POKEDOLL,proc{|item,battler,scene|
       battle=battler.battle
       if battle.opponent
         scene.pbMessage(_INTL("Can't use that here."))
         return false
       else
         playername=battle.pbPlayer.name
         itemname=PBItems.getName(item)
         scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
         return true
       end
    })
    
    ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUFFYTAIL,:POKETOY)

    Add this:

    Code:
    ItemHandlers::BattleUseOnBattler.add(:YOURITEM,proc{|item,battler,scene|
       battle=battler.battle
       playername=battle.pbPlayer.name
       itemname=PBItems.getName(item)
       scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
       return true
       end
    })

    It should work for you.
     
    9
    Posts
    7
    Years
    • Seen Sep 8, 2016
    Thank you but i doesnt work for me i get syntax error and i dont know why ... here is my code:
    PokemonItemEffects
    ItemHandlers::BattleUseOnBattler.add(:POKEDOLL,proc{|item,battler,scene|
    battle=battler.battle
    if battle.opponent
    scene.pbDisplay(_INTL("Can't use that here."))
    return false
    else
    playername=battle.pbPlayer.name
    itemname=PBItems.getName(item)
    scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
    return true
    end
    })

    ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
    battle=battler.battle
    playername=battle.pbPlayer.name
    itemname=PBItems.getName(item)
    scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
    return true
    end
    })

    and here the items.txt
    532,FLUCHTSTEIN,FLUCHTSTEIN,8,9900,Mit diesen Stein kannst du flüchten wenn du ein Trainer Pokemon gefangen hast.,0,2,6,
    can you help me to find my failure?

    EDIT: Sorry im new in this only try to learn it plz help me :)
     
    1,224
    Posts
    10
    Years
  • Thank you but i doesnt work for me i get syntax error and i dont know why ... here is my code:
    PokemonItemEffects


    and here the items.txt

    can you help me to find my failure?

    EDIT: Sorry im new in this only try to learn it plz help me :)

    The syntax error was in Masters script that you copied

    Code:
    ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
       battle=battler.battle
       if battle.opponent
         scene.pbMessage(_INTL("Can't use that here."))
         return false
       else
         playername=battle.pbPlayer.name
         itemname=PBItems.getName(item)
         scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
         return true
       end
    })

    Or you could use the easier route
    Code:
    ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)
     
    824
    Posts
    8
    Years
  • The syntax error was in Masters script that you copied



    Or you could use the easier route
    Code:
    ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)

    Except I think he wants an item that allows him to flee a Trainer Battle (seems odd to me, but whatever). Which means the proper code is this:

    Code:
    ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
       battle=battler.battle
       if [COLOR="Red"]![/COLOR]battle.opponent
         scene.pbMessage(_INTL("Can't use that here."))
         return false
       else
         playername=battle.pbPlayer.name
         itemname=PBItems.getName(item)
         scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
         return true
       end
    })

    And copying the Poke Doll effect wouldn't work.
     
    9
    Posts
    7
    Years
    • Seen Sep 8, 2016
    Except I think he wants an item that allows him to flee a Trainer Battle (seems odd to me, but whatever). Which means the proper code is this:

    this is right i want a item that i can use to flee from a trainer battle....

    i used now you code "Rot8er_ConeX" but when i use my item "Fluchtstein" nothing happens i still in the battle.. =/

    whats wrong? i copy & paste your code in "PokemonItemEffects" it would be really nice when anyone can help me :)

    and thank you all for try to helping me
     
    Back
    Top