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

Trainer card and badges, outfits and time system.

  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    Okay so I looked through the wiki and other posts and couldn't figure this out.
    Is there someone that can help me change it so instead of badges showing up on the trainer card, they show up when I select an item instead, and shows all badges?
    Not all of my regions use 8 badges and they aren't all badges.

    (Completed) -- Now for the outfits for the trainer. I made new graphics for everything I need but when I use both the call script and the debug outfit change, nothing happened.

    (Completed) -- For my last problem, how exactly do I check for the current day?
    I try to have it set up so events only happen on certain days of the month(ex. Your birthday or Christmas) and I can't make it check for just the day of the month, only the month itself or day of the week.

    I hope I cleared this up enough but if not, tell me what isn't clear.



    EDIT:
    Check list for the outfit system.
    Make sure you check what names you have for each graphic you are changing in "metadata.txt"
    On all of the graphics for that character, delete the ".png" suffix from each name, then on the form graphic themselves, add "_1", "_2", etc. respectively for each for the over world sprites, the map icon, AND the trainer back sprite.
    Then DO NOT make my mistake when calling the form change, pay close attention to the capitalization of the call script.
    $Trainer.outfit=x where x=the form you want. 0 is the default.
    Do not add "_0" to the base form, that way if something happens, it can take the base for as a default.
    If you still need help, look for the post saving raven left here for how to use it.
     
    Last edited:
  • 1,224
    Posts
    10
    Years
    1. You'd have to change the script for your trainer card, PokemonTrainerCard, so that it doesn't create those sprites. I'd imagine removing this would work.
    Code:
    imagePositions=[]
        for i in 0...8
          if $Trainer.badges[i+region*8]
            imagePositions.push(["Graphics/Pictures/badges",x,310,i*32,region*32,32,32])
          end
          x+=48
        end
    To make an item that does this instead, you'll have to make a new scene for it. Take a look at this post by FL to learn the basics of creating a new scene, and the item handlers here (by the FL also) to see an example of how to access a new scene by using an item.

    2. Are you using
    Code:
    $Trainer.outfit=id #where id is an integer
    ? If so, then my first guess is that you haven't defined these new players in your metadata.

    3. Use pbGetTimeNow to get the current time (as returned by the user's clock). Note that this uses the Time class, from which you can use any of the instance methods on this new instance of the class you created.
    Code:
    newtime=pbGetTimeNow
    if newtime.month==12 && newtime.day==25
    Kernel.pbMessage(_INTL("Merry Christmas!"))
    end
     
    Last edited:
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    As for the first part, I will have to try that out tomorrow evening after work.

    Part 2. I am not setting them up as different players, but as "forms" of the player. I did everything it showed in the wiki under "outfits", but when I use the script call or the debug option, it stays as my default.

    And 3. What if I wanted it to be equal to a variable?
     
  • 1,224
    Posts
    10
    Years
    Edit: Realized that method doesn't do what I thought it did. Literally just setting $Trainer.outfit equal to the proper integer should do the trick.

    Then test if it's equal to that variable? I just gave you an example of how to use it, there's a countless amount of other things you could do with it.
     
    Last edited:

    Savordez

    It's time to end fangames.
  • 115
    Posts
    10
    Years
    When I set $Trainer.outfit to the proper integer, only the walking player sprite changes. Nothing else does. All the other graphics have the same _1 (or _2) after them.
     

    Radical Raptr

    #BAMFPokemonNerd
  • 1,124
    Posts
    13
    Years
    Make sure, in the actual text file of the Metadata, not in the editor, that the files selected are named exactly the same, ie, trchar000 is not the same as trchar000.png
    Every file must have the same name to work correctly.
     
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    As far as the outfits go, I have made absolute certain that everything is named properly, and I have tried using $Trainer.Outfit.

    I will redo a bunch of it then try again and report back.
    After that we will go from there
     
  • 1,224
    Posts
    10
    Years
    As far as the outfits go, I have made absolute certain that everything is named properly, and I have tried using $Trainer.Outfit.

    I will redo a bunch of it then try again and report back.
    After that we will go from there

    $Trainer.outfit, not $Trainer.Outfit . Capitalization is important.
     
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    @mej
    I think that's what my problem is
    I just got back to my computer so I'm going to try it
     
  • 19
    Posts
    9
    Years
    • Seen Aug 23, 2015
    3. Use pbGetTimeNow to get the current time (as returned by the user's clock). Note that this uses the Time class, from which you can use any of the instance methods on this new instance of the class you created.
    Code:
    newtime=pbGetTimeNow
    if newtime.month==12 && newtime.day==25
    Kernel.pbMessage(_INTL("Merry Christmas!"))
    end

    Sorry, but how would you use this in an event? A certain day you talk to the event and it says whatever, or gives you something? I thought a conditional branch, but that got me no where. No good at this sort of thing. Would you mind explaining?
     
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    Sorry, but how would you use this in an event? A certain day you talk to the event and it says whatever, or gives you something? I thought a conditional branch, but that got me no where. No good at this sort of thing. Would you mind explaining?

    That's my problem too. I mean I can sort of use this in an event as is, but no matter what I do, I can't make it temporary without making the game crash.

    Also no matter what I do with the outfit system, I can't make it work. And now I can't even find the wiki article about the outfit...

    Guess for now I'll just try to fix my problem with the badges.
    By the way, those links I was sent to were confusing.
     
  • 1,224
    Posts
    10
    Years
    Sorry, but how would you use this in an event? A certain day you talk to the event and it says whatever, or gives you something? I thought a conditional branch, but that got me no where. No good at this sort of thing. Would you mind explaining?

    I don't think this will fit in a conditional branch (in the Script part of it), but you have multiple options. Easiest would be to make this a method. Put it above the main as a new section.

    Code:
    def pbIsChristmas?
    newtime=Time.now  #you could also say pbGetTimeNow, but this is faster and more direct.
    if newtime.month==12 && newtime.day==25
    return true
    else
    return false
    end
    end
    then you could just put pbIsChristmas? as you conditional branch (in the script part of it. )

    You could also run the the previous script as an event, there's a "Scripts" option on the third page of event commands, which has a lot more room than the one in conditional branches. Instead of Kernel.pbMessage just use a command to give you an item or whatever you want it to do.
     
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    It's supposed to be used for making someone show up only once per year.
    The ways you are doing this makes it unlimited times as long as it is on that day.
     
  • 19
    Posts
    9
    Years
    • Seen Aug 23, 2015
    Code:
    def pbIsChristmas?
    newtime=Time.now  #you could also say pbGetTimeNow, but this is faster and more direct.
    if newtime.month==12 && newtime.day==25
    return true
    else
    return false
    end
    end
    then you could just put pbIsChristmas? as you conditional branch (in the script part of it. )

    That worked fine. Thank you. This is great for making an event run on a specific date, but can you just change it to work whenever it's a certain day of the week? I tried

    Code:
    if newtime.Weekday==Monday

    and got an error. Is there a way to set this up?

    Tsaku: If you only want it to happen once on the day can't you just set the event's self switch on so it won't show up after the first time?
     
  • 1,224
    Posts
    10
    Years
    That worked fine. Thank you. This is great for making an event run on a specific date, but can you just change it to work whenever it's a certain day of the week? I tried

    Code:
    if newtime.Weekday==Monday

    and got an error. Is there a way to set this up?

    Tsaku: If you only want it to happen once on the day can't you just set the event's self switch on so it won't show up after the first time?

    you want
    Code:
    newtime=Time.now
    if newtime.wday==1 #1 is monday, 2 is tuesday, etc
    Kernel.pbMessage(_INTL("Monday"))
    end
    or
    Code:
    newtime=Time.now
    day=newtime.strftime("%A")
    if day=="Monday"
    Kernel.pbMessage(_INTL("It is Monday"))
    end
    you can find all the built in methods in RGSS by pressing F1 and searching. I forgot to mention that the RGSS library is not up to date with the current edition of Ruby, so not all classes will have the same functions as what you may find online.
     
  • 19
    Posts
    9
    Years
    • Seen Aug 23, 2015
    you want
    Code:
    newtime=Time.now
    if newtime.wday==1 #1 is monday, 2 is tuesday, etc
    Kernel.pbMessage(_INTL("Monday"))
    end
    or
    Code:
    newtime=Time.now
    day=newtime.strftime("%A")
    if day=="Monday"
    Kernel.pbMessage(_INTL("It is Monday"))
    end
    you can find all the built in methods in RGSS by pressing F1 and searching. I forgot to mention that the RGSS library is not up to date with the current edition of Ruby, so not all classes will have the same functions as what you may find online.

    Thanks for explaining that, works perfectly. And thank you for pointing out that search thing. Looked at the time stuff and everything starting making a lot more sense.
     
  • 26
    Posts
    9
    Years
    • Seen Nov 14, 2023
    Ok, the time system problem is taken care of.
    Now I just need to figure out how to do the trainer card thing because removing that section brought up and error, and see if the outfit system will ever work on this version.
     
  • 1,224
    Posts
    10
    Years
    Ok, the time system problem is taken care of.
    Now I just need to figure out how to do the trainer card thing because removing that section brought up and error, and see if the outfit system will ever work on this version.

    Is the error this line
    Code:
    pbDrawImagePositions(overlay,imagePositions)
    imagePositions=[] was in what I said to remove, so it hasn't been defined and will result in an error
     
    Back
    Top