Dynamic ball of light

Discussion in 'Mapping Questions & Discussion' started by xingped, May 28, 2013.

  1. xingped

    xingped L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    Hey everyone, I'm having some trouble figuring out what to do and would appreciate some help: how can I create a dynamic light that is basically a free-floating sphere of light (I'm guessing I may need two, one up one down)?
     
  2. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    Try a sprite.
     
  3. Seba

    aa Seba DR. BIG FUCKER, PHD

    Messages:
    2,363
    Positive Ratings:
    2,365
    Env_sprites are often used to make the visible light, like the flashing red some mappers like to put on the cameras. As for the actual light, just a light entity will do.
     
  4. xingped

    xingped L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    Env_sprite is definitely what I wanted. Thanks! Two questions: 1. Is there a way to set a maximum draw distance on env_sprite like you can with env_lightglow? 2. What is this "script think function" I see listed here: https://developer.valvesoftware.com/wiki/Env_sprite and can I use it in TF2?
     
  5. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    Scripts are new with L4D2 and above, so aren't available in TF2.
     
  6. The Asylum

    aa The Asylum

    Messages:
    1,658
    Positive Ratings:
    439
    I don't know if it'll work as a sprite, but you cold try a custom sprite texture that fades in/out relative to distance, IE the respawn room no entry texture.

    When I created one of my own proximity-sensitive textures, all I did was copypasta the the VMT data from the no entry brush into a new VMT

    "LightmappedGeneric"
    {
    "$basetexture" "yourfolder/yourtexture"
    "$translucent" 1

    "$playerdistance" "0"
    "$distanceclamped" "0"
    "$distanceinverted" "0"
    "$teammatch" "0"
    "$matchinverted" "0"
    "$endalpha" "0"
    "$one" "2"
    "$fadedistance" "1600" (modify this to control when your texture fades)
    $distancealpha 1

    "Proxies"
    {
    "PlayerProximity"
    {
    "resultVar" "$playerdistance"
    "scale" 1.0
    }
    "Clamp"
    {
    "srcVar1" "$playerdistance"
    "min" "0"
    "max" "$fadedistance"
    "resultVar" "$distanceclamped"
    }
    "Subtract"
    {
    "srcVar1" "$fadedistance"
    "srcVar2" "$distanceclamped"
    "resultVar" "$distanceinverted"
    }
    "PlayerTeamMatch"
    {
    "resultVar" "$teammatch"
    }
    "Subtract"
    {
    "srcVar1" "$one"
    "srcVar2" "$teammatch"
    "resultVar" "$matchinverted"
    }
    "Divide"
    {
    "srcVar1" "$distanceinverted"
    "srcVar2" "$fadedistance"
    "resultVar" "$endalpha"
    }
    "Multiply"
    {
    "srcVar1" "$endalpha"
    "srcVar2" "$matchinverted"
    "resultVar" "$alpha"
    }
    }
    }
     
    • Thanks Thanks x 1