home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Scripts / anirecorder.py < prev    next >
Encoding:
Text File  |  2000-10-27  |  1.1 KB  |  48 lines

  1. import Bladex
  2.  
  3. record = 0
  4. victim = "Player1"
  5.  
  6. Bladex.CreateTimer("AniMaker",1.0/24.0)
  7.  
  8. def snapShotTimer(strEntName, fTime):
  9.     Bladex.TakeSnapShot()
  10.  
  11. def stopSnaps():
  12.     global victim
  13.     global record
  14.     if (not record) : return
  15.     record=0
  16.     print("stop")
  17.     char = Bladex.GetEntity(victim)
  18.     char.TimerFunc=""
  19.     char.RemoveFromList("AniMaker")
  20.     
  21. def startAnim(strAnimName):
  22.     global victim
  23.     char = Bladex.GetEntity(victim)
  24.     char.LaunchAnimation(strAnimName)
  25.  
  26. def startSnaps():
  27.     global victim
  28.     global record
  29.     if (record) : return
  30.     record = 1
  31.     print("start")
  32.     char = Bladex.GetEntity(victim)    
  33.     char.TimerFunc=snapShotTimer;
  34.     char.SubscribeToList("AniMaker")
  35.  
  36. def animSnapShot( fTime , strAnimName ="", fLaunchDelay=0.0 ) :
  37.     startSnaps()
  38.     Bladex.AddScheduledFunc( Bladex.GetTime()+fTime, stopSnaps, () )
  39.     if (strAnimName<>"") : Bladex.AddScheduledFunc( Bladex.GetTime()+fLaunchDelay, startAnim, (strAnimName,) )
  40.     
  41. def setVictim(strVictim):
  42.     global victim
  43.     victim=strVictim
  44.  
  45. # import anirecorder
  46. # anirecorder.setVictim("Player1")
  47. # anirecorder.animSnapShot( 10.0 , "Kgt_g_bad_sword2" )
  48.