Skip to content

Instantly share code, notes, and snippets.

@mcu8
Created September 7, 2019 21:39
Show Gist options
  • Save mcu8/c8e5044268da872bc6bd616e2d3acdf5 to your computer and use it in GitHub Desktop.
Save mcu8/c8e5044268da872bc6bd616e2d3acdf5 to your computer and use it in GitHub Desktop.
Change MusicTree Volume/Pitch multiplers
class mcu8_SeqAct_MusicTreeVolumePitchMltp extends SequenceAction;
var float MultiplerVolume;
var float MultiplerPitch;
defaultproperties
{
ObjName="Change MusicTree Volume/Pitch multiplers"
ObjCategory="Sound"
InputLinks(0)=(LinkDesc="Change Volume Mult.")
InputLinks(1)=(LinkDesc="Change Pitch Mult.")
InputLinks(2)=(LinkDesc="Change Both Mult.")
MultiplerVolume = 0
MultiplerPitch = 0
VariableLinks.Empty
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Volume multipler",bWriteable=true,PropertyName=MultiplerVolume)
VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="Pitch multipler",bWriteable=true,PropertyName=MultiplerPitch)
EventLinks.Empty
bCallHandler=false
}
event Activated()
{
local Hat_MusicManager mm;
local Hat_PlayerController pc;
pc = Hat_PlayerController(class'Engine'.static.GetEngine().GamePlayers[0].Actor);
if (pc == None) return;
mm = pc.GetMusicManager();
if (mm == None) return;
if (mm.MusicTreeInstance == None) return;
if (InputLinks[0].bHasImpulse || InputLinks[2].bHasImpulse)
mm.MusicTreeInstance.VolumeMultiplier = MultiplerVolume;
if (InputLinks[1].bHasImpulse || InputLinks[2].bHasImpulse)
mm.MusicTreeInstance.PitchMultiplier = MultiplerPitch;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment