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 with batteries stored ..is there one out yet?

Author
Message
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 13th May 2016 12:02
i know there are amny flashlight system with batteries in fps creator and many of them works well and I use them too. but is there one of them or a script that can acheive to store the pickuped batteries and use them when necessary??


many thanks in advance
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th May 2016 02:07
JC LEON
Quote: "script that can acheive to store the pickuped batteries"

Yes, but has to be done custom. Exactly which flashlight script & battery are you using?
It's just a matter of using variables when picking up extra batteries. Then pressing a key
to "use up" one battery, thus recharging your flashlight.
I did something very similar using "health pills" using huds.

So which script/scripts are you using?
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 14th May 2016 11:12
iìm using the simple flashlight for v.117
https://forum.thegamecreators.com/thread/179916

and this is the flashlight script

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th May 2016 12:06
JC LEON
I played with the script a little and I remember this one.
As you know it uses a dynamic light for the "flashlight". It's good when using
segments without shaders (like the ones in ww2 packs) but awful when
using shaders as the scifi ones. Do a test run and you'll see what I mean.
I would look for one that uses "ambience" for the light. You can still work
the "batteries" into the script.
Also, if your using Black Ice mod there is a built in flashlight, did you know?
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 15th May 2016 15:38
Quote: "JC LEON
I played with the script a little and I remember this one.
As you know it uses a dynamic light for the "flashlight". It's good when using
segments without shaders (like the ones in ww2 packs) but awful when
using shaders as the scifi ones. Do a test run and you'll see what I mean.
I would look for one that uses "ambience" for the light. You can still work
the "batteries" into the script.
Also, if your using Black Ice mod there is a built in flashlight, did you know?"


yes you are right
I didnt remember that issue with shader segments

what do you suggest?
i saw many great flashlights used in russian community like this
https://www.youtube.com/watch?v=xpLcFUbZzMY
and the kreatorshina mod...but i think the modified the soruce

I use the black ice mod and i love ti but sincerly the flashlight of the mod is not my preferred ..but if this the best solution i can use it
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 18th May 2016 02:18
JC LEON
Quote: "what do you suggest? "

There are so many choices. It all depends on your needs.
Yes, the video you linked to is a good example.
I understand what your getting at, a built in flashlight compared to a hud one.
Yes, sometimes a "hud" type flashlight seem to fit better in your maps current environment.
But not always.

After watching the video I recall a user from long ago made a similar flashlight, so I tried
to duplicate the effect.

What I did was to attach the hud directly to the flashlight, so now the "hud" isn't stationary
on the screen anymore. A little bit better effect...

My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 18th May 2016 22:27
fantastic ..how did you make to attach the hud directly to the flashlight??

thisi is a great solution..


and about storing batteires??
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th May 2016 18:10
JC LEON
Quote: "how did you make to attach the hud directly to the flashlight??"

Got the idea from another thread. It's quite easy actually. Same as when you fire a weapon,
the "muzzle flash" is displayed in front of the weapon. So I just took a flat plane and displayed
it in front. Still working on the animation, kind of sloppy right now. Try to clean it up some.
Hope to be done next cpl days?
Quote: "and about storing batteires??"

Got that also working Just deciding which "key" to use for installing new battery?
Picking up the "battery" is easy, then to store it for later use. I figured the "B" key might be best???
What do you think?
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 20th May 2016 23:52
yes i think thr b key is good too...and thanks for your effort..
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st May 2016 16:37
JC LEON
Ok, ran into a little problem when using more than one weapon
Are you planning to use more than the "flashlight" or maybe
"dual weapons" at once???
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 21st May 2016 16:47
i'm planninig to use the flashlight and obviusly a weapon (not dual welding).. but if i can switchfrom flashlight to the weapon is ok the same for me...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st May 2016 16:54
JC LEON
Quote: " (not dual welding)"

Ok great, that was a big problem I was having. Switching to another weapon isn't a problem.

My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th May 2016 14:07 Edited at: 29th May 2016 14:12
Finished putting together a simple "hud" type flashlight with "pickup" batteries that one can store
until later use. All credit for script goes to S4Real FlashlightV3 (permission received - Thank you S4real)


Please read the "readme.txt" inside, a few changes are needed to make it work properly with your
level setup. (plrcurrentweapon=) Else it wont work
"F" key for turn on/off flashlight, "B" key to recharge flashlight.
Store extra batteries for later use. Any problems, let me know.

best

Forgot to mention, works with V1.20_1.17. BlackIce Mod has changed some "hud" commands
and screen resolution. Not hard to change script & image to make it work.
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 29th May 2016 18:57 Edited at: 29th May 2016 19:11
do this works correctly with shader segments??

and i noticed that with Black ice mod when i take the flashlight i can start it with sx mouse button as normal (this function is disabled in 120b117 without BiM) and with "F" key...

how cain i disable the standard Black ice mod flashlight activation and manatin only the "f" key activation?

and what about hud using Bim? can i simply resize it to 1920x1080 nin any paint tool?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th May 2016 19:04
Quote: "do this works correctly with shader segments??"

Yes, because it uses "ambience" for the flashlight effect.
Not the built-in Flashlight.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th May 2016 20:48
JC LEON
Flashlights are activated by scripts. The script I posted above will not activate the "built in" flashlight, will only
use ambience for effect.
Quote: "can i simply resize it to 1920x1080"

Yes, that should do it. Check your screen resolution first ( i think mines set to 1280x720? )
Also, Black Ice Mod, in the doc's folder there is a txt file explaining the new hud commands.

My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 29th May 2016 21:35 Edited at: 29th May 2016 21:48
Quote: "Flashlights are activated by scripts. The script I posted above will not activate the "built in" flashlight, will only
use ambience for effect. "


i noticed several bugs..

1- If i use the script pack with the black ice mod after i collect the flashlight i can use it even pressing sx mouse button like standard black ice mod flashlight 8 and even pressing "F" key like script )
2- after collecting the flashlight and i press the "b" key to substitute battery i could recharge the battery for free even if i didnt pickup ant additional battery
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th May 2016 03:16
JC LEON
1-
Quote: "i can use it even pressing sx mouse button"

Ah yes, that's right. I take it you used the standard "Nomad Mod" flashlight.
Since it's a weapon, clicking the mouse "fires" the weapon. The light you see is the "muzzleflash".
Simple fix, I'll email you and explain. Just a few changes are needed to the "gunspec" file.
2-
Quote: " i could recharge the battery for free even if i didnt pickup ant additional battery"

I tested using Black Ice and I see what you mean. The script starts with the "battery variable" set to zero?
But I am able to "use" one battery-recharge once, and I shouldn't be able to???
Have to look into this. Thanks for pointing this out...
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 5th Jun 2016 20:58
JC LEON
"Problem with running multiple variables" & "Batteries Collected Count"
After working on this, finally came up with a solution. Since the "Flashlight" is a weapon, I just turned the Batteries
into "ammo" for the Flashlight. A tally of collected batteries is kept as ammo now. To recharge the Flashlight all
one does is "reload the flashlight" .

Before a battery is collected.

After a battery is collected.

So far seems to works good.
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 6th Jun 2016 09:31
great.. really cool

cant wait for release..
many thanks...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th Jun 2016 11:20
JC LEON
Sent you an email with test-map & files. Still has that little bug when player picks up a
weapon you have "one" ammo (even with everything set to zero)? Only thing I could
think of was to place a trigger/script to discharge one ammo when flashlight is picked up.
It's not perfect, but works.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Jun 2016 21:34
Updated the flashlight & ammo (battery) files. I think I worked out most bugs.
Place main script (flashlight_$CA) with trigger anywhere in level. Everything runs from the one script.
Place "battery/ammo" entities where needed. Pickup batteries (stored as ammo) Press "R" to reload flashlight.
Also a small bug (flashlight variable) always starts with one battery (ammo) ? Work around was to place a trigger
with a small script over where one would pickup the Flashlight (I named it flashlight_plraction1) This will "discharge"
one ammo when flashlight is picked up.
Any problems let me know...
best
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 10:41:23
Your offset time is: 2024-04-20 10:41:23