Need help identifying sound event.

Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
I have implemented a switch from player to spectator mode and back again. However, when I go into spectator mode, I get at musical event playing. I can't work out where it is in the code, and I recognise it from a couple of events in game, just after respawning as an alien for example, but if anyone can let me know what event I am triggering, that would be most helpful.

Here is a video of the issue:

Comments

  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited March 2014
    1) Start normal NS2.
    2) Load a map
    3) Type kill in console
    4) Be ded and listen.
  • DecoDeco Join Date: 2010-04-10 Member: 71288Members, WC 2013 - Shadow
    Player_Client.lua line 3841:
    
    function Player:UpdateDeadSound()
    
        if self:GetIsLocalPlayer() then
        
            // If we're dead and not playing montage, play deathly sound montage
            if (self:GetTeamNumber() ~= kSpectatorIndex) and not self:GetIsAlive() and not gPlayingDeadMontage then
            
                StartSoundEffect(kDeadSound)
                gPlayingDeadMontage = true
                
            // If we're alive and playing montage, stop it
            elseif self:GetIsAlive() and gPlayingDeadMontage then
            
                Shared.StopSound(nil, kDeadSound)
                gPlayingDeadMontage = nil
    
            end
            
        end
        
    end
    
  • DecoDeco Join Date: 2010-04-10 Member: 71288Members, WC 2013 - Shadow
    I'm guessing that UpdateDeadSound is being called on the player just before they're switched to spectator, starting the sound.
    Assuming self:GetIsAlive() returns false for spectators, then the sound wouldn't stop.

    Change the last condition to:
    (self:GetIsAlive() or self:GetTeamNumber() == kSpectatorIndex) and gPlayingDeadMontage
    
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    Thanks, sorry, I forgot to reply to say I had fixed the issue, I got sidetracked by getting the GorgeCraft release out yesterday :D

    Really appreciate the help guys. I was looking for respawn and other sounds, not dead sound, lol.
Sign In or Register to comment.