Limited usage of a weapon

I was wondering how one would go about making it so that a weapon could only be used in battle a couple of times?

For example, you aquire the weapon, you use it as many times as you wish during one battle, then a second battle, and then a third- but after the third, the weapon disappears, as if it has expired it's usage... It's different than an ammo system, that's not what I'm looking for, because I don't want it to involve skills, just the weapon itself.

Help?
That would be a pain to do. i've done something like that for one game. You will need troop events and variables. And a switch for this.

No matter what, it's going to require a skill that removes it. The skill can just be called "remove weapon". Nobody equips the skill, it is more of a behind the scenes action. I don't see this working without either a skill or script.
You can do it with scripts, but you will probably want to make each copy of an item unique.
Thats a great idea! why don't I try it out!
"Use skills, variables and a script code!!" yeah, um, that ain't very helpful, y'all...
"Use skills, variables and a script code!!" yeah, um, that ain't very helpful, y'all...
Alright then let's back up a bit. How much do you know about variables? Switches? How much do you know about skills?

Maybe this will be of more help to you in what I mean about using skills to control things that happen behind the scenes.

You say you want to avoid skills and maybe you would want to avoid scripts for this as well. In order to do this, you have to have a skill. That's the only way. I'll use an example from a split event I created.

There is an enemy that can split itself. In order to tell it to do this after a certain time, I have to create a skill. Not that it is to be used, but rather it is just to force an action.

This involves Common Events. You will need one of these along with your skill because the skill is going to call up the Common Event.

Make a variable for your weapon and call it weapon limit or usage limit. Have an event on a map that checks for the number of times the weapon was used. To avoid scripts you will have to create certain special skills that come as a bonus to the weapon being equipped, If this skill from this weapon is used, the variable "Usage Limit" will go up by 1. When it reaches a certain number, have the event either on a map or in a troop event of a battle, check for the variable being a certain number. When it hits that number, Force Action: Player, remove weapon.

That's the way to avoid scripts. I'm not sure on how tied up this particular action is to your story and how you want that to go but this is just a vague example that I can give for now. You need to give a bit more info as well so that someone can give you detailed instructions on how to do what you want, with some pics to help.
Alright then let's back up a bit. How much do you know about variables? Switches? How much do you know about skills?

Maybe this will be of more help to you in what I mean about using skills to control things that happen behind the scenes.

You say you want to avoid skills and maybe you would want to avoid scripts for this as well. In order to do this, you have to have a skill. That's the only way. I'll use an example from a split event I created.

There is an enemy that can split itself. In order to tell it to do this after a certain time, I have to create a skill. Not that it is to be used, but rather it is just to force an action.

This involves Common Events. You will need one of these along with your skill because the skill is going to call up the Common Event.

Make a variable for your weapon and call it weapon limit or usage limit. Have an event on a map that checks for the number of times the weapon was used. To avoid scripts you will have to create certain special skills that come as a bonus to the weapon being equipped, If this skill from this weapon is used, the variable "Usage Limit" will go up by 1. When it reaches a certain number, have the event either on a map or in a troop event of a battle, check for the variable being a certain number. When it hits that number, Force Action: Player, remove weapon.

That's the way to avoid scripts. I'm not sure on how tied up this particular action is to your story and how you want that to go but this is just a vague example that I can give for now. You need to give a bit more info as well so that someone can give you detailed instructions on how to do what you want, with some pics to help.
Thank you!! I'm gonna try this out!

I know about switches and skills, I was just wondering if it were possible to avoid 'em with a specific script, but I guess not.
For example, you aquire the weapon, you use it as many times as you wish during one battle, then a second battle, and then a third- but after the third, the weapon disappears, as if it has expired it's usage...
You could do a conditional check at the start of your battles to see if the party has the weapon.  If it does, just add to a variable you made so you could tell how many battles they have been in with it.  Then when the variable reaches 4, you could remove the weapon from the party.

For example:

In your battle event make a page and set the page conditions to Turn 0 + 0 *X and set the span to Battle.

Then in your event commands write:

Conditional Branch: [special Weapon] in inventory, Include Equipment

Control Variables: [battles with Weapon] += 1

Branch End

Conditional Branch: Variable: [battles with Weapon] == 4

Change Weapons: [special Weapon] -1, Include Equipment

Branch End

That sounds like it would get you the affect you're looking for.

.
You could do a conditional check at the start of your battles to see if the party has the weapon.  If it does, just add to a variable you made so you could tell how many battles they have been in with it.  Then when the variable reaches 4, you could remove the weapon from the party.

For example:

In your battle event make a page and set the page conditions to Turn 0 + 0 *X and set the span to Battle.

Then in your event commands write:

Conditional Branch: [special Weapon] in inventory, Include Equipment

Control Variables: [battles with Weapon] += 1

Branch End

Conditional Branch: Variable: [battles with Weapon] == 4

Change Weapons: [special Weapon] -1, Include Equipment

Branch End

That sounds like it would get you the affect you're looking for.

.
thank you so much 🙂

edit: not sure what you mean by set page conditions to turn 0 + 0?
thank you so much 🙂

edit: not sure what you mean by set page conditions to turn 0 + 0?
In your Troop Database you can write battle events for your battles.  It's similar to regular event pages, but they have a different set of conditions you can use at the top of the page.  And if you look at them closely you'll see the option to trigger the page by Turn No.  So if you set that to 0 + 0 that basically means the page will trigger at turn 0 - which is before any action takes place.  So at the very beginning of the battle.   I figured that would be best for what you are trying to do.  Though you can use a different condition if you want.  The same concept would apply.  Just make sure the variable is only counted once per battle, else it would mess up the timing of when you want the weapon to be removed.
In your Troop Database you can write battle events for your battles.  It's similar to regular event pages, but they have a different set of conditions you can use at the top of the page.  And if you look at them closely you'll see the option to trigger the page by Turn No.  So if you set that to 0 + 0 that basically means the page will trigger at turn 0 - which is before any action takes place.  So at the very beginning of the battle.   I figured that would be best for what you are trying to do.  Though you can use a different condition if you want.  The same concept would apply.  Just make sure the variable is only counted once per battle, else it would mess up the timing of when you want the weapon to be removed.
thanks, it worked! the weapon doesn't delete from the inventory until the 4th battle actually starts, though, but that's just fine

edit: changed it to 'when the end of the turn', works better now
thanks, it worked! the weapon doesn't delete from the inventory until the 4th battle actually starts, though, but that's just fine

edit: changed it to 'when the end of the turn', works better now
Yeah the way I showed you would decrease the weapon from the player's inventory at the very start of the fourth battle.  You can probably play around with it some to get the timing more to your preference.  If the When the end of the turn works better for you though, you may want to consider basing when the weapon is removed on battle turns rather actual battles.

If in the end if you decide you want the weapon removed at the very end of the third battle you can do that also.  It gets a little tricky depending on how your battle system is set up and how your encounters take place   Battles automatically end as soon all the enemies reach 0 HP.  But there are ways to get around that.  Though there is no need to get into that now unless you decide first that's what you want to do.
Seems this is working then.


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/limited-usage-of-a-weapon.16986/