First an event handler that runs an ACS script with a random number attached to a graphic (BLD0, BLD1, etc.).
Code: Select all
class bh_EventHandler : EventHandler
{
override
void WorldThingDamaged(WorldEvent e)
{
if (e.thing && e.thing is "PlayerPawn")
{
e.thing.ACS_NamedExecuteAlways("bloodsplat", 0, Random(0,4), e.Damage, 0);
}
}
}
Code: Select all
#library "bloodyhud"
#include "zcommon.acs"
script "bloodsplat" (int fnum, int dam)
{
SetFont(StrParam(s:"BLD",d:fnum));
HudMessage(s:"A"; HUDMSG_FADEOUT, 0, CR_UNTRANSLATED, Random(0, 1.0), Random(0, 1.0), Random(0.5, 1.0), Random(0.5, dam << 16));
}
I don't see that ZScript captures exceptions or queries image resources (I certainly could have missed something), so adding images means changing Random() args in the event handler. Easy enough I guess, but I'm open to suggestions.
Anyway, this works with the gray death mod.