• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

Continuous usage of a item until it runs out

~Angel~

Lead developer for Pokémon Millennium
  • 281
    Posts
    15
    Years
    Hm..Is it possible to do a continuous usage of a item such as oh let's say Rare Candy. Let's say I have 3 Rare candies and I use 2 out of the 3 and I run out on the 3rd one. A message would appear (Just like B/W) and say you used the last of your (Insert item name here) in this case Rare candies. Or like if I used one Item/Rare candy and it would not send me back to the bag screen until either my pokemon are maxed out in either level or no pokemon are able to be healed by the Item. All though I can see it being difficult, Held Item's would involve something completely different. Held item's would use the same message and the same thing but once given to the pokemon it would change back to the bag screen. Some people must know what I am talking about. If not the take a look at the B/W item's selection.~.~ My weak point is writing, so some of this might not make sense XD Thank's for the help I will put you in my credit's instantly.
     
    I understood it pretty clearly. You're just referring to the Pokemon B/W item use method where you can use more than a single item at a time.

    This has been briefly discussed in the past, but a thread was never made about it as it's a feature that, obviously next to no one would say shouldn't be implemented. Unfortunately, it's not implemented yet, and I don't know how right of the bat. I could figure it out, but I'm afraid I don't have the time as of late.
     
    Hm..Is it possible to do a continuous usage of a item such as oh let's say Rare Candy. Let's say I have 3 Rare candies and I use 2 out of the 3 and I run out on the 3rd one. A message would appear (Just like B/W) and say you used the last of your (Insert item name here) in this case Rare candies. Or like if I used one Item/Rare candy and it would not send me back to the bag screen until either my pokemon are maxed out in either level or no pokemon are able to be healed by the Item. All though I can see it being difficult, Held Item's would involve something completely different. Held item's would use the same message and the same thing but once given to the pokemon it would change back to the bag screen. Some people must know what I am talking about. If not the take a look at the B/W item's selection.~.~ My weak point is writing, so some of this might not make sense XD Thank's for the help I will put you in my credit's instantly.

    I understood it pretty clearly. You're just referring to the Pokemon B/W item use method where you can use more than a single item at a time.

    This has been briefly discussed in the past, but a thread was never made about it as it's a feature that, obviously next to no one would say shouldn't be implemented. Unfortunately, it's not implemented yet, and I don't know how right of the bat. I could figure it out, but I'm afraid I don't have the time as of late.

    No problem. I was just wondering maybe if it was going to be and if not if I could get a script on it. That's another B/W thing I wanted to put in my game. :D Thanks for the reply. Check out some of my other threads.
     
    So what are you looking for?

    If you use a POTION for example, you want to be able to use 3 at one time instead of using the one, going back to bag, using another, etc.?

    Or did you just want to use RARE CANDY, until your Pokémon levels up to the max level or you run out of RARE CANDY, or POTION until the Pokémon reaches total HP, or IRON until stat max's out... Because I don't think you want to do it this way, which is how I read it...
     
    So what are you looking for?

    If you use a POTION for example, you want to be able to use 3 at one time instead of using the one, going back to bag, using another, etc.?

    Or did you just want to use RARE CANDY, until your Pokémon levels up to the max level or you run out of RARE CANDY, or POTION until the Pokémon reaches total HP, or IRON until stat max's out... Because I don't think you want to do it this way, which is how I read it...
    Have you played B/W? I am talking about how nintendo made the game using their meteods like You use any item except Tm's and Key item's/Pokeball's and held Items. I am saying any healing items/Level/Stat increasers.
     
    BW doesn't interest me... So no!

    But scripting is all the same whether I've played BW or not! But I just wanted to know what you were hoping to get.
     
    So what are you looking for?

    If you use a POTION for example, you want to be able to use 3 at one time instead of using the one, going back to bag, using another, etc.?

    Or did you just want to use RARE CANDY, until your Pokémon levels up to the max level or you run out of RARE CANDY, or POTION until the Pokémon reaches total HP, or IRON until stat max's out... Because I don't think you want to do it this way, which is how I read it...

    No, he wants to be able to use any item more than once for a particular pokemon, like one is able to do in BW. The rarecandy is just an example.
     
    One thing I can promise is it's not going to be a single script you slap in. It's got to be much more technical than that to work, since to make it function we'll have to edit what Essentials has in it already. I haven't checked, but this may even include item effects (If the item effects themselves are what triggers the game returning to the bag).

    I'm about to look into it now, I have some basic idea of what to do.
     
    Last edited:
    One thing I can promise is it's not going to be a single script you slap in. It's got to be much more technical than that to work, since to make it function we'll have to edit what Essentials has in it already. I haven't checked, but this may even include item effects (If the item effects themselves are what triggers the game returning to the bag).

    I'm about to look into it now, I have some basic idea of what to do.

    Really? All right Haha I have not checked this for a while.
     
    Actually, that was pretty easy.

    In PokemonItems, find the following def: def pbUseItem(bag,item)
    Find these lines:

    Code:
    if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 break if ret==true
               end
    Replace with:

    Code:
    if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 bag.pbDeleteItem(item)
                 Kernel.pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) if @bag.pbQuantity(item) == 0
                 break if @bag.pbQuantity(item) == 0
               end
    Now find this lines:

    Code:
    if ret && $ItemData[item][ITEMUSE]==1
          bag.pbDeleteItem(item)
        end
    Replace the entire set with

    Code:
    if @bag.pbQuantity(item) == 0
        return ret ? 1 : 0
        end
    This should work.
     
    I tested and works fine for me, tested on Rare Candys. :) Thanks IceGod64
     
    I have used this script, but the item disappears though the message says that it does not have effect in the Pokemon. For example, to use Potion in a Pokemon with all the Hit Points. (HP)
     
    Actually, that was pretty easy.

    In PokemonItems, find the following def: def pbUseItem(bag,item)
    Find these lines:

    Code:
    if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 break if ret==true
               end
    Replace with:

    Code:
    if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 bag.pbDeleteItem(item)
                 Kernel.pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) if @bag.pbQuantity(item) == 0
                 break if @bag.pbQuantity(item) == 0
               end
    Now find this lines:

    Code:
    if ret && $ItemData[item][ITEMUSE]==1
          bag.pbDeleteItem(item)
        end
    Replace the entire set with

    Code:
    if @bag.pbQuantity(item) == 0
        return ret ? 1 : 0
        end
    This should work.

    I have used this script, but the item disappears though the message says that it does not have effect in the Pokemon. For example, to use Potion in a Pokemon with all the Hit Points. (HP)

    I was just about to say, this will always remove the item, I.E if an IRON was used, EV BERRY, anything, will still be removed despite no effect...

    But TACHAN covered this haha.

    I understand what you want now... I just never played BW, so I was asking what exactly you wanted!
     
    I was just about to say, this will always remove the item, I.E if an IRON was used, EV BERRY, anything, will still be removed despite no effect...

    But TACHAN covered this haha.

    I understand what you want now... I just never played BW, so I was asking what exactly you wanted!

    Get it o3o...One of my favorite games.
     
    Ok i found fixes :)

    Code:
     if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 if ret && $ItemData[item][ITEMUSE]==1
                 bag.pbDeleteItem(item)
                 Kernel.pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) if @bag.pbQuantity(item) == 0
                 end
                 break if @bag.pbQuantity(item) == 0
               end
     
    Ok i found fixes :)

    Code:
     if !pbCheckUseOnPokemon(item,pokemon,screen)
                 pbPlayBuzzerSE()
               else
                 ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen)
                 if ret && $ItemData[item][ITEMUSE]==1
                 bag.pbDeleteItem(item)
                 Kernel.pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) if @bag.pbQuantity(item) == 0
                 end
                 break if @bag.pbQuantity(item) == 0
               end
    Lol :D I will add that into it right away :D I am still looking for a scripter btw ;D
     
    Back
    Top