The damage calculations in the Fallout games are very strange. For example, if I have
Source being whatever critter ran over or near the script hex, there are times when the source object is hit for 1 damage. I just tested it with 100 at the end, and it did 93 and 98 damage on the first two tests, respectively. On the third test, it did 4 damage. * This was tested with a naked character so it has nothing to do with armor.
It seems that both games randomize the damage so that the value at the end is the "max rolled value". In other words, explosion() rolls (1, X) where X is whatever value you put into DAMAGE_AMOUNT. Which is a really stupid way to do it. I get the feeling that the coders of Fallout and Fallout 2 didn't know this, because almost all scripts that use explosion() insert a "random(X, Y)" value in DAMAGE_AMOUNT. Why would you further randomize a random value?
FALLOUT1 METHOD: From what I can tell, this is the only way to simulate how explosion() actually should work, in Fallout1:
In Fallout 2 you could replace the "6" with damage type Explosion, so it would be
So you get the explosion sound and proper damage type and proper damage amount without the visual blast animation.
FALLOUT2 METHODS: (Or just scroll down)
by phobos2077: http://www.nma-fallout.com/showthread.php?201274&p=4004939&viewfull=1#post4004939
by JimTheDinosaur: http://www.nma-fallout.com/showthread.php?201274&p=4007953&viewfull=1#post4007953
Properly removing the effect after animation: http://www.nma-fallout.com/showthread.php?201274&p=4005147&viewfull=1#post4005147
Code:
explosion(TILE_NUM(source_obj), ELEVATION(source_obj), DAMAGE_AMOUNT);
It seems that both games randomize the damage so that the value at the end is the "max rolled value". In other words, explosion() rolls (1, X) where X is whatever value you put into DAMAGE_AMOUNT. Which is a really stupid way to do it. I get the feeling that the coders of Fallout and Fallout 2 didn't know this, because almost all scripts that use explosion() insert a "random(X, Y)" value in DAMAGE_AMOUNT. Why would you further randomize a random value?
FALLOUT1 METHOD: From what I can tell, this is the only way to simulate how explosion() actually should work, in Fallout1:
Code:
play_sfx("WHN1XXX1"); // explosion sound - Dynamite, etc.
critter_dmg(source_obj, random(MINIMUM_DAMAGE, MAXIMUM_DAMAGE), 6);
Code:
play_sfx("WHN1XXX1"); // explosion sound - Dynamite, etc.
critter_dmg(source_obj, random(MINIMUM_DAMAGE, MAXIMUM_DAMAGE), DMG_explosion);
So you get the explosion sound and proper damage type and proper damage amount without the visual blast animation.
FALLOUT2 METHODS: (Or just scroll down)
by phobos2077: http://www.nma-fallout.com/showthread.php?201274&p=4004939&viewfull=1#post4004939
by JimTheDinosaur: http://www.nma-fallout.com/showthread.php?201274&p=4007953&viewfull=1#post4007953
Properly removing the effect after animation: http://www.nma-fallout.com/showthread.php?201274&p=4005147&viewfull=1#post4005147
Last edited: