mcu8_SeqAct_MusicTreeVolumePitchMltp

#Kismet

Script for adjusting MusicTree volume and pitch multipliers using Kismet node

// Script for adjusting MusicTree volume and pitch multipliers using Kismet node
 
class mcu8_SeqAct_MusicTreeVolumePitchMltp extends SequenceAction;
 
var float MultiplierVolume;
var float MultiplierPitch;
 
defaultproperties
{
    ObjName="Change MusicTree Volume/Pitch multiplier"
    ObjCategory="Sound"
 
    InputLinks(0)=(LinkDesc="Change Volume Mult.")
    InputLinks(1)=(LinkDesc="Change Pitch Mult.")
    InputLinks(2)=(LinkDesc="Change Both Mult.")
 
    MultiplierVolume = 0
    MultiplierPitch = 0
 
    VariableLinks.Empty
    VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Volume multiplier",bWriteable=true,PropertyName=MultiplierVolume)
    VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="Pitch multiplier",bWriteable=true,PropertyName=MultiplierPitch)
 
    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 = MultiplierVolume;
 
    if (InputLinks[1].bHasImpulse || InputLinks[2].bHasImpulse)
        mm.MusicTreeInstance.PitchMultiplier = MultiplierPitch;
}