def addActor(self, ent): """ The actor is not started, so a call to the start() method might be required. """ cl = actorClasses.get(ent['classname'], CSimpleActor) try: script = ent['script'] a = {} a['CBaseActor'] = cl import loader loader.execute(script, a, a) #for k in a.keys(): sylphis._object.__setattr__(newcl, k, a[k]) cl = a['CScript'] except KeyError: pass e = cl() # load the specifics try: updateKeepType(e, ent) except Exception, ex: raise Exception, ent.get('name', 'unnamed') + ' : ' + str(ex)
def load(self, fname): loader.execute(fname, globals(), self.__dict__)