Game Development Community

How do sequence work?

by dArchitect · in Artist Corner · 03/06/2008 (12:49 pm) · 4 replies

Can anyone explain how sequences work within the scripts or the code or point me to post(s) that explain the process. I have tried everything and I still cannot get mine to work properly. The 2 sequences I am working with are root and death. What I have are:

sequence0 = "./character_root.dsq root";
sequence1 = "./character_death.dsq death";

Root works as it should but when the character dies Death is not called. I changed it to:

sequence0 = "./character_death.dsq root";
sequence1 = "./character_root.dsq death";

and I can watch my character continually dieing. I even changed it to:

sequence0 = "./character_root.dsq root";
sequence1 = "./character_death.dsq run";

and I can watch my character continually dieing as it's running. On top of the above I also changed death to dead and death1 through death12 and still nothing.

#2
03/08/2008 (9:04 am)
Death animations are called within script not the engine. So they won't be automatically called.

As in dArchitect case, the death animations calls in script are something like this

sequence9  = "./player_diehead.dsq death1";
   sequence10 = "./player_diechest.dsq death2";
   sequence11 = "./player_dieback.dsq death3";
   sequence12 = "./player_diesidelf.dsq death4";
   sequence13 = "./player_diesidert.dsq death5";
   sequence14 = "./player_dieleglf.dsq death6";
   sequence15 = "./player_dielegrt.dsq death7";
   sequence16 = "./player_dieslump.dsq death8";
   sequence17 = "./player_dieknees.dsq death9";
   sequence18 = "./player_dieforward.dsq death10";  
   sequence19 = "./player_diespin.dsq death11";

Since the script that calls the death animation looks like this

function Player::playDeathAnimation(%this)
{
   if (%this.deathIdx++ > 11)
      %this.deathIdx = 1;
   %this.setActionThread("Death" @ %this.deathIdx);
}

As you can see they all are prefixed with index from 1 - 11, so to fix your problem just add an index prefix to your death animation.

Aun.

*Edit , not prefix, hmmm postfix
#4
03/08/2008 (9:32 am)
Hahaha, exactly !