• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Scripting Question] Confusion held item

NanaelJustice

AbsoluteXandy
  • 64
    Posts
    6
    Years
    I was trying to do a held item that confuses the Pokémon using it copying the codes for Toxic Orb, but it only gives me a crash.
    I added that on PokeBattle_Battle after the flame orb code.
    Code:
          # Imakuni Coin
          if i.hasWorkingItem(:IMAKUNICOIN) && i.status==0 && i.pbCanConfuse?(nil,false)
            PBDebug.log("[Item triggered] #{i.pbThis}'s Imakuni Coin")
            i.pbConfuse(nil,_INTL("{1} was confused by its {2}!",i.pbThis,
                PBItems.getName(i.item)),true)
          end

    This is the error that pops up when the item is activated.
    [PokeCommunity.com] Confusion held item

    If I change the "i.pbConfuse" to "i.pbBurn" or "i.pbPoison" it gives the effects, but Confuse doesnt seems to work.
     
    I think confuse takes slightly different arguments. If you Ctrl-Shift-F for def pbBurn/def pbPoison and compare it to def pbConfuse you can probably work out which ones (if any) you need to pass, and in which order.
    I just found an example of move that confuses the user and tried to convert it as a held item... and it worked!
    Code:
    if i.hasWorkingItem(:IMAKUNICOIN) && i.pbCanConfuseSelf?(false)
            PBDebug.log("[Item triggered] #{i.pbThis}'s Imakuni Coin")
            i.pbConfuse
            pbDisplay(_INTL("{1} was confused by its {2}!",i.pbThis,PBItems.getName(i.item)))
          end

    EDIT: Also, I love the name of your item!!
    I'm glad you like it, I couldn't let this opportunity for using his name pass lol
     
    Back
    Top