Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

load_char.py 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import bge
  2. def ai(cont):
  3. # own = cont.owner
  4. # scene = bge.logic.getCurrentScene()
  5. # #actu = cont.actuators['start_level']
  6. # dict = bge.logic.globalDict
  7. # objList = scene.objects
  8. # mainDir = bge.logic.expandPath("//")
  9. # skater = 'ai_ed'
  10. #
  11. # fileName = mainDir + "npc_skaters/" + str(skater) + '.blend'
  12. #
  13. # path = bge.logic.expandPath(fileName)
  14. # bge.logic.LibLoad(path, 'Scene')
  15. #
  16. # # get object named MainCharacter
  17. # armature = objList["npc_ed_arm"]
  18. # # combine child's shape with parent's
  19. # compound = True
  20. # # child is solid
  21. # ghost = False
  22. # # set parent
  23. # armature.setParent( own, compound, ghost)
  24. print('loading ai')
  25. def main(cont):
  26. own = cont.owner
  27. scene = bge.logic.getCurrentScene()
  28. #actu = cont.actuators['start_level']
  29. actu = cont.actuators['sceneInitState']
  30. dict = bge.logic.globalDict
  31. mainDir = bge.logic.expandPath("//")
  32. # if dict['char_loaded'] == 0:
  33. fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'
  34. path = bge.logic.expandPath(fileName)
  35. try:
  36. bge.logic.LibLoad(path, 'Scene')
  37. fileName = mainDir + "assets/" + 'bmx_player' + '.blend'
  38. path = bge.logic.expandPath(fileName)
  39. bge.logic.LibLoad(path, 'Scene')
  40. fileName = mainDir + "assets/" + 'prop_bike.blend'
  41. path = bge.logic.expandPath(fileName)
  42. bge.logic.LibLoad(path, 'Scene')
  43. except:
  44. pass
  45. # dict['char_loaded'] = 1
  46. # fileName = mainDir + "characters/sun.blend"
  47. #
  48. # path = bge.logic.expandPath(fileName)
  49. # bge.logic.LibLoad(path, 'Scene')
  50. cont.activate(actu)