Flashlight mechanics

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Flashlight mechanics

Post by Hidden Hands »

Can someone either explain to me how I can implement a flashlight for dark areas similar to Doom 3 but that requires batteries or alternatively a link to a ready made one? I'm sure Interstellar Enforcer used a similar mechanic.

Thanks in advance.
Jarewill
 
 
Posts: 1855
Joined: Sun Jul 21, 2019 8:54 am

Re: Flashlight mechanics

Post by Jarewill »

To make a flashlight, you would have to either spawn a bunch of light actors in DECORATE, or make a spotlight in ZScript.
The ZScript spotlight method is of course better. Both in looks and performance.
There is a very handy flashlight mod here that can be easily edited with a powerup.

As for making it have a depleting battery, you would need to do some CustomInventory wizardry.
Here is a working one:
Spoiler:
User avatar
Enjay
 
 
Posts: 27373
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Flashlight mechanics

Post by Enjay »

The flashlight I carry with me when I'm walking my dog: battery life 3 years and counting (used every day).

Game flashlight: battery life 1 minute if you're lucky. ;)
Post Reply

Return to “Scripting”