comparison demos/rpg/scripts/scene.py @ 547:e59ece21ab3e

Item serialization will now assume some default values if they are not found in the save files. The 'spawn' console command can now spawn items with default values. Cleaned up some print statements.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 04 Jun 2010 21:01:34 +0000
parents 8fee2d2286e9
children d0282579668c
comparison
equal deleted inserted replaced
546:8fee2d2286e9 547:e59ece21ab3e
59 59
60 def loadObject(self, objectname, objectid=None, valuedict=None): 60 def loadObject(self, objectname, objectid=None, valuedict=None):
61 if objectid: 61 if objectid:
62 identifier = objectid 62 identifier = objectid
63 else: 63 else:
64 #identifier = uuid.uuid1() 64 identifier = str(uuid.uuid1())
65 identifier = "blkdjfkdj" 65
66
67 try: 66 try:
68 objdict = self._modelsettings.get("objects", objectname, {}) 67 objdict = self._modelsettings.get("objects", objectname, {})
69 modeldict = self._modelsettings.get("models", objdict["modelname"], {}) 68 modeldict = self._modelsettings.get("models", objdict["modelname"], {})
70
71 print objdict
72 print modeldict
73 69
74 loadImportFile(modeldict["file"], self._gamecontroller.engine) 70 loadImportFile(modeldict["file"], self._gamecontroller.engine)
75 71
76 if objdict["type"] == "GOLD": 72 if objdict["type"] == "GOLD":
77 newobject = GoldStack(self._gamecontroller, self.itemlayer, objdict["type"], objectname, modeldict["model"], identifier) 73 newobject = GoldStack(self._gamecontroller, self.itemlayer, objdict["type"], objectname, modeldict["model"], identifier)