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

Costume System Help

PiaCRT

Orange Dev
939
Posts
13
Years
  • Okay, hello everyone. I have evented a costume system and everything works fine overworld-wise. I have created the appropriate backsprites and trainer sprites (trback095; trainer095, respectively), but when I check my trainer card or go into battle, they won't show up and stay as the original character's backsprite and trainer sprite.

    Do I need to implement this myself? If so, how?

    Thank you,
    Pia Carrot.
     
    189
    Posts
    14
    Years
    • Seen Nov 23, 2023
    I'm about as far as you can get from a good scripter, but I would assume you need to have a variable modifier to suit each "costume" then go find the code that displays the trainer image in the relevant places and put some if statements pertaining to said variable.

    You might be able to figure it out by looking at the code, if not then just wait for a few days and see if anyone else replies. I'll do it myself if it comes to that but it won't be pretty.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    I would have said that implementing the overworlds was harder than just changing the sprites. I assume you've got a variable somewhere that decides what outfit the player is currently wearing, and it's used to decide which charsets to show.

    The answer is self-evident: find where the trainer sprites are shown, and change the code.
     

    PiaCRT

    Orange Dev
    939
    Posts
    13
    Years
  • Actually, I've just been using pbChangePlayer(1) or whatever that bit of code is. I haven't used any kind of variable.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    The trainer sprites used depend on the trainer type, while the charsets (which you've changed) depend on whatever you've files you've named in metadata.txt. Each different version of the player needs its own trainer type. I suspect you've defined PlayerA, PlayerB, etc. with different charsets, but given them all the same trainer type (PkMnTRAINER_Male or PkMnTRAINER_Female).
     

    PiaCRT

    Orange Dev
    939
    Posts
    13
    Years
  • Correct.
    # See the documentation at notes.html to learn how to edit this file.
    0,PkMnTRAINER_Male,PkMn TRAINER,100,,,,Male
    1,PkMnTRAINER_Female,PkMn TRAINER,100,,,,Female
    and then

    92,PkMnTRAINER_MINT,PkMn TRAINER,100,,,,Female
    93,PkMnTRAINER_KRIS,PkMn TRAINER,100,,,,Female
    94,PkMnTRAINER_PIKA,PkMn TRAINER,100,,,,Female
    95,PkMnTRAINER_MAY,PkMn TRAINER,100,,,,Female
    Now, is this possibly due to them not being marked by a gender?
    Please note there is no male hero. The 1st trainer is simply a null.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Turns out it's a problem with Essentials. Find the def pbChangePlayer, and include the red line:

    Code:
    def pbChangePlayer(id)
      return false if id<0||id>=8
      meta=pbGetMetadata(0,MetadataPlayerA+id)
      return false if !meta
      [COLOR=Red]$game_player.trainertype=meta[0][/COLOR]
      $game_player.character_name=meta[1]
      $game_player.character_hue=0
      $PokemonGlobal.playerID=id
    end
     

    PiaCRT

    Orange Dev
    939
    Posts
    13
    Years
  • Which script is the def located in? I'm having trouble locating it >.>

    I appreciate your help, Maruno.

    EDIT: Nevermind, found it. Thanks for all the help!

    EDIT 2: I'm guessing this is because of the amount of players I have:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: RuntimeError

    Message: Script error within event 9, map 87 (Cosplay Emporium):

    Exception: NoMethodError

    Message: Section136:1621:in `pbChangePlayer'undefined method `trainertype=' for #<Game_Player:0x9c928e0>

    ***Full script:

    pbChangePlayer(5)


    Interpreter:243:in `pbExecuteScript'

    (eval):1:in `pbExecuteScript'

    Interpreter:1592:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:1592:in `command_355'

    Interpreter:493:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:103:in `update'



    Interpreter:275:in `pbExecuteScript'

    Interpreter:1592:in `command_355'

    Interpreter:493:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:103:in `update'

    Scene_Map:101:in `loop'

    Scene_Map:114:in `update'

    Scene_Map:68:in `main'



    This exception was logged in

    C:\Users\Jacob\Saved Games/Pokemon Essentials/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     
    Last edited:

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Which script is the def located in? I'm having trouble locating it >.>

    I appreciate your help, Maruno.

    EDIT: Nevermind, found it. Thanks for all the help!

    EDIT 2: I'm guessing this is because of the amount of players I have:

    The error you got happens for me too.

    trainertype is defined as a parameter for $Trainer, but not $game_player.

    Try $Trainer.trainertype = meta[0] instead.
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Works like a charm, thanks IceGod64!

    Oh, actually, it doesn't. I found testing just now that results in a crash on creating a new game. With that said, I've got one more fix. I've tested this one in both making a new file and changing a player in-game, and it works completely this time.

    $Trainer.trainertype = meta[0] if $Trainer
     

    PiaCRT

    Orange Dev
    939
    Posts
    13
    Years
  • Odd, it worked just fine for me (only tested it on PlayerE >.>) But I'll use that code instead since it's probably more stable xD
     
    Back
    Top