• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code [Help] Modifying flashlight properties?

pie1055

Grizzled Veteran
Jul 6, 2011
507
78
Bedlam
Been toying around with the idea of a flashlight that is normally dim and near-worthless, but brightens or otherwise identifies zeds when it shines upon them (and simultaneously signals when a bullet shot would indeed hit something).

Found a "Effect_TacLightGlow" class that has LightBrightness and LightRadius properties. Being extended from the Actor class (through the Light class), it should also inherit LightHue as well as LightSaturation. Yet, when I modify these variables I can see no appreciable effect on the ingame tactical light.

Anyone have a clue how to get this ball rolling?

(and yes, I am extending these classes and not editing the original files)
 
Been toying around with the idea of a flashlight that is normally dim and near-worthless, but brightens or otherwise identifies zeds when it shines upon them (and simultaneously signals when a bullet shot would indeed hit something).

Found a "Effect_TacLightGlow" class that has LightBrightness and LightRadius properties. Being extended from the Actor class (through the Light class), it should also inherit LightHue as well as LightSaturation. Yet, when I modify these variables I can see no appreciable effect on the ingame tactical light.

Anyone have a clue how to get this ball rolling?

(and yes, I am extending these classes and not editing the original files)

Well I think for one with the zed brighten part you would need to add a foreach VisibleCollidingActors within the flashlight code

Something like this
Code:
    local KFMonster Victims;
    
    foreach VisibleCollidingActors( class 'KFMonster', Victims, LightRadius, 0 )
    {
        LightBrightness = <Value>
        LightSaturation = <Value>
    }
    else
    {
        LightBrightness = default.LightBrightness
        LightSaturation = default.LightSaturation
    }

Be forewarned that I have no idea if this works, it's just a concept. Marco, ScaryGhost, Flux, or Poosh will most likely have a much more easier way of going about it
 
Last edited:
Upvote 0