[Code] Half-Life-Styled Flashlight

Post your example zscripts/ACS scripts/etc here.

[Code] Half-Life-Styled Flashlight

Postby The Zombie Killer » Thu Jun 06, 2013 1:35 am

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


OLD:
Spoiler:

-TZK
You do not have the required permissions to view the files attached to this post.
Last edited by The Zombie Killer on Fri Aug 23, 2013 8:39 pm, edited 2 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] Half-Life-Styled Flashlight

Postby Blue Shadow » Thu Jun 06, 2013 3:16 am

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
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [Code] Half-Life-Styled Flashlight

Postby The Zombie Killer » Thu Jun 06, 2013 4:24 am

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

Re: [Code] Half-Life-Styled Flashlight

Postby Blue Shadow » Thu Jun 06, 2013 4:46 am

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
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [Code] Half-Life-Styled Flashlight

Postby The Zombie Killer » Thu Jun 06, 2013 5:07 am

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

Re: [Code] Half-Life-Styled Flashlight

Postby SlapTheFish » Sat Jun 15, 2013 4:32 pm

This is perfect! Don't mean to sound like a :ugeek: here but, what button do you press to activate the 'flashlight'?
User avatar
SlapTheFish
Aren't I lucky, I got a chunky bit!
 
Joined: 14 Jun 2013
Location: Australia

Re: [Code] Half-Life-Styled Flashlight

Postby The Zombie Killer » Sun Jun 16, 2013 2:11 am

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

Re: [Code] Half-Life-Styled Flashlight

Postby SlapTheFish » Sun Jun 16, 2013 2:31 am

Thanks, this will help a lot.
User avatar
SlapTheFish
Aren't I lucky, I got a chunky bit!
 
Joined: 14 Jun 2013
Location: Australia

Re: [Code] Half-Life-Styled Flashlight

Postby Enjay » Sun Jun 16, 2013 3:41 am

Feels very much like the HL flashlight. :yup:
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] Half-Life-Styled Flashlight

Postby The Zombie Killer » Sun Jun 16, 2013 3:57 am

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

-TZK
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Half-Life-Styled Flashlight

Postby Enjay » Sun Jun 16, 2013 4:01 am

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

Postby ReX » Tue Jun 18, 2013 6:02 pm

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.
User avatar
ReX
Title? I don't need no steenkin' title!
 
Joined: 05 Aug 2003
Location: Quatto's Palace

Re: [Code] Half-Life-Styled Flashlight

Postby tashita » Thu Jun 20, 2013 9:54 am

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.
tashita
 
Joined: 03 May 2011

Re: [Code] Half-Life-Styled Flashlight

Postby The Zombie Killer » Fri Aug 23, 2013 8:39 pm

New version out.

-TZK
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Code] Half-Life-Styled Flashlight

Postby NantoCodd » Sun Nov 03, 2013 1:53 am

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
User avatar
NantoCodd
 
Joined: 18 Jul 2013
Location: The Ultimate DOOUMB

Next

Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest