Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Flashlight, Batteries included [v117]

Author
Message
mentored1
13
Years of Service
User Offline
Joined: 28th Dec 2010
Location: Rhode Island, USA
Posted: 5th Jan 2011 08:01
Greetings people!

This is my first post, so I thought I'd make it meaningful. I used the flashlightv3 setup for awhile and was impressed. I decided to rewrite that basic idea, making some tweaks and whatnot, and add in some new features.

Alan Wake got me thinking about making light a resource.

-- Need to find a flashlight pickup, torch, etc before the flashlight works

-- Battery power shown in the corner as a percentage. The percentage drains and does not recharge until you install fresh batteries.

-- The light beam intensity decreases as the battery dies.

-- The battery clicks off when consumed and the light won't work until you find a new battery.

-- Batteries can be installed with the flashlight on or off. There is an on-screen text when the battery is being swapped. If the light is on, it will temporarily click off while the battery is installed.



Also included is a flashlight battery entity. I used the sci-fi battery, scaled down via Entity Workshop, and edited the .fpe file to include the necessary scripts. All you should have to do is put it in the game.

All necessary graphic and audio files are included. The original header from flashlightv3 was inserted in the new script as a tribute. Everything is free to use however you please.

I hope all the right files are included--I think they are! It works pretty good on my test levels and should be a great addition to dark games, especially with the need to find batteries.


*** SETUP:

1. Unzip and drag-drop / cut-paste the Files folder into your FPS Creator directory

2. Create a dynamic light entity anywhere in the level. Name it 'flashlight_source' (very important to spell it right as this entity controls the light and battery operations). Set the light radius to 0. Set the main script to 'scriptbank\user\flashlightm\flashlight.fpi'

3. Create a flashlight object (ww2 or sci-fi torch works well) and set the main script to 'scriptbank\user\flashlightm\flashlight_pickup.fpi'. The flashlight function ('F' key on/off) will not work until you find the flashlight with this script.

4. Put battery entities in the level as desired (should be under Entities\user\flashlight_battery). The script should already be in place, but if it's not (for some odd reason) set the main script to 'scriptbank\user\flashlightm\battery.fpi'

* Once you acquire the flashlight, you can use it normally via the 'F' key. The battery will drain and it won't recharge. Batteries restore 100% power.

* The flashlight and batteries require action use to pick-up.

"We believe whatever we want to believe."
-Demosthenes

Attachments

Login to view attachments
Mazinger
13
Years of Service
User Offline
Joined: 26th Nov 2010
Location:
Posted: 6th Jan 2011 00:54
woooooooo, wonderful
Thanks

Sorry for the English traducctor use google.
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 6th Jan 2011 20:43 Edited at: 6th Jan 2011 20:44
...nifty and fun! Nice work on this, mentored1.

Although not required, is there any chance you could post a screenshot, to
showcase the HUD ingame?

DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 7th Jan 2011 17:08
cant get it to work in my V1.18 Version.

defiler
15
Years of Service
User Offline
Joined: 4th Apr 2009
Location: Canada
Posted: 8th Jan 2011 22:26
This would add something unique to my sci fi game - have the suit run on a different power source which you must replenish in order for the suit's built in light to work!


Many thanks!

Current Project: Lost Contact: Station 7
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 10th Jan 2011 14:15
Nice script . Is it a circle flashlight ? you know , like the one in Condemned : CO and so ? or it just lights up the whole area around the player ?

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
mentored1
13
Years of Service
User Offline
Joined: 28th Dec 2010
Location: Rhode Island, USA
Posted: 12th Jan 2011 16:40
Thanks for the comments, guys.

I attached an updated version (just the main script) to use an etimer, so it doesn't interfere with other timers.

If anyone is into scripting, you can modify the flashlight however you see fit. It's set to decrease 10% power every 30 seconds, by default. You can change this as desired. Also, after 50% power, the flashlight dims every 10 % lower until going out.

I'll attach some screens in a subsequent post.

darkjames wrote: "cant get it to work in my V1.18 Version."


Yar, that's why I noted v117 in the thread title--I have no idea if it works on 118 or not. Sorry, dude.

"We believe whatever we want to believe."
-Demosthenes

Attachments

Login to view attachments
mentored1
13
Years of Service
User Offline
Joined: 28th Dec 2010
Location: Rhode Island, USA
Posted: 12th Jan 2011 16:52
Disregard my last message and the updated script.

If the original script isn't playing nice with timing, go in and switch the timer entries to etimer. Minor oversight.

Also, you may want to tweak the ambient levels in the script to suit your needs since the flashlight defaults to darkness when switched off.

I made a new version for an internal project that isn't quite ready for release yet. I'm attempting to make a sort of ambience control that, when the flashlight is switched off, it will return to whatever ambience level the area is set at. Hopefully, this will allow ambient changes in interior/exterior areas or whatnot and the flashlight won't muck it up too much.


Attached is a screen shot of the flashlight

"We believe whatever we want to believe."
-Demosthenes

Attachments

Login to view attachments
mentored1
13
Years of Service
User Offline
Joined: 28th Dec 2010
Location: Rhode Island, USA
Posted: 12th Jan 2011 16:54
@defiler: That sounds awesome! The included battery script could easily be used for any pickup object. Nice, dood!

"We believe whatever we want to believe."
-Demosthenes
Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 13th Jan 2011 23:22 Edited at: 13th Jan 2011 23:23
Epic, man. - Dashed back to give you a

I'm that thing you catch a glimpse of in the corner of your eye... The flash when you readjust the rear view mirror...

mentored1
13
Years of Service
User Offline
Joined: 28th Dec 2010
Location: Rhode Island, USA
Posted: 14th Jan 2011 08:10
I appreciate the comments, guys--seriously. I just started with this stuff, so I'm not all that confident in the outcome. I was working with GameMaker up until recently, but I just feel that FPS is the ultimate genre, right?

My recent tweak included a second dynamic light which controls the level ambient light. Basically, it keeps track of the ambient light for whatever level you're game is on based on activated variables. This way, the flashlight (when switched on/off) will return to normal ambient levels by interacting with the activated variable in the "ambient_control" entity. I'm about done with this extra addition, so if it's something you want/need please let me know.

"We believe whatever we want to believe."
-Demosthenes
DarkJames
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 23rd Feb 2011 23:44
Maybe a Terrible One, But a Necesary one for me

Can you make the same script with no Timer, so its endless Flashlight?.

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 24th Feb 2011 05:55 Edited at: 24th Feb 2011 06:01
This is a simple flashlight script. You will need to download and install mentored1’s files. Add a dynamic light, put this in the main script and set its radius to 0. You may want to give it a unique name if you want to use additional dynamic lights. The 'F' key is used to turn it off and on.



BTW: Awesome flashlight script mentored1.
sic1ne
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 3rd Mar 2011 09:22
My recent tweak included a second dynamic light which controls the level ambient light. Basically, it keeps track of the ambient light for whatever level you're game is on based on activated variables.

hello i could use that new script are you reffering to that fixes the ambient light problem!



also just to make shure were on the same page! ok i made a room that has no ambient light completely dark set at 0. when i turn on the flashlgiht i can see were im goin no problem but when i turn off the flashlight the ambient light changes and turns itself up because before i turned on the flashlight the ambient level was at 0

[imghttp://img97.imageshack.us/img97/6489/sic1ne.jpg[/img]
[/img]
mgarand
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: The Netherlands
Posted: 3rd Mar 2011 16:56
nice

dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 05:22
is the ambient light fix script ready? could really use one, since im gonna need flashlight quite a lot and would like to have some ambient light remaining.
cam64DD
13
Years of Service
User Offline
Joined: 23rd Jan 2011
Location: Brazil
Posted: 14th Mar 2011 01:08
Batteries don't work, I can't pick them up. Help?

HOT POTATO HOT POTATO HOT POTATO CHOO CHOO kthnxbai.
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 14th Mar 2011 21:38
its cuz the battery script wasnt properly added to the entity.. just readd the script.. that works.
Jeko
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: On TGC Forum
Posted: 22nd Mar 2011 13:13
come on men you really dont know how to get ambience back.

its easy- just search where ambience=0 and change it to ambience that you want to be without flashlight (original game ambience)

if you want new ambience on new lv copy original flashlight script and in copy set that ambience=0 to new ambience

I will also post script that you have flashlight on new level without pressing enter so will work like weapon

My Specs : CPU: Intel Pentium Dual-core 2.80 GHz Win7 Ultimate
Memory: 4 GB RAM DDR2
Grapphics Card : NVidia GeForce 210 1 GB
Jeko
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: On TGC Forum
Posted: 22nd Mar 2011 13:14
if you fallow setup that mentored give its work with 1.18 v9

My Specs : CPU: Intel Pentium Dual-core 2.80 GHz Win7 Ultimate
Memory: 4 GB RAM DDR2
Grapphics Card : NVidia GeForce 210 1 GB
FrankCastle0
14
Years of Service
User Offline
Joined: 15th Nov 2010
Location:
Posted: 31st May 2011 05:48
Is there a way to set this up for a torch or lantern? This is an excellent script, but my game takes place in a castle, and finding flashlights and batteries would be silly there =P
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 1st Jun 2011 02:04
Just tried this out in 1.18 beta 17 and it works fine. I was even able to adjust the ambience to match that in my game.

Well done, I like this a lot

SgtBrown5
14
Years of Service
User Offline
Joined: 10th Mar 2010
Location:
Posted: 3rd Jun 2011 01:54
wont work for me. every thing seems to work but once I push f nothing happens. Please help

SgtBrown5
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 3rd Jun 2011 02:02
Did you re-name the dynamic light to 'flashlight_source'?

I made the same mistake to start with, and wondered why the 'f' button wasn't working. Then I re-read the instructions and realised I hadn't re-named the light!

You also need to make sure you've spelt it correctly.

the lion
17
Years of Service
User Offline
Joined: 9th Sep 2007
Location:
Posted: 29th Jun 2011 10:43
just what i was looking for . working great in 1.18.
Thank you.
Mehtab
13
Years of Service
User Offline
Joined: 30th Jun 2011
Location:
Posted: 1st Jul 2011 18:50
where can i find this dynamic light?
s4real
VIP Member
18
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 20th Jul 2011 00:31
It nice to still see my original flashlight script being modded even more.

Well done on the script

great work

best s4real



Pack ya games with vishnu packer its free.
Desecrated Studios
13
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 20th Jul 2011 00:37
@Mehtab =

-Josh
Website is under construction
System Specs: AMD Phenom x3 2.2GHz, 4GB DDR2 RAM, 1TB HD, HD Radeon 5770 1GB, 22in Acer Monitor
zerocool126
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location: usa
Posted: 28th Jul 2011 09:50
i love the flash light great job on it. i was wondering if there was a way to deactivate the flash light in trigger zone.

Login to post a reply

Server time is: 2024-11-24 06:43:54
Your offset time is: 2024-11-24 06:43:54