Page 1 of 3

[Code] Beam Flashlight

PostPosted: Tue Oct 29, 2013 3:13 am
by The Zombie Killer
This is a "rejuvenation" of the flashlight code used in LilWhiteMouse's "Cammy".
How this is done, is by firing 19 flashlight "beam" projectiles in order to create a more realistic flashlight effect.
It looks really nice:
Image

The flashlight is easily tweakable, by changing two decorate constants, you can get this "shoulder-mounted" effect:
Image

Download:

beamflashlight.pk3

beamflashlight_zan.pk3

Re: [Code] Beam Flashlight

PostPosted: Tue Oct 29, 2013 7:14 am
by Lisac_the_fox
I'm try to use this in skulltag and i get following error:
script error, "beamflashlight.pk3:decorate.txt" line 14:
Invalid state parameter nodelay

Re: [Code] Beam Flashlight

PostPosted: Tue Oct 29, 2013 9:00 am
by Mikk-
That's because Skulltag/Zandronum can't use the NoDelay feature. Use one of the latest GzDOOM builds

Also I just tried it out. It's pretty cool except when you walk towards a wall the dynamic lights "blink", and it looks kinda weird.

Re: [Code] Beam Flashlight

PostPosted: Wed Oct 30, 2013 4:27 pm
by ThomsonI
Dude, awesome! Haven't downloaded yet, but the principles for this would be usable for a sphere of light around the player, right?

Re: [Code] Beam Flashlight

PostPosted: Thu Oct 31, 2013 11:44 am
by Lisac_the_fox
Mikk- wrote:That's because Skulltag/Zandronum can't use the NoDelay feature. Use one of the latest GzDOOM builds

Also I just tried it out. It's pretty cool except when you walk towards a wall the dynamic lights "blink", and it looks kinda weird.

thanks

Re: [Code] Beam Flashlight

PostPosted: Thu Oct 31, 2013 11:53 am
by Enjay
I think that I managed to minimise the "blinking" with my own implementation of LWM's code but I'm not sure where my files are ATM. I'll be honest, I can't really remember what I did. I think that I adjusted the speed and/or the spawn distance/frequency of the actors and also tweaked the dynamic lights to my own personal preferences. If I get a chance, I dig out my version of this and have a look. I'm not saying that mine is any better, just (slightly) different and closer to what I wanted at the time.

Re: [Code] Beam Flashlight

PostPosted: Fri Nov 01, 2013 12:48 am
by The Zombie Killer
Lisac_the_fox wrote:I'm try to use this in skulltag and i get following error:
script error, "beamflashlight.pk3:decorate.txt" line 14:
Invalid state parameter nodelay

I've added a Zandronum compatible version. Should [hopefully] work in Skulltag too.

Mikk wrote:It's pretty cool except when you walk towards a wall the dynamic lights "blink", and it looks kinda weird.

Yeah, I've noticed that too

ThomsonI wrote:but the principles for this would be usable for a sphere of light around the player, right?

I guess so, yeah. It's more of a cone of light than a sphere though

Enjay wrote:I think that I managed to minimise the "blinking" with my own implementation of LWM's code but I'm not sure where my files are ATM. I'll be honest, I can't really remember what I did. I think that I adjusted the speed and/or the spawn distance/frequency of the actors and also tweaked the dynamic lights to my own personal preferences. If I get a chance, I dig out my version of this and have a look. I'm not saying that mine is any better, just (slightly) different and closer to what I wanted at the time.

Looking forward to messing with that if you can manage to dig it up.
__________________________________________________

Zandronum version added. It's also compatible with GZDoom. The Zandronum version is probably more stable than the GZDoom version, so I'll update the GZDoom one to use the same programming methods that I used in the Zandronum version.

The only real difference between the Zandronum and GZDoom versions is the fact that the GZDoom version uses named scripts.

Edit: GZDoom version updated.
Edit 2: Both versions updated.

Re: [Code] Beam Flashlight

PostPosted: Sat Nov 02, 2013 3:32 am
by Lisac_the_fox
Now I tried the Zandronum version and Its aren't working. Maybe its don't working because I don't have openGL.

Re: [Code] Beam Flashlight

PostPosted: Sat Nov 02, 2013 3:55 am
by The Zombie Killer
Lisac_the_fox wrote:Maybe its don't working because I don't have openGL.

That would be why, dynamic lights are GL-exclusive. They aren't in software.

Re: [Code] Beam Flashlight

PostPosted: Tue Nov 05, 2013 4:38 am
by osjclatchford
tasty! such a shame this kinda thing is impossible in standard zdoom... :cry:

Re: [Code] Beam Flashlight

PostPosted: Fri Nov 29, 2013 1:54 pm
by WARCHILD_89
Is there a way to get this flashlight blocked by middle textures??


impassible bushes are fine because the flashlight gets blocked by the raised floor in the middle of the bush, but if the bush is made only by middle textures the flashlight goes through the bush without affecting it...

See here what i mean :
https://fbcdn-sphotos-h-a.akamaihd.net/ ... 5749_n.jpg

Re: [Code] Beam Flashlight

PostPosted: Fri Dec 13, 2013 3:15 am
by Lisac_the_fox
I get new graphic card, via uni chrome, and I have opengl 1.2 with latest drivers. I can't find where in gzdoom I can change to opengl.

Re: [Code] Beam Flashlight

PostPosted: Fri Dec 13, 2013 6:18 am
by The Zombie Killer
As far as I know, GZDoom requires at least OpenGL 1.4.
There is no option to switch to OpenGL because it is in OpenGL mode by default. However, since GZDoom still contains the software renderer, you can switch between GL and software with the vid_renderer console command
vid_renderer 0 - Software
vid_renderer 1 - OpenGL

Re: [Code] Beam Flashlight

PostPosted: Fri Dec 13, 2013 8:34 am
by Lisac_the_fox
Thanks anyway.

Re: [Code] Beam Flashlight

PostPosted: Fri Dec 13, 2013 8:41 am
by Lisac_the_fox
Working with my opengl 1.2 . Flashlight is great.