ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
NPC flashlight use hours

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  19:39:22  12 June 2013
profilee-mailreply Message URLTo the Top
te47
Senior Resident
 

 
On forum: 06/03/2010
Messages: 415
NPC flashlight use hours

Hello all,

Just a quick question: Does anyone know of a way to change what time of day NPCs turn their flashlights on and off? My mod has longer nights, and NPCs are at a significant disadvantage if the player sneaks into their base at night before or after the default flashlight use period. Ideally, I'd like to get NPCs turning them on earlier and off later. Is this possible?
  20:30:18  12 June 2013
profilee-mailreply Message URLTo the Top
xRatx
Senior Resident
 

 
On forum: 06/18/2008
 

Message edited by:
xRatx
06/12/2013 20:32:01
Messages: 1592
You could try to edit sr_light.script

Locate this part of a function in the script :

		local htime = level.get_time_hours()
		if htime <= 4 or htime >= 22 then
			light = true
		else
			light = false
		end


Ajust those two vaules as you like.

In this case (If I am not mistaken), the npc will turn the lights after 11 PM and turn it off at 4 AM.
  21:31:59  12 June 2013
profilee-mailreply Message URLTo the Top
te47
Senior Resident
 

 
On forum: 06/03/2010
 

Message edited by:
te47
06/12/2013 21:32:17
Messages: 415
Thanks! That did it. I even managed to set up an alternate start and end time for my dark territories with even longer nights (like the Dark Valley). Thanks again.
  04:06:14  19 June 2013
profilee-mailreply Message URLTo the Top
{imperialreign}
Звуковой Шаман
(Resident)

 

 
On forum: 10/29/2008
Messages: 3075
You can make it even further exact, if you want to adjust it down to the minute. The conditionals I've been using for years:


local htime = level.get_time_hours()
		local mtime = level.get_time_minutes() / 100
		local rtime = htime + mtime
		if (rtime <= 4.17) or (rtime >= 21.32) then
			light = true
		else
			light = false
		end



Never had any issues with it - I had needed something a little more "exact" back when I was still designing Frozen Sky because of the weather lighting interaction... because of the "snow" effect, I kept ambient light high for quite some time after "sunset," and then it got dark quickly. Because of how weather hour rendering is handled, I had to write the above to keep NPCs from stumbling around in the dark for about 20 game minutes, lol
  01:33:02  11 July 2013
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
Messages: 1430
nice work Imp, now i've finally been able to match the Headlamps with the SWO sunrise/sunset timings.

Can this script also control headlamps staying on when an NPC is killed? If someone has their headlamp turned on, and they are shot dead, the headlamp automatically turns off, which is retarded! Can this be set so that it stays on, if it was already on in the 1st place? like in the old demos...
  03:11:48  14 July 2013
profilee-mailreply Message URLTo the Top
{imperialreign}
Звуковой Шаман
(Resident)

 

 
On forum: 10/29/2008
Messages: 3075
IIRC - someone had written a function for that script somewhere that addresses such, and takes care of the light becoming attached to the floor. It might be in ZRP, or NatVac could point you in the right direction. From what I remember it was a little hack&slash, but did it's job...
  13:57:50  14 July 2013
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
07/14/2013 14:00:13
Messages: 1430
but does it look like this:
http://www.youtube.com/watch?v=3S8zPSVGBv8 ?

(pre-release tech demo from 2004)

EDIT: in particular; at the 0:44sec mark of the video
  23:35:50  14 July 2013
profilee-mailreply Message URLTo the Top
{imperialreign}
Звуковой Шаман
(Resident)

 

 
On forum: 10/29/2008
Messages: 3075
Hmmm - I don't remember, to be honest. I want to say it was a self-updater attached from the sr_light.script to bind_stalker.script, so there were occasional delays in killing the light after an NPC died :/

Wow, 2004, though... I sometimes forget how long SoC was in development, lol.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.