MV How do you call an actions ID in it's damage formula?

How do you call an actions ID in it's damage formula?

I want an action to reduce remove an item from the inventory with an ID equal to that of the ID of the skill being used
If the item's ID is a specific one, you may wish to call its ID as opposed to the action. Could you tell us a little more about the skill?
If the item's ID is a specific one, you may wish to call its ID as opposed to the action. Could you tell us a little more about the skill?
Every armor gives a different skill.
When the skill is used it removes one copy of the armor from the inventory
if there are no copies in the inventory, it consumes the copy equipped

I made the skill id's match the armor id's hoping i could tell the formula to do something like this:
"$gameParty._armors[Skill ID] -= 1"
How do you call an actions ID in it's damage formula?
when entering the damage formula, you know which skill it is for - you can simply read that number from the screen of the editor where you enter it, and then use it as a number.

so your question is either useless or (more likely) incomplete - assuming that you don't want to know the ID at the moment that you enter it, but a placeholder for something else.
and in that second case, we'll need a much better description on what you really want.

edit - ninja'd, but that is still not enough details as you would still know which skill is on which armor when entering the damage formula.
when entering the damage formula, you know which skill it is for - you can simply read that number from the screen of the editor where you enter it, and then use it as a number.

so your question is either useless or (more likely) incomplete - assuming that you don't want to know the ID at the moment that you enter it, but a placeholder for something else.
and in that second case, we'll need a much better description on what you really want.

edit - ninja'd, but that is still not enough details as you would still know which skill is on which armor when entering the damage formula.
There are over 100 skills that would have their id referenced.
I was hoping to not have to punch them all in manually
One question: do you use auto battle in your game at all? Because if you do, this will have some unwanted side effects you should be aware of.
Can't you fix this with calling a common event in the "effect" box, and your event would do
Change Armor: "your armor name" decrease 1 ?
One question: do you use auto battle in your game at all? Because if you do, this will have some unwanted side effects you should be aware of.
no I do not
Can't you fix this with calling a common event in the "effect" box, and your event would do
Change Armor: "your armor name" decrease 1 ?
That is what i am currently doing but that means having 100+ common events to manage, i am hoping to be able to reference the skill ID somehow so that i can make a generic method.
@Walldeaf that would be even more work than writing the numbers out

@ginfubawuba so it's basically just to prevent you from entering the numbers manually a hundred times into the editor?

In that case I would do something entirely different: use excel or a similar calculation program to prepare the damage formula for copying.
make a spreadsheet where the damage formula is constructed from a number, drag that down to get the hundred lines of the different damage formulae, and then copy/paste from the spreadsheet to the damage formula of the appropiate skill
@Walldeaf that would be even more work than writing the numbers out

Making a game in RPGMaker is a lot of work 🙂
@Walldeaf that would be even more work than writing the numbers out

@ginfubawuba so it's basically just to prevent you from entering the numbers manually a hundred times into the editor?

In that case I would do something entirely different: use excel or a similar calculation program to prepare the damage formula for copying.
make a spreadsheet where the damage formula is constructed from a number, drag that down to get the hundred lines of the different damage formulae, and then copy/paste from the spreadsheet to the damage formula of the appropiate skill
The best option i can see is to have one common event that does the heavy work but have the formula set a variable to the skill ID so the common event knows which corresponding armor to change
Just use "this.item().id", that'll return the ID of the currently-executing skill.
Just use "this.item().id", that'll return the ID of the currently-executing skill.
Thank you, works perfectly!
I must admit I always find it hilarious when I read topics like this where a bunch of people write absolutely genius and really convoluted methods of doing something with event commands, common events and the like and then I burst in with a one-line solution. XD
I must admit I always find it hilarious when I read topics like this where a bunch of people write absolutely genius and really convoluted methods of doing something with event commands, common events and the like and then I burst in with a one-line solution. XD
Yeah, I've seen that done a few times, and I think I even chimed in with a simple solution myself once. I'm lazy so I'm all about that efficiency when and where I can get it. Of course, in my case I think it was a case of already working with similar means of minutiae-reducing so I was not only already in the right mindset, but with recent script info in my head.
Making a game in RPGMaker is a lot of work 🙂
All the more reason for that work to be done efficiently 😛

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-call-an-actions-id-in-its-damage-formula.134963/