home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / anim / crouch_walk.scr < prev    next >
Encoding:
Text File  |  2002-10-21  |  1.9 KB  |  75 lines

  1. //-------------
  2. // Crouch_walk
  3. //-------------
  4. // Walk while crouching.  If not crouching, be sure to crouch first.
  5.  
  6. //println "Entering crouch_walk.scr"
  7.  
  8. //=================================================
  9. //=================================================
  10. start:
  11.  
  12.     waitexec anim/default_inithandler.scr
  13.     waitexec anim/smoking.scr::SmokeRemoveCigarette
  14.  
  15.     //make sure we are crouching...
  16.     // If you're crouching, just start crouch-running.  If you're walking or running, don't 
  17.     // bother stopping in order to crouch down, just crouch while you continue to move.
  18.     waitexec anim/crouch.scr::transition
  19.  
  20.     self.position = crouchwalk
  21.     
  22.     while (1)
  23.     {
  24.         self.blendtime = 0.30
  25.  
  26.         switch (self.weapongroup)
  27.         {
  28.             pistol:
  29.                 self setmotionanim pistol_crouchwalk
  30.                 self waittill flaggedanimdone
  31.                 break
  32.             rifle:
  33.             mp40:
  34.             mp44:
  35.             bar:
  36.             thompson:
  37.             bazooka:
  38.                 if (self.movedir != (0 0 0))
  39.                 {
  40.                     //println "Crouchwalk.scr using motion blend with movedir: " self.movedir
  41.                     waitexec anim/motionblend.scr::PlayAnim "walk_crouch_"
  42.                 }
  43.                 else
  44.                 {
  45.                     //println "Crouchwalk.scr with **NO** motion blend"
  46.                     self setmotionanim walk_crouch_forward
  47.                     self waittill flaggedanimdone
  48.                 }
  49.                 break
  50.             
  51.             grenade:
  52.             unarmed:
  53.                 if (self.movedir != (0 0 0))
  54.                 {
  55.                     //println "Crouchwalk.scr using motion blend with movedir: " self.movedir
  56.                     waitexec anim/motionblend.scr::PlayAnim (self.weapongroup + "_crouch_walk_")
  57.                 }
  58.                 else
  59.                 {
  60.                     //println "Crouchwalk.scr with **NO** motion blend"
  61.                     self setmotionanim (self.weapongroup + "_crouch_walk_forward")
  62.                     self waittill flaggedanimdone
  63.                 }
  64.                 break
  65.                     
  66.             default:
  67.                 println "CrouchWalk default case for " self.weapongroup " weapongroup - fix Crouchwalk.scr"
  68.                 self setmotionanim unarmed_crouch_walk_forward
  69.                 self waittill flaggedanimdone
  70.                 break
  71.         }
  72.     }
  73.  
  74. end
  75.