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

[Scripting Question] Key Item to change Player Outfit

15
Posts
5
Years
    • Seen Sep 24, 2020
    Hello Community, I hope someone would be able to help me here. I've been working on a new Key Item for a while. My Goal is to have a Key Item that changes the Player Outfit.

    I can acheive that effect through scripts using theScript: $Trainer.outfit=X
    Where X resembles the Number of The Outfit under /Graphics/Characters

    However I have no idea how to let a Key Item trigger this Effect, there is no Item using a similiar function in PItem_Itemeffects.

    I was able to create a Key Item in the PBS Items file and give it to a player. It just doesn't have the wanted effect yet.

    How would I go from here on?

    I'd be thankful for advice or assistance.
     
    50
    Posts
    5
    Years
  • I actually want to know the exact same thing as the OP, so someone please hurry and help us out lol
    I definitely want my character to be able to wear a disguise allowing access to certain parts of the map that you wouldn't be able to normally access.
    Like sneaking into the evil team base disguised as a grunt.
     

    Pokeminer20

    PDM20, Coder of Chaos!
    412
    Posts
    10
    Years
  • Code:
    ItemHandlers::UseInField.add(:CLOTHE1NAME,proc{|item|
       $PokemonBag.pbChangeItem(:CLOTHE1NAME,:CLOTHE2NAME)
       Kernel.pbMessage(_INTL("You changed your outfit"))
       $Trainer.outfit=1
    })
    
    ItemHandlers::UseInField.add(:CLOTHE2NAME,proc{|item|
       $PokemonBag.pbChangeItem(:CLOTHE2NAME,:CLOTHE1NAME)
       Kernel.pbMessage(_INTL("You changed your outfit"))
       $Trainer.outfit=0
    })

    >_>
     
    Last edited:
    15
    Posts
    5
    Years
    • Seen Sep 24, 2020
    This script works like a charm, thank you a lot!

    Short Installation Guide for other beginners:
    1. Create 2 Key Items in items.txt (tutorials for that are on youtube) - 1 can be your normal clothes, 2 can be a new outfit (your choice)
    2. Paste the script from Pokeminer20 into the scripts editor under PItem_ItemEffects below UseFromBag Handlers
    3. Replace Clothenames inside the script with the internal name of your clothes (for example you defined the casual clothes as "CASUAL" so you replace it with "CASUAL"
    4. Add a way to give the player the key item, save, and done!
     
    Back
    Top