Advertiser Content

Custom Feature Question bag

Started by etique January 22nd, 2019 2:10 PM
  • 550 views
  • 8 replies

Vendily

Female
Seen 6 Hours Ago
Posted 7 Hours Ago
984 posts
4.3 Years
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?)
  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.

Vendily

Female
Seen 6 Hours Ago
Posted 7 Hours Ago
984 posts
4.3 Years
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.
  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

Seen 18 Hours Ago
Posted 2 Days Ago
216 posts
2.1 Years
Yeah, I guess you can set wally to unknown. Just be aware that this will affect wally's text color.
  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

Male
Germany
Seen 6 Hours Ago
Posted 6 Days Ago
148 posts
6.7 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.
Advertiser Content