Hello. I've been trying to make those death animations work right, but all I could do was making my own character play them.
I'll show you that chunk of code. Someone should know more than I do about this stuff.
if(not isKo && anim2 == ANIM2_3D_DEAD_PRONE_FRONT) cr.Animate(0, ANIM2_3D_KNOCK_FRONT);
if(not isKo && anim2 == ANIM2_3D_DEAD_PRONE_BACK) cr.Animate(0, ANIM2_3D_KNOCK_BACK);
if (cr.Stat[ST_GENDER] == 0) RunServerScriptUnsafe("debug@unsafe_specialdeath",0,293,0,null,null);
if (cr.Stat[ST_GENDER] == 1) RunServerScriptUnsafe("debug@unsafe_specialdeath",0,296,0,null,null);
if(not isKo && cr.Stat[ST_GENDER] == 0 && anim2 == ANIM2_3D_DEAD_LASER) PlaySound("HMXXXXBI.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 1 && anim2 == ANIM2_3D_DEAD_LASER) PlaySound("HFXXXXBI.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 0 && anim2 == ANIM2_3D_DEAD_FUSED) PlaySound("HMXXXXBM.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 1 && anim2 == ANIM2_3D_DEAD_FUSED) PlaySound("HFXXXXBM.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 0 && anim2 == ANIM2_3D_DEAD_BURST) PlaySound("HMXXXXBG.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 1 && anim2 == ANIM2_3D_DEAD_BURST) PlaySound("HFXXXXBG.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 0 && anim2 == ANIM2_3D_DEAD_BLOODY_SINGLE) PlaySound("HMXXXXBD.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 1 && anim2 == ANIM2_3D_DEAD_BLOODY_SINGLE) PlaySound("HFXXXXBD.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 0 && anim2 == ANIM2_3D_DEAD_BLOODY_BURST) PlaySound("HMXXXXBF.ACM");
if(not isKo && cr.Stat[ST_GENDER] == 1 && anim2 == ANIM2_3D_DEAD_BLOODY_BURST) PlaySound("HFXXXXBF.ACM");
cr.Animate(0, anim2, item);
cr.Animate(0, anim2, item);
This is the line I need to change.
if (cr.Stat[ST_GENDER] == 0) RunServerScriptUnsafe("debug@unsafe_specialdeath",0,293,0,null,null);
It says that if the critter's gender is male, then run that script called unsafe_specialdeath with parameter 1 set to 293. Then that other script has only this line:
player.ChangeCrType(param1)
What I need to do is this.
if (cr.Stat[ST_GENDER] == 0) cr.ChangeCrType(293)
Change the critter type directly from the main script. But somehow this does not work, and I get a script initialization error when starting the game.
What's wrong? why does this function work in the other script but not in this one?
You can download it and work on the script. If you get it working let me know.
Thanks for reading.
PS: just realised how many lines there are for playing sounds
.