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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'
  32. path = bge.logic.expandPath(fileName)
  33. bge.logic.LibLoad(path, 'Scene')
  34. fileName = mainDir + "assets/" + 'bmx_player' + '.blend'
  35. path = bge.logic.expandPath(fileName)
  36. bge.logic.LibLoad(path, 'Scene')
  37. fileName = mainDir + "assets/" + 'prop_bike.blend'
  38. path = bge.logic.expandPath(fileName)
  39. bge.logic.LibLoad(path, 'Scene')
  40. # fileName = mainDir + "characters/sun.blend"
  41. #
  42. # path = bge.logic.expandPath(fileName)
  43. # bge.logic.LibLoad(path, 'Scene')
  44. cont.activate(actu)