Jump to content

Possible Friend of the Night fix


competentfake

Recommended Posts

I've broken down the FriendOfTheNightQuestScript, and I think I see what the issue is with people not being able to see in the dark when it is daylight.

If GetCurrentTime >= 20.25 || GetCurrentTime <= 5.75 && Player.HasPerk FriendOfTheNight ;If it is between 8:15pm and 5:45am, and the player has the perk
	If Player.IsInInterior == 1 ;If the player is inside
		If bFOTNNightInEffect == 1 ;if the outside FotN effect is on
			RemoveImageSpaceModifier FriendOfTheNightISFX ;turn outside FotN effect off
		Endif
		If bFOTNInteriorInEffect == 0 ;If Inside FotN effect is off
			ApplyImageSpaceModifier FriendOfTheNightInteriorISFX ;Turn Inside FotN effect on
		Endif
	Else ;if player is NOT inside
		If bFOTNInteriorInEffect == 1 ;if outside effect is on
			RemoveImageSpaceModifier FriendOfTheNightInteriorISFX ;turn it off
		Endif
		If bFOTNNightInEffect == 0 ;if outside effect is off
			ApplyImageSpaceModifier FriendOfTheNightISFX ;turn it on
		Endif
	Endif
Else ;if it is NOT between 8:15pm and 5:45am, and the player does NOT have the perk
	If bFOTNNightInEffect == 1 ;if outside effect is on
		RemoveImageSpaceModifier FriendOfTheNightISFX ;turn it off
	Endif
	If bFOTNInteriorInEffect == 1 ;if inside effect is on
		RemoveImageSpaceModifier FriendOfTheNightInteriorISFX ;turn it off
	Endif
Endif

 

The problem is with this statement, that uses the logical operation '&&':

If GetCurrentTime >= 20.25 || GetCurrentTime <= 5.75 && Player.HasPerk FriendOfTheNight

It seems to my inexperienced eyes that If it isn't between 8:15pm and 5:45am, the script doesn't run, period, because that condition AND the Player.HasPerk condition have to be met before it checks to see if the player is inside or not, and whether the appropriate effect is on or not. It seems to me if you contain the entire script in an 'if player.HasPerk FriendOfTheNight' condition, and then check to see if the player is inside, and if not, THEN check to see what time it is, the perk would work as intended. Here is my humble effort (forgive the excessive semicolon-age, I like to be sure everything says what its supposed to):

if player.HasPerk FriendOfTheNight ;if the player has the perk
	If Player.IsInInterior == 1 ;If the player is inside
		If bFOTNNightInEffect == 1 ;if the outside FotN effect is on
			RemoveImageSpaceModifier FriendOfTheNightISFX ;turn outside FotN effect off
		Endif
		If bFOTNInteriorInEffect == 0 ;If Inside FotN effect is off
			ApplyImageSpaceModifier FriendOfTheNightInteriorISFX ;Turn Inside FotN effect on
		Endif
	else ;if the player is NOT inside
		if GetCurrentTime >= 20.25 || GetCurrentTime <= 5.75 ;if it is between 8:15pm and 5:45am
			If bFOTNInteriorInEffect == 1 ;if Inside effect is on
				RemoveImageSpaceModifier FriendOfTheNightInteriorISFX ;turn it off
			Endif 
			If bFOTNNightInEffect == 0 ;if outside effect is off
				ApplyImageSpaceModifier FriendOfTheNightISFX ;turn it on
			Endif 
		else ;if it is NOT between 8:15pm and 5:45am
			if bFOTNNightINEffect == 1 ;if outside effect is on
				RemoveImageSpaceModifier FriendOfTheNightISFX ;turn it off
		endif 
;the outside effect is off, as it should be (checking to see if the inside effect is on would be redundant at this point, I THINK)
	endif 
endif

Would this work? I also want to make it so that if the player has the perk, his vision would be blurry outside during the day unless he was wearing sunglasses or a visored/tinted goggle helmet. Still working that one through, heh! ~Fake

Link to comment
Share on other sites

Just tested it, it seems to work! :D

 

I'm going to try to go a step further, but I'm unsure as to how to implement it.

 

-Blurred, too-bright vision when outside during the day. I've added a new Imagespacemodifier (xFotNDaylightVision), which I copied off of (I think) the blurred vision in VATS mode, bumped the brightness and sunlight dimmer up. I've added a new variable to reference whether or not the player is outside during the day (xOutDay).

 

-Sunglasses and visored helmets or helmets with tinted goggles allow you to see normally during the day. I made a FormList of all the glasses and headgear items I could find that had tinted viewports, and as I understand it, I have to make a 'token', which is an armor piece that is unplayable (and therefore invisible), equip it on the player when xOutDay == 1, and link that somehow to negate the xFotNDaylightVision imagespace modifier, and possibly apply a different modifier to tone the brightness down a few notches, as though the player is viewing the world through tinted glass. I've grown to hate the GECK wiki with a passion, and there are no tutorials for this sort of thing on the entire internet. My browser has so many tabs it looks like a blunt saw.

 

All of this came about because if you tag sneak in my perk mod, you get FotN, and I wanted it to be worth having, because so many people have dismissed it as buggy and stupid. But yay, I made a tiny mod, 3 days after picking up the GECK.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...