Eliot's Forum

Full Version: PlaySound Constants Decompile to Value, Not Constant [Unreal 227h]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
PlaySound(Roam, SLOT_Talk, 0.02 * Mass,,, VoicePitch);

decompiles to:

Code:
PlaySound(Roam, 5, 0.02 * Mass,,, VoicePitch);

I think this is how it works:

Code:
1 = SLOT_Misc
2 = SLOT_Pain
3 = SLOT_Interact
4 = SLOT_Ambient
5 = SLOT_Talk
6 = SLOT_Interface

It won't recompile with the value, it needs the constant.

Edit:

I think 0 is SLOT_None
I'm aware of this. This is because it actually is compiled as numbers and not constants. Decompiling this back might easily contain false positives, I've done it before with NetMode but when it comes to switch's and cases with multiple switches or if's it gets quite complicated to relate these numbers back to the constants!

It should recompile fine, but perhaps that's something to do with the fact that's an older version of the Engine.
(04-07-2012, 05:24 AM)eliot Wrote: [ -> ]I'm aware of this. This is because it actually is compiled as numbers and not constants. Decompiling this back might easily contain false positives, I've done it before with NetMode but when it comes to switch's and cases with multiple switches or if's it gets quite complicated to relate these numbers back to the constants!

It should recompile fine, but perhaps that's something to do with the fact that's an older version of the Engine.

Maybe it's because it's an older version. I'm not sure! It would be nice if there was some way to decompile it and get the constants but I see what you mean.

It would be very difficult unless it checked the function for the type of parameter it's filling in and then cross-referenced it with an array of strings (which are the constants) to write into the parameter instead of the number. Which I'd imagine would be kind of hackish.