MATH!!! |
So, I'm working on my own personal mod (it started as a simple change in numbers of engines in relation to ship size and has...grown...)
I thought that some of the work I've done might be of use to other modders. I've tried to define things for everyone, and present it in a coherant format. There are two falloff systems, first a linear dropoff, which is a sloping line. Second is an exponential decay curve, which is a sloping curve-thing (ooohhh! technical words!.
So, here is some notes on math for weapon dropoff:
WARNING, THE FOLLOWING MAY CAUSE HEADACHES, ANGER, FRUSTRATION, DIZZYNESS, AND/OR A FUNNY FEELING IN YOUR SHORTS!
PROCEED AT YOUR OWN RISK!

New content type

Math formulas
To get the < and > signs to show properly, please type the following without any spaces:
< is & l t ;
> is & g t ;
Or use the new mode the admin has FINALLY provided us.
_______________________
There are 10 types of people in the world:
Those that understand binary, and those that don't.




Linear
This is the math for a weapon to drop off in damage according to linear dropoff.
Definitions:
m is damage modifier from levels.
p is percentage of m which applies, as expressed by a number from 0.00 (for 0%) to 1.00 (for 100%).
r is the percentage of the range of the weapon as it relates to its maximum possible range, as expressed by a number from 0.00 (for 0%)
to 1.00 (for 100%). Example: Max range is 60, then 30 is 50% of 60 (one half), so r = 0.5.
f(m) = damage by level * (p)
f(p) = 1 - (a * r)
f(r) = range formula
Notes:
a is the point where the ammount of damage delta floor. a = 0.5 = 50% damage.
Script function definitions:
Power is the formula command for exponents. Power (A, B) means A to the power of B. Squareing something would be Power (A, 2).
Cubing would be Power (A, 3). Another text notation for this would be A^B.
iif is an if - then - else command. iif(A, B, C) = if A is true, do B, otherwise do C.
Min is take the minimum of two values. Min(A, B) = take the minimum of A or B, whichever is lower.
So, iif([%Range%] Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)
(23 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 1.67) - iif([%Range%] > Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)
Simplified formulas:
iif([%Range%]