How do you configure weapon/armor resistances?

I have a wonderful little table of weapon types on one axis and armor types on another, with digits of 1 to 9 in each cell to show things like that chain mail resists piercing, plate mail resists slashing, but plate mail is way too conductive of heat to be much use around plasma weaponry. I'm now thinking about how I'm going to import this logic into RPG Maker, and am afraid I'll have to do insanely nested if statements to pull it off. It seems like there ought to be a logical way to do this. External call to an Excel table? Making an array in the weapon text field? Kind of interested in if you have had a similar problem, and how you solved it.
Why and where would you place the if statements? in the damage formula? that solution only works for one or two if-commands as the place in the damage formula is limited.


Instead, define the different damage types as elements and give each armor the feature to have reduced (or increased) elemental damage rates against that type of damage.


Each weapon can only be of one element (so a sword can do slashing damage, but not both slashing and piercing), but that would only require you to be carefull with the weapon design structure.


And then let the engine handle the rest automatically without any if statements.
But I have more than four (vulnerable, resistant, immune, absorb) levels of armor.....hrm. Maybe you're right and I'm overthinking it.
absorb needs either a script or a tricky damage formula.


Other than that: elemental rates are percentages.


0% damage means immune (this is multiplicative)


anything between 1% and 99% means reduced damage = resistant


anything above 100% means increased damage = vulnerable


just choose numbers you're comfortable with
Wrong subforum - implementation questions usually go in the appropriate Maker's "Support" subforum (such as VX Ace Help) because the answer will be different for every Maker.  You should specify what Maker you're asking about, so your thread can be moved.


In general, I'd parrot what Andar said - you can use Elements to set up armor resistances, and I think you can safely use them to include Weapons in this system as well (anything with the "Normal Attack" element should take whatever you have specified as your weapon's Attack Element in its Features box).  But this is only how it's done in the last few versions of RPG Maker - you'd have trouble setting it up perfectly in RMXP, for example.
Based on the info under your avatar...


I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.
I was looking for overall game theory, as there are a lot of ways to set this sort of thing up that have vastly different results. Not 'tell-me-how-to-do-resistances-in-MV'. But I guess you moved it after everyone was finished commenting, so no harm, no foul.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-configure-weapon-armor-resistances.67261/