[Code] Beam Flashlight

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

[Code] Beam Flashlight

Post 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
GZDoom Version [V3]
(24.31 KiB) Downloaded 6599 times
beamflashlight_zan.pk3
Zandronum Version [V2]
(24.3 KiB) Downloaded 2044 times
Last edited by The Zombie Killer on Fri Nov 01, 2013 1:02 am, edited 6 times in total.
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post 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
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: [Code] Beam Flashlight

Post 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.
User avatar
ThomsonI
Posts: 128
Joined: Sun Sep 22, 2013 1:13 pm
Location: Mega Lo Mart

Re: [Code] Beam Flashlight

Post 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?
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post 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
User avatar
Enjay
 
 
Posts: 26535
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Code] Beam Flashlight

Post 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.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Beam Flashlight

Post 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.
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post 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.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Beam Flashlight

Post 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.
osjclatchford
Posts: 2058
Joined: Mon Feb 07, 2011 5:02 am

Re: [Code] Beam Flashlight

Post by osjclatchford »

tasty! such a shame this kinda thing is impossible in standard zdoom... :cry:
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: [Code] Beam Flashlight

Post 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
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post 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.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Beam Flashlight

Post 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
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post by Lisac_the_fox »

Thanks anyway.
User avatar
Lisac_the_fox
Posts: 137
Joined: Fri Oct 18, 2013 7:22 am
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Post by Lisac_the_fox »

Working with my opengl 1.2 . Flashlight is great.
Last edited by Lisac_the_fox on Tue Aug 26, 2014 6:29 pm, edited 1 time in total.
Post Reply

Return to “Script Library”