Hello, noob question here.
Is there a way to determine via scripting that a sound that I previously played has finished playing??
Thanks in advance!
Hello, noob question here.
Is there a way to determine via scripting that a sound that I previously played has finished playing??
Thanks in advance!
I never worked with sound actors, but maybe you can use the property Duration (float Duration (native, const)). Make something like a timer and when you make the sound play, activate the timer that will increase the value of a new variable. If the new variable's value is equal to Duration the sound has ended.
Youtube Channel | Website
Unreal Sed [IDE]: UDK Thread | UT2004 Thread | UT3 Thread | Supports: UDK and all the games in the Unreal series.
UT2004: UT3 Viper for UT2004 | Heal Link Gun for UT2004 | UT3 Nightshade for UT2004 | UT3 Goliath for UT2004 | UT3 Manta for UT2004 | UT3 Raptor for UT2004 | UT3 Paladin for UT2004 | UT2004 Initor
UT3: Heal Link Gun for UT3 [PC] [PS3] | UT3 INI Color Tweak | Essence Link Gun for UT3 [PC] [PS3]
So basically you would have to know how long the sound is, hrm.
While I could see it working, it's gonna be quite a hassle to time the sounds I would play lol
Try using the function GetSoundDuration (defined in actor.uc) to grab the duration of the sound that is going to be played.
"What do you mean it doesn't exist clientside?"
YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
My Generic Mods for UT2K4:
Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank
That is what I was talking about. There is a variable in the class Sound that holds the duration of the sound.
So you would have your sound variable:
Set in default properties for the package, groupd and file:Code:var sound MySound;
Then you would be able to know the duration of the sound with:Code:DefaultProperties { MySound=Sound'MyPackage.MyGroup.MySound' }
Code:MySound.Duration;
Youtube Channel | Website
Unreal Sed [IDE]: UDK Thread | UT2004 Thread | UT3 Thread | Supports: UDK and all the games in the Unreal series.
UT2004: UT3 Viper for UT2004 | Heal Link Gun for UT2004 | UT3 Nightshade for UT2004 | UT3 Goliath for UT2004 | UT3 Manta for UT2004 | UT3 Raptor for UT2004 | UT3 Paladin for UT2004 | UT2004 Initor
UT3: Heal Link Gun for UT3 [PC] [PS3] | UT3 INI Color Tweak | Essence Link Gun for UT3 [PC] [PS3]
ohhhhh I see i see...I didn't know that the sound class had a public property for duration lol
I also didn't knew there was a getsoundduration either...interesting.
I'm guessing I should use that level.seconds or level.timeinseconds or whatever it is( that method or property that gives you the time in seconds of which the name I can't remember) then equate it if it's already equal to the duration or something to that extent
anyway, thanks you two!

The Duration property might be invalid for ProceduralSounds and SoundGroups. GetSoundDuration() probably is the way to go, though keep in mind it returns real time seconds, while functions like Sleep() expect game seconds. You will have to scale by Level.TimeDilation there.
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives
- Everything you ever wanted to know about replication (but were afraid to ask) [also in German]
- UnrealScript security considerations
Note that your questions via PMs will be ignored if they actually belong in the forum.<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Bookmarks