This article's documentation is for anything that uses the Source engine. Click here for more information.

Point spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(92 intermediate revisions by 39 users not shown)
Line 1: Line 1:
[http://gogenator.friko.pl/library/unique-wedding/ unique wedding cake toppers] [http://wizzu.profil.in/new/comic-strip/ comic strip] [http://baler.ugu.pl/new/internet-dance/ internet dance radio] [http://nice-tit.straip.cn/ nice tit] [http://swinger-orgy.elbows.cn/ swinger orgy] [http://saites.cn/carinsurancequotenorwichunion.html car insurance quote norwich union] [http://gogenator.friko.pl/library/contact/ contact] [http://gogenator.friko.pl/library/sweet-sixteen/ sweet sixteen party favors] [http://andrewjvb.aboutus.vg/resources/sex-pussy/ sex pussy] [http://freeonlinerpg.lirra.cn/ free online rpg] [http://quick-pay-day-loans.elbows.cn/ quick pay day loans] [http://saites.cn/personification.html personification] [http://baler.ugu.pl/new/fantasy-girl/ fantasy girl] [http://cah9i.friko.pl/new/ultra-high/ ultra high pressure pumps] [http://golf-handicap.elbows.cn/ golf handicap] [http://perkes.cn/north-carolina-state-football-tickets.html north carolina state football tickets] [http://krisbabe47.ugu.pl/small/used-mud.html used mud tires for sale] [http://theiamina.w8w.pl/content/kids-creative.html kids creative writing] [http://chubby-butt.straip.cn/ chubby butt] [http://exally.cn/ exally.cn] [http://platinum-wedding-ring.faults.cn/ platinum wedding ring] [http://cahert.aboutus.vg/styles/aria-double/ aria double peg perego stroller] [http://perkes.cn/jump-rope-fitness.html jump rope fitness] [http://hairy-chests.faults.cn/ hairy chests] [http://villir.cn/ee.html ee] [http://gastritis.elbows.cn/ gastritis] [http://gogenator.friko.pl/library/pretty-women/ pretty women getting fucked] [http://cah9i.friko.pl/new/piano-solos/ piano solos midi files] [http://theiamina.w8w.pl/content/process-automation.html process automation] [http://silivrenglaur.nm.ru/description/harrison-ford/ harrison ford] [http://villir.cn/nfl-football.html nfl football] [http://scrapbookpaper.exally.cn/ scrapbook paper] [http://theiamina.w8w.pl/content/chair-tied.html chair tied] [http://theiamina.w8w.pl/content/pussy-farts.html pussy farts] [http://antisilence.profil.gs/topic/toll-free/ toll free listing] [http://kid-halloween-costume.lusted.cn/ kid halloween costume] [http://kinkyjedi.about.vg/text/credit-card/ credit card processing] [http://gogenator.friko.pl/library/updated-it/ updated it] [http://baler.ugu.pl/new/room-air/ room air purifiers] [http://freeavgantivirus.lirra.cn/ free avg antivirus] [http://razes.cn/cialis.html cialis] [http://perkes.cn/naked-volleyball.html naked volleyball] [http://laminating-machines.elbows.cn/ laminating machines] [http://call-on-me.straip.cn/ call on me] [http://saites.cn/americancurves.html american curves] [http://villir.cn/excel-templates.html excel templates] [http://horny-granny.faults.cn/ horny granny] [http://baler.ugu.pl/new/gay-porn/ gay porn blog] [http://cah9i.friko.pl/new/full-penetration/ full penetration anal penetration] [http://amoresperros812.profil.in/text/old-english/ old english] [http://bordersbookstore.exally.cn/ borders book store] [http://summers.faults.cn/ summers] [http://baler.ugu.pl/new/small-tit/ small tit] [http://krisbabe47.ugu.pl/small/serena-williams.html serena williams topless] [http://baler.ugu.pl/new/mature-older/ mature older women] [http://cheatsforps2.exally.cn/ cheats for ps2] [http://dannyboy2007.profil.cc/directory/used-tractors.html used tractors for sale] [http://cah9i.friko.pl/new/free-printable/ free printable] [http://nutribun.profil.in/resources/toyota-truck/ toyota truck] [http://villir.cn/free-filipino-ringtones.html free filipino ringtones] [http://financialcalculators.lirra.cn/ financial calculators] [http://benjamin-moore-paints.straip.cn/ benjamin moore paints] [http://klgrem.aboutus.vg/library/arab.html arab] [http://wwwisevil.profil.bz/lib/tim-curry/ tim curry] [http://mexican-fuck.lusted.cn/ mexican fuck] [http://tersky.profil.bz/library/massive-muscle.html massive muscle] [http://firearms.lirra.cn/ firearms] [http://digitech.lusted.cn/ digitech] [http://saites.cn/flashing.html flashing] [http://villir.cn/medical-billing-insurance.html medical billing insurance] [http://cah9i.friko.pl/new/old-spaghetti/ old spaghetti factory] [http://eastbay.elbows.cn/ eastbay] [http://cah9i.friko.pl/new/sexy-disney/ sexy disney cartoons] [http://perkes.cn/secret-plot-doujin.html secret plot doujin] [http://thesaucernews.profil.bz/filipino-sex/ filipino sex] [http://cah9i.friko.pl/new/asian-grils/ asian grils] [http://razes.cn/buyperfume.html buy perfume] [http://razes.cn/mowerparts.html mower parts] [http://twinkletoeash.profil.bz/topic/olivia-wilde/ olivia wilde] [http://internet-cafe.elbows.cn/ internet cafe] [http://motorolaphonepinkrazor.exally.cn/ motorola phone pink razor] [http://strip.lirra.cn/ strip] [http://tersky.profil.bz/library/kiera.html kiera] [http://theiamina.w8w.pl/content/marc-jacobs.html marc jacobs handbag] [http://wwwisevil.profil.bz/lib/teen-love/ teen love advice] [http://theiamina.w8w.pl/content/reagan.html reagan] [http://dennis.lusted.cn/ dennis] [http://carnage.exally.cn/ carnage] [http://male-masturbation-pics.lusted.cn/ male masturbation pics] [http://baler.ugu.pl/new/free-love/ free love horoscope] [http://white-sox-tickets.straip.cn/ white sox tickets] [http://theiamina.w8w.pl/content/womens-golf.html womens golf clubs] [http://perkes.cn/shuttle-discovery.html shuttle discovery] [http://saites.cn/boysintheshower.html boys in the shower] [http://saites.cn/fuckingsex.html fucking sex] [http://villir.cn/nude-preteen-girls.html nude preteen girls] [http://kinkyjedi.about.vg/text/shredder/ shredder] [http://caught-on-camera.elbows.cn/ caught on camera] [http://misssakic.profil.ms/data/star-wars.html star wars main theme] [http://theiamina.w8w.pl/content/sexy-whores.html sexy whores] [http://cnmv.sapte.ro/smilies/msn/wxviqs.html dallas texas] [http://gguild.sufx.net/forum/cache/tpl/slsvkh.html order levitra] [http://promox.marte.ro/jo/media/video/bqsgxw.html dagger] [http://elitesite.sufx.net/e107_files/public/avatars/small/tafbma.html mortgage second] [http://rdslink.sufx.net/cache/tmp/ihtumb.html discount lortab] [http://bancuri.marte.ro/jokepics/images/cavcwq.html john lennon imagine] [http://psycho.marte.ro/cod/cod/pdpkub.html funny song] [http://sursa.sapte.ro/images/avatars/small/solwco.html holistic skin care] [http://cnmv.sapte.ro/smilies/msn/nvwolw.html video sexe] [http://krll.sapte.ro/xxx/errors_log/htdvif.html free cricket ringtones] [http://www.loyno.edu/~snkashis/autoviewer/images/2007-10-01/ahkpjq.html order albuterol] [http://pirate.sufx.net/gallery/files/cache/aqdjwk.html free jazz ringtones] [http://barra.hu/css/ihuecc.html justanswer] [http://americanconquest.sufx.net/php-files/images/news/tmp/mcsgrl.html discount zovirax] [http://krll.sapte.ro/xxx/errors_log/awlefx.html ultracet online] [http://beleakpe.marte.ro/phpBB/images/avatars/img/xvofgt.html girls fart] [http://cnmv.sapte.ro/smilies/msn/lepomn.html nude friends] [http://kilometrul.sapte.ro/dw/m/picture/cache/urmscd.html cheap xenical] [http://nightflyer.marte.ro/albums/userpics/thumb/ubqjbw.html discount online shopping] [http://barra.hu/css/grhnnk.html where exist sql] [http://sursa.sapte.ro/images/avatars/small/ldbhad.html maintenance management] [http://psycho.marte.ro/cod/cod/ukxgoq.html hawaiian gift] [http://beleakpe.marte.ro/phpBB/images/avatars/img/dtboxf.html hairy nudist] [http://beleakpe.marte.ro/phpBB/images/avatars/img/mwfauh.html paintball markers] [http://pirate.sufx.net/gallery/files/cache/snsnlk.html order zyban] [http://liquid.sapte.ro/images/Thumbs/afkwvp.html zocor online] [http://moa.sapte.ro/albums/Desene/Sexe/thumb/fqpsuh.html set canceled] [http://psycho.marte.ro/cod/cod/bncuvg.html young hardcore] [http://nightflyer.marte.ro/albums/userpics/thumb/ffsrcd.html chix] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/owmkvi.html bora bora] [http://best.sapte.ro/albums/ftp3/thumb/lqxoml.html cheap ultram] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/lsvvtd.html tom petty and the heartbreakers] [http://psycho.marte.ro/cod/cod/dguunt.html lotus tattoo] [http://americanconquest.sufx.net/php-files/images/news/tmp/vvknfa.html buy phendimetrazine] [http://barra.hu/css/kjsmmm.html linux ip address config] [http://host.sapte.ro/support/images/avatars/small/uxrswq.html somewhere only we know mp3] [http://onlinemarketing.sufx.net/twatch/tmp/lobeur.html vicodin] [http://bancuri.marte.ro/jokepics/images/sbjtnv.html arabic telephone translation service] [http://mp3hits.sufx.net/images/photogallery/photo/tockci.html discount sibutramine] [http://sursa.sapte.ro/images/avatars/small/idupra.html belly rings] [http://www.loyno.edu/~probono/paperwork/pdf_files/kaaloj.html vicodin online] [http://barra.hu/css/rjeweg.html express forgot outlook password] [http://cnmv.sapte.ro/smilies/msn/olqdok.html conveyance marbella] [http://onlinemarketing.sufx.net/twatch/tmp/rfelth.html animal ringtone] [http://elitesite.sufx.net/e107_files/public/avatars/small/bobdnd.html nexium online] [http://psycho.marte.ro/cod/cod/qxmgwr.html traditional anniversary gifts] [http://microlink.sufx.net/cache/Language/gneudg.html tramadol online] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/ixjxwv.html charlize theron] [http://nightflyer.marte.ro/albums/userpics/thumb/uiukww.html trick daddy] [http://pirate.sufx.net/gallery/files/cache/pvvnme.html continentalairlines] [http://psycho.marte.ro/cod/cod/fpxupn.html bearded dragons] [http://cybernet.sufx.net/routing/skins/images/pics/ametaj.html cheap bontril] [http://nightflyer.marte.ro/albums/userpics/thumb/atqajv.html teen titans] [http://gguild.sufx.net/forum/cache/tpl/ealltc.html free audiovox ringtones] [http://nightflyer.marte.ro/albums/userpics/thumb/sqobrb.html buffy davis] [http://barra.hu/css/llkswb.html windows media player microsoft download] [http://kilometrul.sapte.ro/dw/m/picture/cache/ikresx.html vicodin] [http://onlinemarketing.sufx.net/twatch/tmp/taspmm.html meridia online] [http://blog-de-pe.marte.ro/wp-content/wp-photos/photo/fxcdvw.html cheongsam] [http://sursa.sapte.ro/images/avatars/small/jhgwaj.html rubber catsuits] [http://nightflyer.marte.ro/albums/userpics/thumb/qwsbbh.html preteens having sex] [http://blog-de-pe.marte.ro/wp-content/wp-photos/photo/vpggae.html kyla cole avi] [http://best.sapte.ro/albums/ftp3/thumb/busshd.html provigil] [http://sursa.sapte.ro/images/avatars/small/mqplhv.html bird house] [http://rdslink.sufx.net/cache/tmp/evwncd.html buy zithromax] [http://fifa.sapte.ro/images/thumb/oawqki.html download weird ringtones] [http://host.sapte.ro/support/images/avatars/small/quhqfv.html kyles moms a bitch] [http://freeadult.sapte.ro/Mature-porn/thumb/lhgsco.html buy pharmacy online] [http://alsclan.sufx.net/e107_themes/lamb/video/csiqpo.html adderall] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/tdpiki.html pantyhose girls] [http://www.loyno.edu/~gcnfj/UserFiles/File/tmp/tplqgs.html valtrex online] [http://elitesite.sufx.net/e107_files/public/avatars/small/rmftde.html retro ringtone] [http://fifa.sapte.ro/images/thumb/htlxlj.html discount zovirax] [http://alsclan.sufx.net/e107_themes/lamb/video/dwxdvm.html adderall online] [http://best.sapte.ro/albums/ftp3/thumb/sqtjqj.html mp3 ringtones] [http://microlink.sufx.net/cache/Language/exmhop.html philips ringtone] [http://moa.sapte.ro/albums/Desene/Sexe/thumb/xlrcss.html corporate express] [http://www.loyno.edu/~probono/paperwork/pdf_files/aamuit.html download funny ringtones] [http://www.loyno.edu/~snkashis/autoviewer/images/2007-10-01/fokovn.html wwe ringtone] [http://host.sapte.ro/support/images/avatars/small/xixeha.html nicholas cage] [http://zo00om.sapte.ro/files/cache/lsdsas.html girl photos] [http://host.sapte.ro/support/images/avatars/small/rfmofa.html lake camp walleye fishing manitoba] [http://samax.sufx.net/wp-content/themes/royale/images/icons/xpkbmx.html free lg ringtones] [http://sursa.sapte.ro/images/avatars/small/egjpah.html roaring twenties] [http://barra.hu/css/ntvkfl.html online deal for att wireless] [http://www.loyno.edu/~snkashis/autoviewer/images/2007-10-01/dtxdoe.html metal ringtones] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/haloxv.html public flashers] [http://psycho.marte.ro/cod/cod/whcgpi.html voyeurday] [http://nightflyer.marte.ro/albums/userpics/thumb/raodxv.html equipment financing company] [http://blog-de-pe.marte.ro/wp-content/wp-photos/photo/rpmium.html night life] [http://sursa.sapte.ro/images/avatars/small/xjdxge.html fahrenheit 451] [http://samax.sufx.net/wp-content/themes/royale/images/icons/mwluvq.html order xanax] [http://blog-de-pe.marte.ro/wp-content/wp-photos/photo/ehnhed.html caribbean islands] [http://mzd.marte.ro/osvs/galerie/thumbs/cache/gnqqpt.html cheap air travel] [http://zo00om.sapte.ro/files/cache/fdxpua.html jennifer gardner] [http://host.sapte.ro/support/images/avatars/small/kghnnr.html brady weaver homes] [http://samax.sufx.net/wp-content/themes/royale/images/icons/nwrhcq.html order alprazolam] [http://best.sapte.ro/albums/ftp3/thumb/tnjvah.html vigrx online] [http://redbullet.sufx.net/images/avatars/small/fejbqk.html order ephedra] [http://www.loyno.edu/~gcnfj/UserFiles/File/tmp/xjhhut.html buy cyclobenzaprine]  
{{LanguageBar}}
{{wrongtitle|title=point_spotlight}}
{{CD|CPointSpotlight|file1=1}}
== Entity description ==
[[File:PointSpotlight.jpg|thumb|right|192px|A point_spotlight.]]
An entity to draw a spotlight primarily consisting of two glow sprites: A beam when the player views it side on, and a halo when it's facing towards the player. Unless the 'No Dynamic Light' spawn flag is checked, it will also create a dynamic light wherever the end of the spotlight rests.
{{this is a|point entity|name=point_spotlight}} Creates two glow sprite effects: a ''beam'' effect for viewers outside the light cone and a ''halo'' effect for viewers inside the cone. Also creates dynamic light at the end of the beam if desired flags are set which is achieved using {{ent|spotlight_end}}.
{{note|Without the dynamic light this entity will just provide a sprite effect, and will not serve as an actual light source.}}


== Keyvalues ==
The {{ent|spotlight_end}} functionality can be disabled with the 'No Dynamic Light' spawnflag. In that state, the spotlight will not actually illuminate other objects on its own and can be used with an accompanying {{ent|light_spot}} or {{ent|env_projectedtexture}} instead.
* {{kv targetname}}
* {{kv parentname}}
* {{kv renderfields}}
* {{kv angles}}
* {{kv hdrcolorscale}}


* '''spotlightlength'''
{{bug|hidetested=1|In {{portal2|4}} and {{bms|4}} the '''Alpha''' (''renderamt'') property is not functional at all, use '''HDRColorScale''' instead.}}
: <integer> Length of the spotlight beam.
{{warning|This entity generates 3 [[edict]]s (for itself, the beam visual and beam target respectively: {{mono|point_spotlight}}, {{ent|beam}}, {{ent|spotlight_end}}! In {{tf2|4}} and {{gmod|4}}, the <code>point_spotlight</code> itself has been converted to a server-only entity (does not take up an edict), and in {{tf2|4}}, when no targetname and parentname is assigned, the <code>point_spotlight</code> and <code>spotlight_end</code> entity is also killed, thus consuming 1 edict in total for a static spotlight.}}
{{bug|tested={{hl2}},{{bms}}|Killing this entity either by '''Kill''' input or by killing its parent while it's turned on will leave behind the <kbd>beam</kbd> and <kbd>spotlight_end</kbd> entities. Beam won't be visible but the spotlight_end will be.
{{workaround|Fire '''LightOff''' input first, then with small delay '''Kill'''.}}
}}
{{note|{{ent|beam}} collides only with [[prop_static]] and world geometry, this means that beam of [[point_spotlight]] and dynamic light will ignore any dynamic objects (with the exception of [[func_physbox]]), [[NPC]]s, [[physics objects]], e.t.c.}}


* '''spotlightwidth'''
{{expand|title=Third-Party notices {{asd}}{{bms}}|
: <integer> Width of the spotlight beam.
{{note|In {{asd|4}} this entity is not supported and on loading a map all point_spotlight entities will be converted to [[Light deferred]]!}}
{{important|{{bms|4}} are using [[deferred lighting]] for [[spotlight_end|light source from this entity]].}}
}}


* '''rendercolor'''
== Keyvalues ==
: {{color}} The color of the spotlight cone.
{{KV Targetname}}
{{KV|Ignore Solid|intn=IgnoreSolid|bool|If set, this spotlight won't trace for solids, emitting at its full length and ignoring potential obstructions.|since={{src13mp}}|also={{gmod}}{{mapbase}}  ,  {{!fgd}} in {{bms}}}}
{{KV|Spotlight Length|intn=SpotlightLength|integer|Length of the spotlight beam.}}
{{KV|Spotlight Width|intn=SpotlightWidth|integer|Width of the spotlight beam.}}
{{KV|Color (R G B)|intn=rendercolor|color255|Spotlight color.}}
{{KV|HDR color scale.|intn=HDRColorScale|float|Float value to multiply sprite color by when running in HDR mode.}}
{{KV|Halo size scale.|intn=HaloScale|float|Float value to determine the size of the halo.|since={{l4d2}}|also={{mapbase}}}}
{{expand|title={{mapbase|4}} only properties|
{{KV|Halo material|intn=HaloMaterial|string|Material to use for the halo.}}
{{KV|Spotlight beam material|intn=SpotlightMaterial|string|Material to use for the spotlight's beam.}}
}}
{{expand|title=Performance properties|
{{KV DXLevelChoice}}
{{KV SystemLevelChoice}}
}}


== Flags ==
== Flags ==
* 1 : Start On
{{Fl|1|Start On}}
: Sets the point_spotlight to be turned on when it spawns.
{{Fl|2|No Dynamic Light}}
{{bug|hidetested=1|In {{l4d2|4}} alpha of spawned {{ent|spotlight_end}} is set wrongly causing no light to be visible. {{fix|Use following script as point_spotlight's Entity script {{ExpandBox|<syntaxhighlight lang=js>function L4D2PointSpotlightFix() {
    for(local ent; ent = Entities.FindByClassname(ent, "spotlight_end");) {
        if(NetProps.GetPropEntity(ent, "m_hOwnerEntity") == self) {
            local clrrender = NetProps.GetPropInt(self, "m_clrRender");
            NetProps.SetPropInt(ent, "m_clrRender", clrrender);
            return;
        }
    }
}


* 2 : No Dynamic Light
function OnPostSpawn() {
: Prevents a dynamic light from being generated by the point_spotlight. Dynamic lights can be costly for performance, so this flag should be checked to improve framerate.
    if((NetProps.GetPropInt(self, "m_spawnflags") & 3) == 0) {
        L4D2PointSpotlightFix();
    }
    self.ConnectOutput("OnLightOn", "L4D2PointSpotlightFix")
}</syntaxhighlight>}}}}}}


== Inputs ==
== Inputs ==
*{{i targetname}}
{{I|LightOn|Turn the spotlight on.}}
*{{i parentname}}
{{I|LightOff|Turn the spotlight off.}}
*{{i renderfields}}
{{I|LightToggle|Toggles the spotlight on/off|only={{mapbase}}}}
{{I|SetColor|Change the color of the spotlight. Light must be turned off then back on for dynamic light to update.|param=color255|since={{AS}}|also={{GMOD}}}}
:{{note|Functionally identical to the {{mono|Color}} input. A delay of at least 0.01 is required before the spotlight is turned back on, or else it will remain off.}}
{{I|ForceUpdate|Force an update of the spotlight position and orientation.|since={{AS}}|also={{GMOD}}}}


* '''LightOn'''
== Outputs ==
{{O|OnLightOn|ac-is-this=1|Fires when light turns on.}}
{{O|OnLightOff|ac-is-this=1|Fires when light turns off.}}


* '''LightOff'''
== Code related ==
 
By default, point_spotlight uses the material ''sprites/glow_test02.vmt''. You can change this if you are shipping your own binaries by going into ''point_spotlight.cpp'' in the server project, navigating to line 351 and replacing the file path with your own material or a reference to a variable set via a KV similarly as {{mapbase|4}}'s <kbd>SpotlightMaterial</kbd> KV.
== Outputs ==
* {{o targetname}}


== See also ==
== See also ==
* [[light_spot]]
* [[Lighting]]
* [[npc_spotlight]]


[[Category:Entities]]
[[Category:Lighting]]

Latest revision as of 03:43, 20 July 2025

English (en)Русский (ru)Translate (Translate)
C++ Class hierarchy
CPointSpotlight
CPointEntity
CBaseEntity
C++ point_spotlight.cpp
A point_spotlight.

point_spotlight is a point entity available in all Source Source games. Creates two glow sprite effects: a beam effect for viewers outside the light cone and a halo effect for viewers inside the cone. Also creates dynamic light at the end of the beam if desired flags are set which is achieved using spotlight_end.

The spotlight_end functionality can be disabled with the 'No Dynamic Light' spawnflag. In that state, the spotlight will not actually illuminate other objects on its own and can be used with an accompanying light_spot or env_projectedtexture instead.

Icon-Bug.pngBug:In Portal 2 Portal 2 and Black Mesa Black Mesa the Alpha (renderamt) property is not functional at all, use HDRColorScale instead.
Warning.pngWarning:This entity generates 3 edicts (for itself, the beam visual and beam target respectively: point_spotlight, beam, spotlight_end! In Team Fortress 2 Team Fortress 2 and Garry's Mod Garry's Mod, the point_spotlight itself has been converted to a server-only entity (does not take up an edict), and in Team Fortress 2 Team Fortress 2, when no targetname and parentname is assigned, the point_spotlight and spotlight_end entity is also killed, thus consuming 1 edict in total for a static spotlight.
Icon-Bug.pngBug:Killing this entity either by Kill input or by killing its parent while it's turned on will leave behind the beam and spotlight_end entities. Beam won't be visible but the spotlight_end will be.
PlacementTip.pngWorkaround:Fire LightOff input first, then with small delay Kill.
  (tested in: Half-Life 2,Black Mesa)
Note.pngNote:beam collides only with prop_static and world geometry, this means that beam of point_spotlight and dynamic light will ignore any dynamic objects (with the exception of func_physbox), NPCs, physics objects, e.t.c.
Third-Party notices Alien Swarm DeferredBlack Mesa
Note.pngNote:In Alien Swarm Deferred Alien Swarm Deferred this entity is not supported and on loading a map all point_spotlight entities will be converted to Light deferred!

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Ignore Solid (IgnoreSolid) <boolean> (in all games since Source 2013 Multiplayer) (also in Garry's ModMapbase , !FGD in Black Mesa)
If set, this spotlight won't trace for solids, emitting at its full length and ignoring potential obstructions.
Spotlight Length (SpotlightLength) <integer>
Length of the spotlight beam.
Spotlight Width (SpotlightWidth) <integer>
Width of the spotlight beam.
Color (R G B) (rendercolor) <color255>
Spotlight color.
HDR color scale. (HDRColorScale) <float>
Float value to multiply sprite color by when running in HDR mode.
Halo size scale. (HaloScale) <float> (in all games since Left 4 Dead 2) (also in Mapbase)
Float value to determine the size of the halo.
Mapbase Mapbase only properties
Halo material (HaloMaterial) <string>
Material to use for the halo.
Spotlight beam material (SpotlightMaterial) <string>
Material to use for the spotlight's beam.
Performance properties
Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <integer choices> (removed since Left 4 Dead)
The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices
Warning.pngWarning:If these are used, the object may break when the user switches their DirectX settings.[missing string]
Minimum / Maximum Effect Details Level (mincpulevel / maxcpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Effect Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mincpulevel, "High" for maxcpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
Minimum / Maximum Shader Details Level (mingpulevel / maxgpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Shader Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
  • 4: Very High
See also:  cpu_level / gpu_level convars

Flags

Start On : [1]
No Dynamic Light : [2]
Icon-Bug.pngBug:In Left 4 Dead 2 Left 4 Dead 2 alpha of spawned spotlight_end is set wrongly causing no light to be visible.
Note.pngFix:Use following script as point_spotlight's Entity script

function L4D2PointSpotlightFix() {
    for(local ent; ent = Entities.FindByClassname(ent, "spotlight_end");) {
        if(NetProps.GetPropEntity(ent, "m_hOwnerEntity") == self) {
            local clrrender = NetProps.GetPropInt(self, "m_clrRender");
            NetProps.SetPropInt(ent, "m_clrRender", clrrender);
            return;
        }
    }
}

function OnPostSpawn() {
    if((NetProps.GetPropInt(self, "m_spawnflags") & 3) == 0) {
        L4D2PointSpotlightFix();
    }
    self.ConnectOutput("OnLightOn", "L4D2PointSpotlightFix")
}

Inputs

LightOn
Turn the spotlight on.
LightOff
Turn the spotlight off.
LightToggle  (only in Mapbase)
Toggles the spotlight on/off
SetColor <color255RedirectInput/color32> (in all games since Alien Swarm) (also in Garry's Mod)
Change the color of the spotlight. Light must be turned off then back on for dynamic light to update.
Note.pngNote:Functionally identical to the Color input. A delay of at least 0.01 is required before the spotlight is turned back on, or else it will remain off.
ForceUpdate  (in all games since Alien Swarm) (also in Garry's Mod)
Force an update of the spotlight position and orientation.

Outputs

OnLightOn
!activator = !caller = this entity
Fires when light turns on.
OnLightOff
!activator = !caller = this entity
Fires when light turns off.

Code related

By default, point_spotlight uses the material sprites/glow_test02.vmt. You can change this if you are shipping your own binaries by going into point_spotlight.cpp in the server project, navigating to line 351 and replacing the file path with your own material or a reference to a variable set via a KV similarly as Mapbase Mapbase's SpotlightMaterial KV.

See also