Defence Reduction Based on Variable

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
I'd like to start by saying thank you for taking the time to read my post.

I have my game set up with a bunch of skills by using game variables. Some of them being Unarmored, Light Armor, and Heavy Armor. I need a defense reduction based on these variables. So if I am wearing Light Armor Gloves with a defense of 6 and my Light Armor skill is 50, then that would be a 50% reduction and the defense would then be 6. I have five armor slots - Shield, Helmet, Armor, Gauntlets and Boots. I need the armor skill to reduce the defense on each individual slot, not the total defense. This is because I could be wearing Light Gloves, Heavy Armor and an Unarmored Helmet. I have the armor types registered to each armor if that helps.

Armor Types in Database

1 = Unarmored

2 = Light Armor

3 = Heavy Armor

If you also need the variable numbers that are used as the armor skill, here they are.

v 20 = Unarmored

v 22 = Light Armor

v 24 = Heavy Armor

I should also mention that the variables can be influenced by other factors to be increased beyond 100, so in that case there would be a defense bonus. For example, if I were wearing Heavy Gloves with a defense of 4 and had a Heavy Armor skill of 150, then I would have a 150% increase giving me 6 defense. I also want it to be rounded so that defense is not left with something like 3.2. If it is necessary, I am using Yanfly's Equip Engine.

Thank you very much in advanced! If you have any questions, please ask.
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
So say you have an Armor which you have given a defense of 10 in the database, if the corresponding variable is 50 this armor would only give 5 defense.

If you now look at the stats ingame should the armor show 10 or 5 in defense?

And regarding unarmored, how should the modifier work there? If you have nothing in a slot, it would give you zero defense more and lets say the unarmored variable have the value 100, how should the 100 effect the unarmored slot? 1.0 * 0 stays 0.
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
So say you have an Armor which you have given a defense of 10 in the database, if the corresponding variable is 50 this armor would only give 5 defense.

If you now look at the stats ingame should the armor show 10 or 5 in defense?

And regarding unarmored, how should the modifier work there? If you have nothing in a slot, it would give you zero defense more and lets say the unarmored variable have the value 100, how should the 100 effect the unarmored slot? 1.0 * 0 stays 0.
So say you have an Armor which you have given a defense of 10 in the database, if the corresponding variable is 50 this armor would only give 5 defense.

This is Correct

If you now look at the stats ingame should the armor show 10 or 5 in defense?

In game it should show the modified defense, so it would show 5 in this example.

And regarding unarmored, how should the modifier work there? If you have nothing in a slot, it would give you zero defense more and lets say the unarmored variable have the value 100, how should the 100 effect the unarmored slot? 1.0 * 0 stays 0.

When there is no armor, the unarmored modifier should not take effect. I don't know why I mentioned the nothing aspect. That has to do with another part of my skill system and I accidentally blurted it out in my original post. Disregard it. But I do have armors that are considered unarmored like robes and such that will need to have the modifier take affect.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
http://www.himeworks.com/2013/12/09/parameter-bonuses/


Parameter bonuses. Use formulas to define parameter modifications.


So just tag your equips or something with the appropriate formulas based on the equip type, actor's skill levels, etc.


Well in your case you're using variables to store those levels, so you can just plug in the variables in the formula.
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
http://www.himeworks.com/2013/12/09/parameter-bonuses/

Parameter bonuses. Use formulas to define parameter modifications.

So just tag your equips or something with the appropriate formulas based on the equip type, actor's skill levels, etc.

Well in your case you're using variables to store those levels, so you can just plug in the variables in the formula.
No I can't. It needs to be on the per equipment bases, not the total defense since I could be wearing a mix of different armor types.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Have you tried it? What isn't working?
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
Have you tried it? What isn't working?
Either using that script you gave me or using a formula, I can only modify total defense. I need the defense to be modified on each piece of equipment individually.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I don't understand the difference between the armor giving you an additional 20 def, and adding an additional 20 def to your actor directly via formula when you wear the armor.
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
I don't understand the difference between the armor giving you an additional 20 def, and adding an additional 20 def to your actor directly via formula when you wear the armor.
What? Did you even read the original post? I want a variable to act as a percentile decrease on each individual piece of armor. With a light armor skill of 75 and a piece of light armor That has 4 defense, that 75 light armor skill basically becomes 0.75 * 4 which ends up as 3. But not on the total defense since I could be wearing, for example, light gloves, unarmored boots and heavy helmet. So it NEEDS to be done to the individual armors, NOT the total defense. This cannot be done with formulas or the script you provided.

This is all stated in my original post.
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
What Tsukihime tried to say ...

a.armors.include?($data_armors[your_armor_id]) ? $game_variables[your_variable_id] : 0That IS the simple formula. Try to work around it. And don't forget to set all parameter bonuses into zero.

Well, you still need scripting knowledge though.

Btw, it's a nice idea
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
The script has been updated to support references to the object's own attributes.

For example, if you note-tag an armor, you can say

<param bonus: def>obj.params[3] * 10</param bonus>Which gives a parameter bonus based on the armor's def, which is parameter 3.In this case it simply multiplies it by 10 and adds that as the bonus.

So if the armor's def was 10, then you would receive 10 from the armor, and 100 from the bonus, for a total of 110 def.
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
What Tsukihime tried to say ...

a.armors.include?($data_armors[your_armor_id]) ? $game_variables[your_variable_id] : 0That IS the simple formula. Try to work around it. And don't forget to set all parameter bonuses into zero.

Well, you still need scripting knowledge though.

Btw, it's a nice idea
The script has been updated to support references to the object's own attributes.

For example, if you note-tag an armor, you can say

<param bonus: def>obj.params[3] * 10</param bonus>Which gives a parameter bonus based on the armor's def, which is parameter 3.In this case it simply multiplies it by 10 and adds that as the bonus.

So if the armor's def was 10, then you would receive 10 from the armor, and 100 from the bonus, for a total of 110 def.
Don't worry about it. Evgenij understands exactly what I want and is working in PM with me to make the script. Thank you anyways.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
So you're saying this isn't what you want either?
 

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
So you're saying this isn't what you want either?
Not exactly. I'm just saying that Evgenij is working with me to make a script. Which he did and I got what I want. He gave me a small bit of code that did what I wanted and only what I wanted. No extra features I wont be using or anything like that. So I would rather use his code over another full featured script.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
You should have said that from the start instead of saying that the script doesn't do what you want then, since it sounds like you weren't planning to even look at "another full featured script".


Well w/e works for you.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top