Jump to content
Sign in to follow this  
Victim9l3

Armor value differences

Recommended Posts

While I was doing my config for my mod, I copied from other mods as examples and I found a difference with armor value for helmet and vests.

After my stuff was done, I looked at bi configs. I started changing values on my config (which was copied from a mod) and I started replacing the edited value from the mod with the values that bi has. That way my mod is closer to bi.

I noticed on several different mods the armor value is set up like this:

uniformModel="\A3\Characters_F\Common\equip_tacticalvest.p3d";

containerClass="Supply100";

mass=40;

armor="5*0.8";--------------------this value is quoted and isn't just a number

passThrough=1;

on bi the armor looks like this:

armor=20;-------------------------this value is a whole number and not quoted

So my question is why are they different and which should I use. What do the *and. mean?

Thanks

Share this post


Link to post
Share on other sites

The * is multiply in just about any programming language, so above is saying: 5 times 0.8. And that could actually be the difference in the two, BI's version is a standard integer, the other mod is basically running a very small calculation code which is incased in quotes, probably meaning that the engine can recongize both whole numbers and code for the armor variable. So somewhere in the backend that variable is being compiled and called before actually setting its value (compiling a string replaces quotes with { } which is then a function that can be called which will return some value, in this case an integer).

//input
"5*0.8"

//compile
{5*0.8}

//call
whatever 5 * 0.8 is

//variable value set
armor = #;

So if my logic is correct then you can use either :).

Edited by JShock

Share this post


Link to post
Share on other sites

Thanks. That makes sense. But it seems odd that someone would use a calculation of such a small number. You can do the math in your head in less than one second. Why not just put 40 instead of 5*0.8. And I looked at 5 other mods and every one of them used that calculation. Just with different numbers. It seems like they use "3*0.4" for helmets and "5*0.8" for vests. In fact for all the mods I looked at, bi is the only one that doesn't use that formula.

Share this post


Link to post
Share on other sites

It may be laziness on the mod makers side or they are going for as truly accurate as possible, I wouldn't know I've never made a mod :p.

Share this post


Link to post
Share on other sites

Just let me be a bit pedantic but 5*0.8 = 4, but that example can't be explained why it is set up lie that, but there is certain combinations that can yield numbers that can be expressed with integers, like if you want to reduce something with a third you could just input 1/3, which you can do for all numbers like that, and with numbers that contain a good amount of decimals it allows you, when you look at it, to round iit of where you feel is necessary: in functions and equations you really don't want to be rounding, so if you got function that turns X into 5/3's X you'd just input 5/3 in it instead of calculating it to what you think is the necessary digit count.

Share this post


Link to post
Share on other sites

Was always wondering the same thing. Short answer, Copy & Paste syndrome?

Longer answer, not sure. I agree, makes little sense to me. I have an unreleased Vest that I amped up the armor when OPFOR was way too deadly in the beginning. I just use a single number for armor values. I also wonder if ported or new mods are making their armor too weak by multiplying a fraction?

Share this post


Link to post
Share on other sites
It may be laziness on the mod makers side or they are going for as truly accurate as possible, I wouldn't know I've never made a mod :p.

No. BIS did it themself, then at some point for whatever reason they changed it. The modders just copied what BIS did at that time and some stuck with it i guess.

They propably used a makro/something to change all the 5's to scale armor protection up and down as multiplicatier for all armor at once, when they where not sure how high it should be and have the 0.8 to differenciate between armor types relative to eachother.

Edited by Fennek

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×