View Issue Details

IDProjectCategoryView StatusLast Update
0003752The Dark ModCodingpublic15.09.2014 09:57
ReporterSteveL Assigned ToSteveL  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionfixed 
Target VersionTDM 2.03Fixed in VersionTDM 2.03 
Summary0003752: Let entity lights use shadowlights and blendlights
DescriptionEntity lights are extinguishable and relightable by several methods: frobbing, stims, various script events, activation / targeting, etc. None of these methods turn shadowlights on and off. The only way to do that using the scripts is to remove and replace the light *shader*.
Additional InformationThis can be fixed for most lights by amending the script objects (tested ok), but with 2 problems:

1. The scripts can't tell which shader the light is *currently* using. They can access the "texture" spawnarg to find out the shader at map start, but that won't be any good if mappers change shaders during gameplay.

2. Not all methods of toggling entity lights use the script object. A water stim on a flame will go straight to the frob_extinguish method on the flame, bypassing the LightsOff() method on the entity. LightOff() calls frob_extinguish for torches but not desk lamps or mushrooms, which are turned off directly. So if fixed in the scripts, the new code would need to appear more than once.

Current action is mapping out the ways lights can get toggled to see whether there's a single place in the game code where it could be fixed instead of using the amended scripts.
TagsNo tags attached.

Relationships

related to 0003765 resolvedSteveL Add a script event for lights GetShader() to complement existing SetShader() 
related to 0003238 resolvedSteveL Lights are still rendered, even when hidden or off 

Activities

SteveL

SteveL

17.06.2014 10:35

reporter   ~0006676

Last edited: 17.06.2014 13:53

My conclusion (2) above is wrong: it seems all routes to turning off an entity light call both tdm_light_holder::LightsOff() and idLight::Off() at some point, because the different routes call one another. response_extinguish() joins the party too with calls to both, Off() via idLight::fadeOutLight. So this could be fixed in the game code OR the script object. grayman has been here before and has ensured that On()/Off() always get called at some point by all the methods. If we do this in the script object, we'll want to add a script event idLight::Event_GetShader() to match idLight::Event_SetShader(), so that entity lights that change their blendlight during runtime are supported too.

NB there are ways to turn combined entity lights off without LightsOff() being called, if (1) it's a def-attached light as opposed to an idLight with a model (flames, basically) and (2) the spawned light entity is addressed directly. But it's hard to imagine a developer doing (2), going to some trouble to deliberately bypass the light holder, while still expecting the associated shadow light to turn off.

Obsttorte

Obsttorte

19.06.2014 15:52

developer   ~0006679

Regarding (1): There is a script function setShader which allows to change the light texture of a light, but no method getShader.

I suggest adding it.
SteveL

SteveL

23.06.2014 18:08

reporter   ~0006683

Yes, I noticed the missing getShader. We decided to fix this issue in the game code instead in the forum discussion linked below, but I'll raise a separate tracker for getShader(). Easy to implement, and setShader() is not really useful without it.

http://forums.thedarkmod.com/topic/16351-shadow-lights-on-combined-entity-lights/

Patch for the shadowlight issue is ready, which I'll commit once the svn trunk settles down.
SteveL

SteveL

06.07.2014 14:59

reporter   ~0006700

committed rev 6051

Issue History

Date Modified Username Field Change
13.06.2014 15:35 SteveL New Issue
13.06.2014 15:35 SteveL Status new => assigned
13.06.2014 15:35 SteveL Assigned To => SteveL
17.06.2014 10:35 SteveL Note Added: 0006676
17.06.2014 10:41 SteveL Note Edited: 0006676
17.06.2014 13:53 SteveL Note Edited: 0006676
19.06.2014 15:52 Obsttorte Note Added: 0006679
23.06.2014 18:08 SteveL Note Added: 0006683
23.06.2014 18:14 SteveL Relationship added related to 0003765
06.07.2014 14:59 SteveL Note Added: 0006700
06.07.2014 14:59 SteveL Status assigned => resolved
06.07.2014 14:59 SteveL Fixed in Version => TDM 2.03
06.07.2014 14:59 SteveL Resolution open => fixed
15.09.2014 09:57 tels Relationship added related to 0003238