Hello.
This line will not work:
ActionSpeakString(IntToString(MyHD), TALKVOLUME_SHOUT);
because it would be added to the creature's action queue, and execute only after the script has finished running. The catch is that a dead creature has no action queue. Meaning that no queued action will work. Only instant-actions will carry out, because they do as the script is still running.
This should work, instead. I say *should* because 1) I can not check it right now, and 2) I rarely use SpeakString() anyway:
SpeakString (IntToString (MyHD), TALKVOLUME_SHOUT);
Should the above one not work, this other one will succeed for sure:
SendMessageToPC (GetFirstPC (), "DBG: OnDeath -- HD: " + IntToString (MyHD));
which outputs the dead creature's HD in your console. If you want to also see the creature's name (in case you multi-kill), you can use something like this:
SendMessageToPC (GetFirstPC (), "DBG: OnDeath (" + GetName (oCreature) + ") -- HD: " + IntToString (MyHD));
-fox
[edited]: errata corrige -- I should not post when it is this late
Modifié par the.gray.fox, 20 juin 2012 - 02:40 .