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

[Custom Feature Question] bag

etique

etique
268
Posts
6
Years
  • Age 36
  • Seen Oct 30, 2022
my game is based on Pokémon Ruby, with 3 options of players (Brendan, May and Wally), I wanted each one to have a type of bag, for a first player (bag1), second player (bag1f) and for the third player? ???
 

etique

etique
268
Posts
6
Years
  • Age 36
  • Seen Oct 30, 2022
did not give to understand my doubt ... but already looked at everything and I do not know how to do
 
1,677
Posts
8
Years
  • Age 23
  • Seen today
I guess you are using v16, because v17 has a different naming scheme.
you'll need to find the equivalent of these lines in PScreen_Bag in your copy of the game. (Best bet is looking for the $Trainer.isFemale?)
Code:
  def pbRefresh
    # Set the background image
    @sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.lastpocket}"))
    # Set the bag sprite
    fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f"))
    if $Trainer.isFemale? && fbagexists
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f")
    else
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}")
    end
Then you'll have to edit it to use the trainertype, because you can't check male/female as Wally is male.
I'd give an example but your code might be different anyway.
 

etique

etique
268
Posts
6
Years
  • Age 36
  • Seen Oct 30, 2022
and putting the mixed option to wally? it would not be neither male nor female. How could I do this?
 
1,677
Posts
8
Years
  • Age 23
  • Seen today
and putting the mixed option to wally? it would not be neither male nor female. How could I do this?

Yeah, I guess you can set wally to unknown. Just be aware that this will affect wally's text color.
Code:
  def pbRefresh
    # Set the background image
    @sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.lastpocket}"))
    # Set the bag sprite
    fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f"))
    ubagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_u"))
    if $Trainer.isFemale? && fbagexists
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f")
    elsif $Trainer.gender==2 && ubagexists
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_u")
    else
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}")
    end
But remember, this code is for a different version of essentials, or at least a different naming scheme.
it looks for the bag in Pictures/Bag, and in the format bag_1, bag_1_f (for female), or bag_1_u (for unknown gender)
 

etique

etique
268
Posts
6
Years
  • Age 36
  • Seen Oct 30, 2022
Yeah, I guess you can set wally to unknown. Just be aware that this will affect wally's text color.
Code:
  def pbRefresh
    # Set the background image
    @sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.lastpocket}"))
    # Set the bag sprite
    fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f"))
    ubagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_u"))
    if $Trainer.isFemale? && fbagexists
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_f")
    elsif $Trainer.gender==2 && ubagexists
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}_u")
    else
      @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.lastpocket}")
    end
But remember, this code is for a different version of essentials, or at least a different naming scheme.
it looks for the bag in Pictures/Bag, and in the format bag_1, bag_1_f (for female), or bag_1_u (for unknown gender)
I will not be home these days, just Monday, "this will affect the color of the wally text" why? there's no other way? Thank you!
 

Diverscope

Pardon me
152
Posts
11
Years
You can use "$Trainer.trainertype" instead of "$Trainer.isFemale?" to determine which Graphic to use. Since every choosable Character should have its own trainertype anyway, this shouldn't be a problem. Just make sure to you use the ID number of the trainertype (e.g the male and female player both have the id numbers 000 and 001 respectively) instead of the internal name.

Although you can just use "$Trainer.trainerTypeName" and then the internal name instead.
 
Back
Top