[Code] Half-Life-Styled 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] Half-Life-Styled Flashlight

Post by The Zombie Killer »

This is basically some code that uses the new "LineAttack" ACS function in order to create a flashlight that isn't built into a weapon. Which means it requires the latest SVN version of GZDoom.

Anyway, have fun with it, I can see some good use for it in some horror-themed wads.

24/08/2013: New version. The flashlight is controlled almost 100% by ACS, which eliminates this bug. I've also added the new "FHF_NORANDOMPUFFZ" flag which eliminates the "bobbing" effect.
You may notice a few weird things in the ACS source, those are some remnants of some workarounds I tried to use, but failed with. Therefore I'm waiting on a feature suggestion in order to make this multiplayer compatible and remove the bullet decal workaround.

New version:
hlflash_v2.pk3
(24.84 KiB) Downloaded 500 times
OLD:
Spoiler:
-TZK
Last edited by The Zombie Killer on Fri Aug 23, 2013 8:39 pm, edited 2 times in total.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: [Code] Half-Life-Styled Flashlight

Post by Blue Shadow »

The Zombie Killer wrote:I had to remove bullet decals from weapons because the LineAttack function causes the puff fired to use the decal from whatever weapon the player is currently holding.
So, that's what is happening? Well, I guess it is a bug, then - It should be reported.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Half-Life-Styled Flashlight

Post by The Zombie Killer »

Well, that doesn't seem to be the problem now that I do more testing, it just seems to default to the BulletChip decal.

-TZK
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: [Code] Half-Life-Styled Flashlight

Post by Blue Shadow »

The Zombie Killer wrote:Well, that doesn't seem to be the problem now that I do more testing, it just seems to default to the BulletChip decal.
Does it happen when not inheriting from BulletPuff (making a completely new puff actor)?

Anyways, I gave it a quick test, and noticed two things (note that there is currently nothing that can be done about the second one, unfortunately, but it is still an issue, nonetheless):
  • The puff "lives" a little too long, thus making this when turning or strafing real quick.
    Spoiler:
  • The light "jiggles" up and down, due to the random z-height given to the puff when it's spawned. If only the NORANDOMPUFFZ flag can be used here.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Half-Life-Styled Flashlight

Post by The Zombie Killer »

@Blue Shadow
It still seems to happen when making a completely new puff actor.
I reduced the puff lifetime to 2 tics, and it happens less, but that's about all I can do, since 1 tic makes it disappear too quickly, so you don't see the light at all.
If only the NORANDOMPUFFZ flag can be used here.
Yeah, it'd be very helpful

-TZK
User avatar
SlapTheFish
Posts: 61
Joined: Fri Jun 14, 2013 5:51 pm
Location: Australia

Re: [Code] Half-Life-Styled Flashlight

Post by SlapTheFish »

This is perfect! Don't mean to sound like a :ugeek: here but, what button do you press to activate the 'flashlight'?
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Half-Life-Styled Flashlight

Post by The Zombie Killer »

@SlapTheFish
By default, the keyconf lump should bind the "F" key to the flashlight. If it isn't, then look for it at the bottom of the "Customize Controls" menu.

-TZK
User avatar
SlapTheFish
Posts: 61
Joined: Fri Jun 14, 2013 5:51 pm
Location: Australia

Re: [Code] Half-Life-Styled Flashlight

Post by SlapTheFish »

Thanks, this will help a lot.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Code] Half-Life-Styled Flashlight

Post by Enjay »

Feels very much like the HL flashlight. :yup:
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Half-Life-Styled Flashlight

Post by The Zombie Killer »

@Enjay
Now we just need another Half-Life TC *hint hint*

-TZK
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Code] Half-Life-Styled Flashlight

Post by Enjay »

Or at least an add on to an existing one. ;)

I guess this flashlight would be easy to drop into the project. I'll PM Rex to make sure he notices this thread. I haven't seen the levels properly so I don't know how useful a flashlight will be.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: [Code] Half-Life-Styled Flashlight

Post by ReX »

The flashlight will be quite useful in some parts of Paranoiac, which take place in caverns and other dark areas. With a flashlight, we might even consider making some of the areas quite dark, thereby requiring the player to seek out the flashlight.

I will take a look at the code when I get a chance (job-related travel is making any recreational activity quite difficult at the moment), and ask further questions when they arise.
tashita
Posts: 70
Joined: Mon May 02, 2011 6:36 pm

Re: [Code] Half-Life-Styled Flashlight

Post by tashita »

Can someone point me to WhoDunnit's flashlight? I want to use it in my mod. Who did that flashlight originally? Its the best one i've seen.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Code] Half-Life-Styled Flashlight

Post by The Zombie Killer »

New version out.

-TZK
User avatar
NantoCodd
Posts: 230
Joined: Thu Jul 18, 2013 12:58 am
Location: The Ultimate DOOUMB

Re: [Code] Half-Life-Styled Flashlight

Post by NantoCodd »

Err, sorry for the bump, but it seems the new version have some weird bugs:
-If you turn on the flashlight and project the beam into the sky, the beam will disappear. Reloading level required to fix it.
-Turning on the flashlight after level change will make the beam stuck at the first place lighted with the flashlight, keep the flashlight turned on during level change also led to this
Post Reply

Return to “Script Library”