How to make an item usable for few times?

Hello everyone,

I am looking for a way to make an item usable X times.

1- Item disappear after X times used.
2- Item break after X times used.
3- Item have x% chance to be consumed.
4- Item have x% chance to break.
5- A mix of 1/2 and 3/4, Item have x% chance to break/consume after using it X times.

For example, you use iron pickaxe 5 times then it breaks, or fishing rod have 5% chance to break, or some tool have 20% chance to break after using it 5 times...etc
Because you once posted in the wrong section, so this is for VX Ace or MV?
Regardless, you can try to use a variable whenever you use the item.

For every time pickaxe is used, increase the variable by 1
If the variable value is 5, remove the item.
xD no worries I am paying more attention to where I post now.
Where do i set the variables and the condition tho?
attach a common event to the item. Add the variables & condition there.
This will only solve consume/break item after X uses, but what about the x% chance to break? Is there a formula i can use?
A common event can be used for all of your conditions.

Code:
Control Variables [0005: Random] = Random between 1 and 100
Conditional Branch: Variable [0005: Random] <= 25   (if you want to give it a 25% chance)
  # break the item
End
I've done this but it doesn't make the common event (I added it to the item)
Common event :
Sd8q3Ng


Event :

kajnID5
I would call the common event after the value was increased in the event not attach it to the item.
Of course you could put all of this in a common event and call that from the event.
I would call the common event after the value was increased in the event not attach it to the item.
Of course you could put all of this in a common event and call that from the event.
I could do that for tools because i will be using them on the field, but for other items that will be used on the menu, I need the common event to work when i add it on the item, so the question is, will the variable increase/decrease when i use the item from the menu?
I could do that for tools because i will be using them on the field, but for other items that will be used on the menu, I need the common event to work when i add it on the item, so the question is, will the variable increase/decrease when i use the item from the menu?
"add it on the item" What are you doing exactly?
Calling a common event when you use an item is possible, just put that in the items effects
"add it on the item" What are you doing exactly?
Calling a common event when you use an item is possible, just put that in the items effects

the common event will work once i use the item? ^^ i've never used this method before that's why i am asking
Where is the +1 to the variable? That should be right before you do the conditional branch. I can't see your second image for some reason.
Where is the +1 to the variable?
z3tNgnf.jpg
Thanks - can see it now 🙂

I'm sorry - I didn't read your full post and made the assumption you were using the item in battle. That would cause the common event to be called. Because you're not "using" the item (from the menu or battle), but are just doing a check to see if it exists, it's not triggering the common event. So you need to specifically call it.

Try this, and see how it goes ...

Put ALL the logic into the common event (call it Mine Iron Ore or something like that)

Code:
Conditional Branch: [Iron Pickaxe is Present]
  Play SE: 'Earth1', 60, 90
  Change Item: [Iron Ore] + 1
  Display Scrolling Text: +1 Stone
  Control Variables: [0262: Iron Pickaxe Value] += 1
  Conditional Branch: Variable [0262: Iron Pickaxe Value] == 3
    Play SE: 'Break', 80, 10
    Display Text: "The pickaxe has broken"
    Change Item: [Iron Pickaxe] -1
    Control Variables: [0262: Iron Pickaxe Value] = 0
  End
Else
  Display Text: "You need a pickaxe to mine stones"
End

then in all of your stone events, just have a Common Event command to call the Mine Iron Ore common event.

That way, if you want to change something, you've only got to change it in the common event, and not go through all your maps searching for all the events to change.
the logic into the common event
I hesitate to ask as it might look like hijacking, but I can't find Display scrolling text in my event commands. Is there a difference between steam and store version? All I see is Show scrolling text which gives me Text(S)
the logic I put there was partly based on what the OP already had, and what I remembered, and some were guesses. Treat my "code" more as pseudocode rather than actual event commands. I believe there are also some commands that have one thing on the command button, but when you put it into your event it displays as something different. Like Conditional Branch in MV just displays IF once the command is added to the event.

I don't have my Ace with me right now (at work) to check.
I hesitate to ask as it might look like hijacking, but I can't find Display scrolling text in my event commands. Is there a difference between steam and store version? All I see is Show scrolling text which gives me Text(S)
Don't really know if there is a difference, but it should be on First tab, Message section 5th option

Put ALL the logic into the common event (call it Mine Iron Ore or something like that)

Code:
Conditional Branch: [Iron Pickaxe is Present]
Play SE: 'Earth1', 60, 90
Change Item: [Iron Ore] + 1
Display Scrolling Text: +1 Stone
Control Variables: [0262: Iron Pickaxe Value] += 1
Conditional Branch: Variable [0262: Iron Pickaxe Value] == 3
Play SE: 'Break', 80, 10
Display Text: "The pickaxe has broken"
Change Item: [Iron Pickaxe] -1
Control Variables: [0262: Iron Pickaxe Value] = 0
End
Else
Display Text: "You need a pickaxe to mine stones"
End
then in all of your stone events, just have a Common Event command to call the Mine Iron Ore common event.
Thanks a lot, this will save me too much time, and it does exactly the job i want.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-item-usable-for-few-times.103312/