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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. dict = bge.logic.globalDict
  30. mainDir = bge.logic.expandPath("//")
  31. # if dict['char_loaded'] == 0:
  32. fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'
  33. path = bge.logic.expandPath(fileName)
  34. try:
  35. bge.logic.LibLoad(path, 'Scene')
  36. except:
  37. pass
  38. fileName = mainDir + "assets/" + 'bmx_player' + '.blend'
  39. path = bge.logic.expandPath(fileName)
  40. bge.logic.LibLoad(path, 'Scene')
  41. fileName = mainDir + "assets/" + 'prop_bike.blend'
  42. path = bge.logic.expandPath(fileName)
  43. bge.logic.LibLoad(path, 'Scene')
  44. # dict['char_loaded'] = 1
  45. # fileName = mainDir + "characters/sun.blend"
  46. #
  47. # path = bge.logic.expandPath(fileName)
  48. # bge.logic.LibLoad(path, 'Scene')
  49. cont.activate(actu)