• 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] Info for Item’s

107
Posts
3
Years
    • Seen Apr 27, 2023
    Extra info would be nice on Item's besides Pokemons.
    Where could I add information to an item, such as the date it was obtained?
    or even simple information like the way it was obtained.
    Whether found or received.
    For that I know that being found is pbItemBall
    and received pbReceiveItem.
    so where would be the ideal place to add this?
     
    1,406
    Posts
    10
    Years
    • Seen today
    What are you asking exactly? Like where to display this information for the player? Or where to literally add the code to make this possible?
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    What are you asking exactly? Like where to display this information for the player? Or where to literally add the code to make this possible?

    In class PokeBattle_Pokemon
    we have attributes that define the Pokémon, such as the mode it was obtained in:
    attr_accessor :obtainMode # Manner obtained:

    I would like to add an attribute of this to the item's.
    So that when using pbReceiveItem the player has this item as received and pbItemBall the player has it as found.

    About how to reproduce this information, I can, I would just like to know the place to determine this.
    I also wonder if I have a Pokeball and I received it. But later I found some on the floor by pbItemBall.

    How would I reproduce the information of one or the other if they are grouped in the bag?
     
    1,406
    Posts
    10
    Years
    • Seen today
    How would I reproduce the information of one or the other if they are grouped in the bag?
    You can't, really. You would have to treat each individual item as its own "object", just like how each Pokemon are considered separate entities even if they are the exact same species, with the exact same stats and attributes. So if you find a Potion, it would have to be a completely unique item that exists in the bag independently of another Potion, even though they're the exact same item.

    Or I suppose, you would create several different variations of an item. Say, you have two classes of "Potion". One that is found, and one that is received. So in the bag they are listed as separate objects despite being the same item, and you can have multiples of each variation of this item. The only difference between them would be that one would be flagged as "found" and the other would be flagged as "received". So you could have 999 "found" Potions, and 999 "received" Potions in the bag, as they occupy different slots.
     
    Back
    Top