LWM's Flashlight is Broken 4.2.1

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

LWM's Flashlight is Broken 4.2.1

Postby Enjay » Tue Sep 10, 2019 1:50 pm

Years ago, LilWhiteMouse made a flashlight that uses a script to spawn a stream of actors with dynamic lights attached to act as a flashlight. Although other, more modern, flashlights are now available, I still like and still use this one (aside from anything else, it acts independently to the weapons). However, with 4.2.1 it has stopped working. It worked with 4.2.0.

Here it is working in 4.2.0


But it doesn't work in 4.2.1. However, it is just the dynamic lights that are failing. The actors are being spawned.

Here is a screenshot of the map in 4.2.1 with the AM_Cheat active:


I have attached a cut down version of the flashlight that works in 4.2.0. To use it, load the pk3 and type

+uselwmflashlight

at the console.
Attachments
lwmfl.pk3
(3.39 KiB) Downloaded 3 times
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: LWM's Flashlight is Broken 4.2.1

Postby Nash » Tue Sep 10, 2019 2:00 pm

While I am not dismissing this as a possible bug, why do you not prefer modern spotlight-based flashlights? Not only is it more performance-friendly, as it's only a single light actor, but it would also light things in a more physically accurate way, and lastly, will generate proper shadows if shadowmaps are enabled.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: LWM's Flashlight is Broken 4.2.1

Postby Enjay » Tue Sep 10, 2019 2:09 pm

One stumbling block is that I don't know how to make one that acts independently of the weapons. With this one, I can bind a key to it and the key runs the flashlight regardless of which weapon is selected or whether I'm firing or not. (I have it bound so that I have to hold the flashlight button to keep it on rather than toggling it on/off so I can't just leave it on all the time).

The other thing is that, actually, I simply haven't found a modern flashlight implementation that I like. Dodopod's one is pretty good but when I tried modifying it to work in the same way as I used LWM's one, i just got horribly lost and it didn't look that much better to me anyway.

A simple, clean modern version would, of course, be preferable but it would need to be activated in the same way, would need to illuminate things just as well (IMO of course).


However, the merits of the different types of lights aside, I can't figure out why this isn't working. The actors are spawning, but the lights are not showing. Other actors spawn with lights just fine so I'm not sure what the difference is.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: LWM's Flashlight is Broken 4.2.1

Postby Enjay » Tue Sep 10, 2019 2:17 pm

Aha! Progress!

I have found how to make the light work again.

If I change line 86 in the DECORATE from:
Code: Select allExpand view
NONE A 1

to
Code: Select allExpand view
NONE A 2

The lights appear. So, for some reason, I guess that in 4.2.1 that actor isn't around long enough for the light to appear. Maybe?

(BTW a sprite called NONEA0.png is included)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: LWM's Flashlight is Broken 4.2.1

Postby Nash » Tue Sep 10, 2019 2:27 pm

Enjay: Maybe Steve's Flashlight Mod is more suitable for you. Works exactly the way you describe it; doesn't depend on weapons, has a bindable key. Much simpler than Dodopod's one. viewtopic.php?f=43&t=59429

Anyway, that said, carry on with the current investigation. Anything that used to work before but now doesn't, is always worth reporting. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: LWM's Flashlight is Broken 4.2.1

Postby Enjay » Tue Sep 10, 2019 3:11 pm

Thanks, I'll check out Steve's one. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: LWM's Flashlight is Broken 4.2.1

Postby Caligari87 » Tue Sep 10, 2019 7:08 pm

At risk of sounding narcissistic, gonna just plug DarkDoomZ as well. The flashlight is lightly customizable with simple good looking presets, one-key toggle, and the darkening effects are completely optional. Also not to toot my own horn too much but I think it's one of the better-looking implementations; I spent a lot of time tweaking the preset values.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: LWM's Flashlight is Broken 4.2.1

Postby Nash » Fri Sep 13, 2019 3:57 am

Code: Select allExpand view
class LADGunLight Actor
{
    Default
    {
        +
NOINTERACTION
    
}

    
States
    
{
    
Spawn:
        
TNT1 A 2 Light("Light_GunLight");
        
Stop;
    }
}
 


Seems like I ran into this problem, too. This was an actor that gets spawned when I fired my weapon to generate muzzle flash lighting. The light just doesn't appear anymore, even though the actor is spawned correctly.

Changing TNT1 A 2 to TNT1 A 3 - so 1 additional state tic - will "fix" the lighting.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes


Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests