Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "Legacy talk:Actor (UT)/Functions"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(convert sound variables to PlaySound parameters)
 
m (''Real Tim Swannie'' told in Discord the param conversion for PlaySound())
 
Line 8: Line 8:
 
</uscript>
 
</uscript>
 
To use these variables in the function PlaySound they need to be scaled:
 
To use these variables in the function PlaySound they need to be scaled:
<uscript>PlaySound(SoundToPlay, SlotForSound, SoundVolume / 128, SoundNoOverride, SoundRadius * 25, SoundPitch / 64);</uscript>
+
<uscript>PlaySound(SoundToPlay, SlotForSound, SoundVolume / 255, SoundNoOverride, SoundRadius, SoundPitch / 64);</uscript>
(The factor '''25''' may have a variance of ca. 5%.)
+
 
--[[User:SeriousBarbie|SeriousBarbie]] ([[User talk:SeriousBarbie|talk]]) 14:59, 13 February 2016 (EST)
 
--[[User:SeriousBarbie|SeriousBarbie]] ([[User talk:SeriousBarbie|talk]]) 14:59, 13 February 2016 (EST)
 +
 +
Updated --[[User:SeriousBarbie|SeriousBarbie]] ([[User talk:SeriousBarbie|talk]]) 02:49, 24 December 2024 (MST)

Latest revision as of 02:49, 24 December 2024

Convert sound variables to PlaySound parameters[edit]

I've found that the function parameters of PlaySound() differ from the variables usually used for sound. The definitions for ambient sound in Actor are

// Ambient sound.
var(Sound) byte         SoundRadius;	 // Radius of ambient sound.
var(Sound) byte         SoundVolume;	 // Volume of amient sound.
var(Sound) byte         SoundPitch;	 // Sound pitch shift, 64.0=none.

To use these variables in the function PlaySound they need to be scaled:

PlaySound(SoundToPlay, SlotForSound, SoundVolume / 255, SoundNoOverride, SoundRadius, SoundPitch / 64);

--SeriousBarbie (talk) 14:59, 13 February 2016 (EST)

Updated --SeriousBarbie (talk) 02:49, 24 December 2024 (MST)