Limited usage of a weapon

Status
Not open for further replies.

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
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?
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,556
Reaction score
3,811
First Language
English
You can do it with scripts, but you will probably want to make each copy of an item unique.
 

Momo_Mccloud

Crusader
Veteran
Joined
Aug 16, 2013
Messages
94
Reaction score
6
First Language
C++ & HTML
Primarily Uses
Thats a great idea! why don't I try it out!
 

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
"Use skills, variables and a script code!!" yeah, um, that ain't very helpful, y'all...
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
"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.
 
Last edited by a moderator:

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
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.
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
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.

.
 
Last edited by a moderator:

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
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
 
Last edited by a moderator:

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Celianna

Tileset artist
Global Mod
Joined
Mar 1, 2012
Messages
10,554
Reaction score
5,576
First Language
Dutch
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our program, who art in memory,
Called by thy name;
Thy operating system run;
Thy function be done at runtime as it was on development.
Give us this day our daily output.
And forgive us our code duplication,
as we forgive those who
duplicate code against us.
And lead us not into frustration;
But deliver us from GOTOs.
For thine is algorithm,
The computation, and the solution,
Looping forever and ever.
Return;
NeoPGX wrote on Kes's profile.
Oh hey I just saw your comment on my profile status update.

The thing is I have twitter set up mark all my content as being potentially sensitive by default. I do it as a precaution even though I very rarely upload any such content.
I'm the fly in your soup
I'm the pebble in your shoe
I'm the pea beneath your bed
I'm the bump on every head
I'm the peel on which you slip
I'm the pin in every hip
I'm the thorn in your side
Makes you wriggle and writhe
And it's so easy when you're evil
bro how do I have over 30 OCs
A good way to mix your own music? What's the learning curve on that?
Would it be better to pay a composer?

Forum statistics

Threads
103,267
Messages
998,456
Members
134,770
Latest member
Trons_0091
Top