ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Default pp_effector for nightvision?

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  06:51:42  4 December 2013
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
 

Message edited by:
ddraig
12/04/2013 6:52:16
Messages: 158
Default pp_effector for nightvision?

It seems in SoC there's only really a way of disabling pp effectors by removing them with the identifying number (so level.remove_pp_effector(1034) would remove the pp effector with the identifier of 1034)

Does the default night vision effector have an identifier (i.e. when you switch nightvision on) does it create a default pp effector identifier for it, and how would I go about finding it?

I guess I want a way to disable the default nightvision via script. Call of Pripyat has the
db.actor:object("device_torch"):enable_night_vision(false)

method but SoC doesn't seem to have anything similar.

Any ideas?
  12:10:37  4 December 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
12/04/2013 12:12:47
Messages: 1519
If you're not using any modded X-Ray binaries (such as X-Ray extensions and the like) you won't be able to tell by script whether the NV has been switched on or off. Nor will you be able to disable it at all.

To my knowledge the only thing you can do is disable/remove the effector which identifies by number 55. However that will leave the sounds running when switching the NV on or off. Also, for a short amount of time you will still see the effector springing to life as the script update cycle is way to slow to prevent that.
  16:52:52  4 December 2013
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
I've figured out a way to do what I want to do but it involves hacking around the way the nightvision functions.

Unfortunately I haven't had much luck with getting the x-ray extensions to work for me, which is a bit of a shame as it seems like they add a lot of neat features.
  17:43:55  4 December 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
12/04/2013 17:44:19
Messages: 1519

---QUOTATION---
I've figured out a way to do what I want to do but it involves hacking around the way the nightvision functions.
---END QUOTATION---



I'm not sure what exactly you're aiming for, but if you somewhat manage either to completely disable the night vision by script, or to get informed when the player switches the NV on or off - then I'd be definitely heavily interested in it
  19:27:57  4 December 2013
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
 

Message edited by:
ddraig
12/04/2013 19:35:43
Messages: 158
It's a bit of a quick and dirty hack based on the ShoC keylogger which I finally got working on the steam version.

Basically I've removed all the nightvision_sects from the outfits, and used the keylogger to bind "n" to a special nightvision function that basically just adds a nightvision effector/sound whenever it's "switched on", depending on certain items you might have in your inventory (basically items on your belt that allow you to use nightvision)

I really just wanted to do it to allow emissions to disable nightvision which is much easier to do with this hacked in method than default.

The application of this is probably very limited though

I suppose you could add in an extra parameter into the outfit configs for each outfit that assigns a different value to each suit (so you could replicate the nightvision_bad effector stuff) that this function then reads to do nightvision in a really, really roundabout way that would be easier to control than normal. It would kind of rely on the keylogger, though.

e: To clarify what I mean, you could add in a custom section in each outfit that has nightvision such as "fake_nv = nightvision_bad" then use something like this (taken an example from shader_control.script) to be along these lines:


if sys_ini:section_exist(active_section) and sys_ini:line_exist(active_section, "fake_nv") then
		fake_nv = sys_ini:r_string(active_section,"fake_nv")		
	end



Then using that to add in whatever effector "nightvision_bad" corresponds to, which can easily be disabled/enabled in scripts.
  20:48:52  4 December 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
12/04/2013 20:50:57
Messages: 1519
Thanks. Funnily, I did the very same a couple of years ago

In my case I wanted to decouple the night vision from the suit, so you could buy and use a special NV device regardless of the suit. As soon as you had that custom item in your inventory you could hit a special key (in my case just Esc+N because I never was happy with the keylogger) to switch the NV on or off. Later I added a check that the NV device needed to be attached to your belt to switch it on instead of hitting Esc+N.
 
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.