parameters: (self)
docstring: The action of an avatar entering/exiting a docked bucket
docstring_summary: The action of an avatar entering/exiting a docked bucket
docstring_tokens: The action of an avatar entering / exiting a docked bucket
function: def EnterExitBucket(self):
          "The action of an avatar entering/exiting a docked bucket"
          global buckets
          global avaIDAtEntry 
  
          ageSDL = PtGetAgeSDL()
          bucketAtEntry = ageSDL[kStringAgeSDLBucketAtEntry][0]
          if bucketAtEntry < 0:
              #Tye Write debug statement here!
              return
  
          avaID = ageSDL[kStringAgeSDLRiders][bucketAtEntry]
          
          if avaID < 0:
              #Somone is trying to exit the bucket...
              #This is counter-intuitive as we set the data structure before performing the action
              #Thus if a avatar is not in the data structure, we need to remove him/her
              PtDebugPrint("tldnBucketBrain.EnterExitBucket():\tAvatar Exiting bucket---Running AvatarExitBucket()!",level=kDebugDumpLevel)
      
              #Make sure that we're not running while trying to exit the buckets...
              state = ageSDL[kStringAgeSDLBucketState][0] 
              stopped = state != kBucketStates.Run and state != kBucketStates.QStop
              if not stopped:
                  return
  
              #Get avatar object, remember the avatar exiting is stored in the cache variable called avaIDAtEntry
              avaID = avaIDAtEntry
              try:
                  avaKey = PtGetAvatarKeyFromClientID(avaID)
                  avaObj = avaKey.getSceneObject()
              except:
                  PtDebugPrint("ERROR: tldnBucketBrain.EnterExitBucket():\tCouldn't find the avatar exiting the bucket!!!",level=kErrorLevel)
                  return
                    
              avaObj.draw.enable()
              PtDetachObject(avaKey, buckets[bucketAtEntry].getKey())
              respBktExit.run(self.key,avatar=avaObj)
              #avaObj.physics.enable(1)
              return
  
          #Get the avatar
          try:
              avaKey = PtGetAvatarKeyFromClientID(avaID)
              avaObj = avaKey.getSceneObject()
          except:
              PtDebugPrint("ERROR: tldnBucketBrain.EnterExitBucket():\tCouldn't find an avatar to add to the bucket!!!",level=kErrorLevel)
              return
  
          #Storing the avatar in the cache for later use!
          avaIDAtEntry = avaID
  
          #attach avatar to bucket and run avatar enter bucket responder
          PtAttachObject(avaKey, buckets[bucketAtEntry].getKey())
          avaObj.physics.disable()
          respBktEnter.run(self.key, avatar=avaObj)
  
          #make sure to set up the camera and mouse movements while climbing in
          if avaKey == PtGetLocalAvatar().getKey():
              cam = ptCamera()
              cam.undoFirstPerson()
              cam.disableFirstPersonOverride()
              PtDisableMouseMovement()
function_tokens: def EnterExitBucket ( self ) : global buckets global avaIDAtEntry ageSDL = PtGetAgeSDL ( ) bucketAtEntry = ageSDL [ kStringAgeSDLBucketAtEntry ] [ 0 ] if bucketAtEntry < 0 : #Tye Write debug statement here! return avaID = ageSDL [ kStringAgeSDLRiders ] [ bucketAtEntry ] if avaID < 0 : #Somone is trying to exit the bucket... #This is counter-intuitive as we set the data structure before performing the action #Thus if a avatar is not in the data structure, we need to remove him/her PtDebugPrint ( "tldnBucketBrain.EnterExitBucket():\tAvatar Exiting bucket---Running AvatarExitBucket()!" , level = kDebugDumpLevel ) #Make sure that we're not running while trying to exit the buckets... state = ageSDL [ kStringAgeSDLBucketState ] [ 0 ] stopped = state != kBucketStates . Run and state != kBucketStates . QStop if not stopped : return #Get avatar object, remember the avatar exiting is stored in the cache variable called avaIDAtEntry avaID = avaIDAtEntry try : avaKey = PtGetAvatarKeyFromClientID ( avaID ) avaObj = avaKey . getSceneObject ( ) except : PtDebugPrint ( "ERROR: tldnBucketBrain.EnterExitBucket():\tCouldn't find the avatar exiting the bucket!!!" , level = kErrorLevel ) return avaObj . draw . enable ( ) PtDetachObject ( avaKey , buckets [ bucketAtEntry ] . getKey ( ) ) respBktExit . run ( self . key , avatar = avaObj ) #avaObj.physics.enable(1) return #Get the avatar try : avaKey = PtGetAvatarKeyFromClientID ( avaID ) avaObj = avaKey . getSceneObject ( ) except : PtDebugPrint ( "ERROR: tldnBucketBrain.EnterExitBucket():\tCouldn't find an avatar to add to the bucket!!!" , level = kErrorLevel ) return #Storing the avatar in the cache for later use! avaIDAtEntry = avaID #attach avatar to bucket and run avatar enter bucket responder PtAttachObject ( avaKey , buckets [ bucketAtEntry ] . getKey ( ) ) avaObj . physics . disable ( ) respBktEnter . run ( self . key , avatar = avaObj ) #make sure to set up the camera and mouse movements while climbing in if avaKey == PtGetLocalAvatar ( ) . getKey ( ) : cam = ptCamera ( ) cam . undoFirstPerson ( ) cam . disableFirstPersonOverride ( ) PtDisableMouseMovement ( )