[#modding] Feature Request: Whenever you have a part that continuously applies a status eff...

Issue #10056 invalid
Freehold Games Bot Account created an issue

Marked for crossposting by: torn sheet of graph paper

Message (jump):

<a_blessed_feline> Feature Request: Whenever you have a part that continuously applies a status effect to a being, it'd be sweet if the sound for that effect only played whenever the being initially got the effect and not whenever it overrides itself. For instance, I made a being with <part Name="LiquidProximityTriggersEffect" Range="5" Duration="16-32" LiquidMustBeConnectedByLiquid="false" EffectName="Running" /> and this continuously causes the beings to play the sprint activation sound whenever the beings are near blood. It would be preferrable if the sound only played if they did not already have the sprinting effect whenever the part gave it to them

Comments (3)

  1. chaos

    This isn't solvable in a general way because every individual effect controls its logic for when and if it plays a sound.

    In the case of Running, it's actually doing exactly what you want:

            public override bool Apply(GameObject Object)
            {
                if (Object.HasEffectByClass("Running"))
                {
                    return false;
                }
                if (!Object.CanChangeMovementMode(To: MessageName))
                {
                    return false;
                }
                if (!Object.FireEvent(Event.New("ApplyRunning", "Effect", this)))
                {
                    return false;
                }
                Object?.PlayWorldSound("Sounds/StatusEffects/sfx_statusEffect_movementBuff");
    

    Which tells me that actually the reason you're hearing the sound continually is that the effect is being repeatedly removed (probably by switching movement modes into wading or swimming) and reapplied.

  2. Log in to comment