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

  1. #*******************************************************************************************#
  2. #                              Client initialization routines                               #
  3. #*******************************************************************************************#
  4.  
  5. import Bladex
  6. import CharStats
  7.  
  8. import netgame
  9. import Basic_Funcs
  10. import AniSound
  11.  
  12. ClientActive = 1
  13.  
  14. import CommonResources
  15. CommonResources.Init()
  16.  
  17. execfile("..\\..\\Scripts\\NetworkResources.py")
  18.  
  19. # empaquetado de objetos
  20. import BODInit
  21. BODInit.Init()
  22.  
  23.  
  24. import SolidMask
  25. SolidMask.Init()
  26.  
  27. import Material
  28. Material.Init()
  29.  
  30. #
  31. # Sounds
  32. #
  33. import AniSound
  34.  
  35. #
  36. # Sound for steps (needed before the biped stuff)
  37. #
  38. execfile("..\\..\\Scripts\\NetStepSounds.py")
  39.  
  40.  
  41.  
  42.  
  43.  
  44. #
  45. # Sonidos de los clientes
  46. #
  47. def ClientSoundAsignation(name,kind):
  48.     print "tratando de asignar los sonidos a "+name+" de raza "+kind
  49.     ent = Bladex.GetEntity(name)
  50.     
  51.     if kind == "Knight_N":
  52.         AniSound.AsignarSonidosCaballero(name)
  53.     elif kind == "Amazon_N":
  54.         AniSound.AsignarSonidosAmazona(name)
  55.     elif kind == "Barbarian_N":
  56.         AniSound.AsignarSonidosBarbaro(name)
  57.     elif kind == "Dwarf_N":
  58.         AniSound.AsignarSonidosEnano(name)
  59.     else:
  60.         print "Sonidos para "+kind+"no implementado"
  61. netgame.SetJoinPlayerFunc(ClientSoundAsignation)
  62. print "Sonidos listos"
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Bladex.OpenDebugChannel("Salida")
  73.  
  74.  
  75. #
  76. # Animation events (needed b4 the biped stuff)
  77. #
  78. #import anm_def
  79. #anm_def.Init()
  80.  
  81.  
  82. #
  83. # Different kind of enemies. Should be called b4 creating ANY PersonEntity!
  84. #
  85. import Enemies
  86. Enemies.Init()
  87.  
  88.  
  89.  
  90. #
  91. # New animation system (biped) 
  92. #
  93. #execfile("..\\..\\Scripts\\KgtBAct.py")
  94. #execfile("..\\..\\Scripts\\Biped\\Biped.py")
  95.  
  96.  
  97.  
  98.  
  99. #
  100. # The sharing of whole sets of animations
  101. #
  102. #execfile("..\\..\\Scripts\\anm_conv.py")
  103.  
  104.  
  105. #
  106. # Factor of animations (to speed up or slow down animations) - OLD PLACE
  107. #
  108. #execfile("..\\..\\Scripts\\anm_fact.py")
  109.  
  110.  
  111. #
  112. # To modify flags of animations 
  113. #
  114. #execfile("..\\..\\Scripts\\anm_mdf.py")
  115.  
  116.  
  117. #
  118. # Factor of animations (to speed up or slow down animations)
  119. #
  120. #execfile("..\\..\\Scripts\\anm_fact.py")
  121.  
  122.  
  123. #
  124. # Particle Systems init
  125. #
  126. # CUIDADO! Valores definidos tambien en InitParticleSystems.py.
  127. B_PARTICLE_GTYPE_COPY=0
  128. B_PARTICLE_GTYPE_BLEND=1
  129. B_PARTICLE_GTYPE_ADD=2
  130. B_PARTICLE_GTYPE_MUL=3
  131.  
  132. import InitParticleSystems
  133. InitParticleSystems.Init()
  134.  
  135. #
  136. # Procedural textures
  137. #
  138. execfile("..\\..\\Scripts\\AutoGenTextures.py")
  139.  
  140.  
  141. #
  142. # PJ Init loop...
  143. #
  144.  
  145. while(netgame.CreateMainPlayer()==0):
  146.   pass
  147.  
  148. char=Bladex.GetEntity("Player1")
  149.  
  150.  
  151. #
  152. # Timers
  153. #
  154. Bladex.CreateTimer("Timer60",1.0/60.0)
  155. Bladex.CreateTimer("Timer30",1.0/30.0)
  156. Bladex.CreateTimer("Timer15",1.0/15.0)
  157.  
  158.  
  159. #
  160. # Controls ( keyborad,mouse...) stuff
  161. #
  162. execfile("..\\..\\Scripts\\InputInit.py")
  163. execfile("..\\..\\Scripts\\NetMode.py")
  164. import acts
  165. acts.InitBindings("Player1")
  166.  
  167. try:
  168.   execfile("..\\..\\Scripts\\Control.py")
  169.   print "BladeInit -> Executed Control.py"
  170. except:
  171.   execfile("..\\..\\Scripts\\DefControl.py")
  172.   print "BladeInit -> Executed DefControl.py"
  173.  
  174. import NetScorer
  175. NetScorer.ActivateScorer()
  176.  
  177.  
  178.  
  179. #
  180. # Menu (el menu de cliente es otro, no esta basura)
  181. #
  182. import Menu
  183. Menu.InitMenuKeys()
  184.  
  185.  
  186. print "ClientInit.py"