def SndSetLogTrack(args): import xSndLogTracks xSndLogTracks.InitLogTrack(args)
def OnServerInitComplete(self): global statesN global statesS global statesE global statesW global imagerBusted global PlayScene global SDLVarSceneYeesha global SDLVarTomahnaActive # makes sure Tomahna book is disabled and invisible when linking in to age respBookAnim.run(self.key) #TomahnaBookDisable.run(self.key,avatar=PtGetLocalAvatar()) self.ageSDL = PtGetAgeSDL() # register for notification of locked SDL var changes self.ageSDL.setNotify(self.key, stringSDLVarLocked.value, 0.0) # register for notification of 4 Imager Panels SDL var changes self.ageSDL.setNotify(self.key, stringSDLVarPanelN.value, 0.0) self.ageSDL.setNotify(self.key, stringSDLVarPanelS.value, 0.0) self.ageSDL.setNotify(self.key, stringSDLVarPanelE.value, 0.0) self.ageSDL.setNotify(self.key, stringSDLVarPanelW.value, 0.0) # gets SDL values of 4 Imager panels, uses this value to retrieve correct state from 4 state lists, # and runs the corresponding responder to set initial default state for each state panel try: intPanelN = self.ageSDL[stringSDLVarPanelN.value][0] except: intPanelN = 3 PtDebugPrint( "ERROR: clftImager.OnServerInitComplete():\tERROR: age sdl read failed, defaulting intPanelN = 3" ) panelN = statesN[intPanelN] imagerRespN.run(self.key, state="%s" % (panelN)) try: intPanelS = self.ageSDL[stringSDLVarPanelS.value][0] except: intPanelS = 5 PtDebugPrint( "ERROR: clftImager.OnServerInitComplete():\tERROR: age sdl read failed, defaulting intPanelS = 5" ) panelS = statesS[intPanelS] imagerRespS.run(self.key, state="%s" % (panelS)) try: intPanelE = self.ageSDL[stringSDLVarPanelE.value][0] except: intPanelE = 3 PtDebugPrint( "ERROR: clftImager.OnServerInitComplete():\tERROR: age sdl read failed, defaulting intPanelE = 3" ) panelE = statesE[intPanelE] imagerRespE.run(self.key, state="%s" % (panelE)) try: intPanelW = self.ageSDL[stringSDLVarPanelW.value][0] except: intPanelW = 0 PtDebugPrint( "ERROR: clftImager.OnServerInitComplete():\tERROR: age sdl read failed, defaulting intPanelW = 0" ) panelW = statesW[intPanelW] imagerRespW.run(self.key, state="%s" % (panelW)) boolSceneYeesha = self.ageSDL[SDLVarSceneYeesha][0] boolTomahnaActive = self.ageSDL[SDLVarTomahnaActive][0] if boolTomahnaActive: PtDebugPrint( "clftImager.OnServerInitComplete: SDL says Tomahna is active, will set Imager to break..." ) imagerBusted = 1 else: PtDebugPrint( "clftImager.OnServerInitComplete: SDL says Tomahna is NOT active, will set Imager to work..." ) imagerBusted = 0 if boolTomahnaActive and boolSceneYeesha: PtDebugPrint( "clftImager.OnServerInitComplete(): TomahnaActive AND SceneYeesha SDL vars are true, will play scene" ) PlayScene = 1 avatar = 0 try: avatar = PtGetLocalAvatar() except: PtDebugPrint("failed to get local avatar") return avatar.avatar.registerForBehaviorNotify(self.key) cam = ptCamera() cam.disableFirstPersonOverride() cam.undoFirstPerson() CamSceneSetup.run(self.key, avatar=PtGetLocalAvatar()) import xSndLogTracks xSndLogTracks.InitLogTrack("15") else: PtDebugPrint( "clftImager.OnServerInitComplete(): TomahnaActive and/or SceneYeesha SDL vars are false, no scene for you" ) PlayScene = 0