[Code] Beam Flashlight

Post your example zscripts/ACS scripts/etc here.

[Code] Beam Flashlight

Postby The Zombie Killer » Tue Oct 29, 2013 3:13 am

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
You do not have the required permissions to view the files attached to this post.
Last edited by The Zombie Killer on Fri Nov 01, 2013 1:02 am, edited 6 times in total.
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Tue Oct 29, 2013 7:14 am

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
Lisac_the_fox
 
Joined: 18 Oct 2013
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Postby Mikk- » Tue Oct 29, 2013 9:00 am

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
Mikk-
yooooooooooo
 
Joined: 30 Jun 2009
Location: Somewhere off Kanagawa
Discord: Mikk0451#3922

Re: [Code] Beam Flashlight

Postby ThomsonI » Wed Oct 30, 2013 4:27 pm

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
ThomsonI
Definitely wearing pants.
 
Joined: 22 Sep 2013
Location: Mega Lo Mart

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Thu Oct 31, 2013 11:44 am

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
Lisac_the_fox
 
Joined: 18 Oct 2013
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Postby Enjay » Thu Oct 31, 2013 11:53 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [Code] Beam Flashlight

Postby The Zombie Killer » Fri Nov 01, 2013 12:48 am

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
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Sat Nov 02, 2013 3:32 am

Now I tried the Zandronum version and Its aren't working. Maybe its don't working because I don't have openGL.
User avatar
Lisac_the_fox
 
Joined: 18 Oct 2013
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Postby The Zombie Killer » Sat Nov 02, 2013 3:55 am

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.
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Beam Flashlight

Postby osjclatchford » Tue Nov 05, 2013 4:38 am

tasty! such a shame this kinda thing is impossible in standard zdoom... :cry:
osjclatchford
 
Joined: 07 Feb 2011

Re: [Code] Beam Flashlight

Postby WARCHILD_89 » Fri Nov 29, 2013 1:54 pm

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
WARCHILD_89
DOOM NEMESIS / 3D MODELS / RESOURCE BACKUPS
 
Joined: 17 Nov 2013
Location: MIA between doomed dimensions

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Fri Dec 13, 2013 3:15 am

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
Lisac_the_fox
 
Joined: 18 Oct 2013
Location: In front of hell, looking down into the deep red abyss.

Re: [Code] Beam Flashlight

Postby The Zombie Killer » Fri Dec 13, 2013 6:18 am

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
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Fri Dec 13, 2013 8:34 am

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

Re: [Code] Beam Flashlight

Postby Lisac_the_fox » Fri Dec 13, 2013 8:41 am

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

Next

Return to Script Library

Who is online

Users browsing this forum: XLightningStormL and 0 guests