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

  1. ##########################################################
  2. #
  3. #    SCRIPT    : sistema de paths simples para los persons
  4. #
  5. #    AUTH    : Yuio
  6. #
  7. #
  8. ##########################################################
  9.  
  10. import Bladex
  11.  
  12. PPathPos={}
  13. PPathDictionary={}
  14.  
  15. def routeEnd(ent) :
  16.     if ( PPathPos[ent] == PPathDictionary[ent][2] ) :
  17.         #print"route end at point",PPathPos[ent]
  18.         func = PPathDictionary[ent][1]
  19.         if (func) :    func ( ent )
  20.     else:
  21.         #print"going to point:",PPathPos[ent]
  22.         pers = Bladex.GetEntity(ent)
  23.         pos = PPathDictionary[ent][3][PPathPos[ent]]
  24.         pers.GoTo( pos[0],pos[1],pos[2] )
  25.         pers.RouteEndedFunc = routeEnd
  26.         PPathPos[ent]=PPathPos[ent]+1
  27.  
  28. def unlock(entName):
  29.     del PPathPos[entName]
  30.     del PPathDictionary[entName]
  31.  
  32. def lock( entName, endFunc, pathPointsN, pathPointsVecs ):
  33.     if (PPathPos.has_key(entName)) : unlock(entName)
  34.     PPathPos[entName] = 0
  35.     PPathDictionary[entName] = entName, endFunc, pathPointsN, pathPointsVecs
  36.     routeEnd(entName)
  37.  
  38.  
  39. #persPath.lock("Player1",0,4,((-32484.9670546, 6953.2, -50721.8465672),(-39741.9550376, 6762.66279411, -44862.1058203),(-37973.714983, 5965.4, -29988.8561349),(-35688.677572, 6442.76323088, -42246.6595328)))
  40.