Page MenuHomeFeedback Tracker

EffectSound Event_OnSoundWaveEnded works only one time when sound is loaded
Closed, ResolvedPublic

Description

When try to want get info about sound, it works only when first time when loaded from disk probably. Next time when same sound is played is not possible get volume info and if is sound playing and so on.

Tried reproduce multiple times.

Probably some bug.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce

play sound
get info about played sound

Additional Information

Code & log

override void EOnFrame(IEntity other, float timeSlice)
    {
        super.EOnFrame(other, timeSlice);
        
        if (GetGame().IsClient() )
        {
            //StopTalkingNPC();
            if (m_WhistleSound)
            {
                Print ("SOUND " + m_WhistleSound + " " + m_WhistleSound.GetSoundVolume() + " " + m_WhistleSound.IsSoundPlaying());
                if (m_WhistleSound.GetSoundVolume() == 0 && !m_WhistleSound.IsSoundPlaying())
                {
                    //GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Call(StopTalkingNPC);
                }
            }
            
        }
 
    }
    
    void StopTalkingNPC()
    {
        Print("STOP TALKING");
        GetRPCManager().SendRPC( "TalkingNPC", "StopTalk", new Param1< vector >( this.GetPosition() ) );
    }
    
    
    override void OnVariablesSynchronized()
    {
        super.OnVariablesSynchronized();
        //GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(CCDirect, "", "Vars synchronized", ""));        
        if (m_Whistle>0)
        {
            WhistleSoundPlay(m_Whistle);
        }
    }
    
    void WhistleSoundPlay(int index)
    {
        
        m_WhistleSound = SEffectManager.PlaySoundOnObject( "Talking_SoundSet"+index.ToString(), this );
        m_WhistleSound.Event_OnSoundWaveEnded.Insert(StopTalkingNPC);
        m_WhistleSound.SetSoundAutodestroy(true);
        ResetWhistle();
        // in prison react to player voice
        // when they say something npc will say shut up
        
    }
 
 
SCRIPT       : SOUND EffectSound<f6c6dd70> 0 false
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : SOUND EffectSound<f6c6dd70> 1 true
SCRIPT       : STOP TALKING
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : SOUND EffectSound<f6c71fd0> 1 true
SCRIPT       : STOP TALKING
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false
SCRIPT       : SOUND EffectSound<f6c74730> 0 false

Event Timeline

Hunterz created this task.Oct 26 2021, 12:57 PM
Hunterz renamed this task from EventSound Event_OnSoundWaveEnded works only one time when sound is loaded to EffectSound Event_OnSoundWaveEnded works only one time when sound is loaded.Oct 26 2021, 1:00 PM

really need that event works correct because want know when sound was ended

Hunterz updated the task description. (Show Details)Oct 26 2021, 1:06 PM
Geez changed the task status from New to Assigned.Oct 26 2021, 1:18 PM

plc close looks like some mess in my code.

Arkensor added subscribers: Geez, Arkensor.EditedOct 26 2021, 2:25 PM

@Geez confirmed non-issue. I just checked the Event_OnSoundWaveEnded event and it has no problems. @Hunterz must have some issue in his code setup.

Please close the ticket.

Geez closed this task as Resolved.Oct 26 2021, 3:00 PM
Geez claimed this task.