Page 2 of 2
Posted: 04 Oct 2006, 04:29
by SpikedHelmet
Seems to me it would be easy enough to put a random tag in HitByWeapon or something, that one in every 100 hits, calls one of those nifty called-by-script weapons to explode, killing the unit... that would be very simply, wouldn't it?
Posted: 04 Oct 2006, 07:15
by yuritch
rattle wrote:yuritch: Why not use
Code: Select all
is_critical=rand(0,1);
sleep 100;
instead?
This code is better than mine (more random), but it gives 50% chance of a critical hit. This:
Code: Select all
is_critical=(rand(0,5)==1);
sleep 100;
should be better (1/6 chance as in my example). Only I'm not sure Scriptor understands such expressions, so this:
Code: Select all
rand_val=rand(0,5);
if(rand_val==1)
{
is_critical=1;
}
if(!rand_val==1)
{
is_critical=0;
}
sleep 100;
is probably what will work.
Posted: 04 Oct 2006, 11:15
by rattle
Code: Select all
#define CRITICAL_HIT_RATE 5
...
...
if (rand(1, 100) <= CRITICAL_HIT_RATE) bIsCritical = TRUE;
else bIsCritical = FALSE;
sleep zzZ;
Slightly shorter, should work as well.
PS:
Code: Select all
rand_val=rand(0,5);
if(rand_val==1)
{
is_critical=1;
}
if(!rand_val==1)
{
is_critical=0;
}
sleep 100;
This is a 1 in 6 chance to change the is_critical var back to 0 and it's a 1 in 6 chance to be a critical hit. So when a critical hit occurs it will stay a critical hit unless rand_val is 0. So it's not quite what you wanted... I guess.
Posted: 04 Oct 2006, 11:58
by KDR_11k
Yes but this only allows critical hits, not more fine-grained damage variation.
Posted: 04 Oct 2006, 22:01
by esteroth12
yeah... you should be able to select faces (or add it to a layer on texture 2 for s3o) and make them weak points, and in the .fbi define how weak the weak point is... (or on the tex layer it depends on how dark/light it is)
Posted: 04 Oct 2006, 22:22
by rattle
A random damage multiplier would be definitely a start, ranging from 0.5 to 1.5 for instance, and a chance tag on when a critical hit occurs. A ninja type of unit with mediocre damage could have a fixed 1.5 multiplier and a 25% chance while a more clumsy unit with rather high damage output could get a 0.5 to 1.5 multiplier range and a 10% critical hit chance. Not too difficult code-wise.
Posted: 05 Oct 2006, 09:28
by redcoat
Critical hits is only (passibly) admissible if it displays text saying something mod defined such as <CH>... (i think rattle already pointed this out).
And ++1 to spikedhelmet's idea: how the heck is effectiverange not in the TA engine yet? That can be used by anything that even vaguely wants to resemble RL, and adds another element of strategy. Stay at range and fight, or rush in for the quicker kills?
Posted: 05 Oct 2006, 18:57
by rattle
Yeah I sort of did point it out.
It's not in yet because the devs got their hands full I guess. Features, fixes, fixing borked patches... just take a look at the bug tracker. Why don't you volounteer to make a code patch?
my incredible mind reading ability tells me you seem to like Pink Floyd...
Posted: 05 Oct 2006, 23:21
by Snipawolf
Well, ya know "What if" or something by Creed has the same lyrics as his location line...
Posted: 06 Oct 2006, 02:48
by bwansy
esteroth12 wrote:randomness is the reason I hate risk... KEEP IT OUT OF SPRING!!!!!!!!!!!!!!!!!!
Inaccuracy is randomness, too. When you play Spring, are you using guided weapons exclusively, build dozens of radar targetting facilities, and micro-manage (or even FPS) every single unit in order to eliminate any randomness?
Moreover, it is not randomness at all, it is realism. What would cause the "randomness" is, again, inaccuracy, plus other factors which, too, have already been existing in Spring from the very beginning, in the OTA era.
+1 for critical hits, although it would potentially make the game slower.
Posted: 06 Oct 2006, 02:54
by Soulless1
esteroth12 wrote:randomness is the reason I hate risk... KEEP IT OUT OF SPRING!!!!!!!!!!!!!!!!!!
I really don't get why people can't understand that engine features are different to mod features

Posted: 06 Oct 2006, 07:37
by Zoombie
If you don't want randomness then don't play against other people, because people are very randomn...
Posted: 06 Oct 2006, 10:12
by Soulless1
this would really need to be a new engine feature though, there's only so much you can do with scripting...
How bout a simple 'randomdamage=0/1' tag to enable it, with 'mindam=x' and 'maxdam=y' tags where x and y are like 0.5 and 1.5 etc (they are proportions of the default damage) - the engine just generates a random number between x and y
maybe later also 'complexdamage=0/1' and a way to specify the equation of a curve (eg a bell curve, but but you could use whatever equation you wanted). The engine would generate a random point on the X-axis (using the above tag) and read off the Y-axis value (which would be the damage proportion) at that point. Complex, yes (hence the name of the tag

) but highly customisable and could probably be used for many other randomised features other than damage.

Posted: 06 Oct 2006, 13:05
by rattle
Why's everyone complaining about it? It's not that it should be enforced, it's a goddamn option! You can deactivate options (or simply have them deactivated by default).
Posted: 06 Oct 2006, 18:36
by KDR_11k
Soulless: I think a mindamagemultiplier would make more sense, specify the max damage in the damage section and the minimum is defined by a multiplier. That way there's only one multiplier and the damage values actually have a meaning.
Posted: 07 Oct 2006, 00:48
by Snipawolf
Soulless1 wrote:this would really need to be a new engine feature though, there's only so much you can do with scripting...
How bout a simple 'randomdamage=0/1' tag to enable it, with 'mindam=x' and 'maxdam=y' tags where x and y are like 0.5 and 1.5 etc (they are proportions of the default damage) - the engine just generates a random number between x and y
maybe later also 'complexdamage=0/1' and a way to specify the equation of a curve (eg a bell curve, but but you could use whatever equation you wanted). The engine would generate a random point on the X-axis (using the above tag) and read off the Y-axis value (which would be the damage proportion) at that point. Complex, yes (hence the name of the tag

) but highly customisable and could probably be used for many other randomised features other than damage.

We would need something to determin the randomness of the crits.. However I like this layout..
Posted: 07 Oct 2006, 17:22
by redcoat
rattle wrote:
Why don't you volounteer to make a code patch?
my incredible mind reading ability tells me you seem to like Pink Floyd...
If it weren't for a lack of free-time, I would. Last time I touched spring was two weekends ago when I got the code to compile (yah!), but I haven't gotten it to run yet (boo!). And I haven't played it in three weekends. :/
But if I end up with some time on my hands (hahaha) I'd be more than happy to do some coding for spring.
And yes, me like pink floyd. Among others.
