Scripts / Disabling Flashlight until you collect one

Author
Message
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 23rd May 2016 21:47
Here are 2 simple scripts to disable the use of the Flashlight until you found and collect one.

flashlight_collect.lua : set this script to a flashlight entity (you can find one in FPSC Sci-Fi pack converted to GG by Teabone :http://freetoronto.org/gameguru/

has_flashlight.lua : set this script to any entity and set its properties as follows : Static Mode NO

And that's it.... Pressing F Key will have no effect until you collect a flashlight




Attachments

Login to view attachments
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 23rd May 2016 22:21 Edited at: 23rd May 2016 22:22
Nice scripts.

I did something similar a while back, SmallG had made a script to make the torch drain and have collectable batteries for the flashlight, and someone requested a collectable flashlight script, so I made one, then decided to work it into SmallG's scripts to make a more complete setc, you can find it at:

https://forum.game-guru.com/thread/214886#msg2544112
Quote: "

1. put flashlight3.lua on a not static item (make it always active).
2. put collect_flashlight2.lua on the item you want to collect (make sure it's not static).
3. flashlight_battery.lua goes on the batteries,(make sure the battery is not static).

Job done, it will supress the flashlight until you collect the item.

Press F to use the flashlight once you have collected it, and hold press and hold F to load a battery."

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.

Attachments

Login to view attachments
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 23rd May 2016 22:28
Hi Belidos,

sounds very nice and much more realistic than mine (i'm very new in LUA scripting and my flashlight collect script is just a small modifications of default key script).
i will test them right now
cheers
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 23rd May 2016 22:34
Always good to see someone learning lua, I have to admit i'm not very good at it myself, but i'm really glad I decided to learn by jumping in and learning by editing existing scripts, it was a lot easier than trying to understand lua manuals etc

Keep it up, you're doing great so far

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.

Login to post a reply

Server time is: 2024-04-27 10:25:41
Your offset time is: 2024-04-27 10:25:41