Toggle Hidden Rope

#Kismet

A custom Kismet node that toggles the visibility of Hat_Rope actors.

This node exists because "Toggle Hidden" does not hide the rope's details with it. This node does not toggle the rope's collision, only its visibility.

NOTE: You may want to edit the value of ObjCategory to something unique, so you can tell it apart from other copies of this script.

Drew_SeqAct_ToggleHiddenRope.uc

[RAW] [Download]

class Drew_SeqAct_ToggleHiddenRope extends SequenceAction;
 
event Activated()
{
    local Hat_Rope Rope;
    local int i, j;
    local bool bNewHidden;
 
    bNewHidden = InputLinks[0].bHasImpulse;
 
    for (i = 0; i < Targets.Length; i++)
    {
        Rope = Hat_Rope(Targets[i]);
        if (Rope == None)
        {
            class'GameMod'.static.LogMod("[" $ self $ "] Target " $ Targets[i] $ " is not a Hat_Rope!");
            continue;
        }
 
        Rope.SetHidden(bNewHidden);
 
        for (j = 0; j < Rope.RopeDetails.Length; j++)
        {
            if (Rope.RopeDetails[j] == None) continue;
            Rope.RopeDetails[j].SetHidden(bNewHidden);
        }
    }
}
 
defaultproperties
{
    ObjName = "Toggle Hidden Rope"
    ObjCategory = "GIVE ME A CUSTOM CATEGORY PLS"
 
    InputLinks(0) = (LinkDesc="Hide")
    InputLinks(1) = (LinkDesc="UnHide")
 
    VariableLinks(0) = (bModifiesLinkedObject=true)
    bCallHandler = false
}