My SunglassesFX mod help request

Post » Tue May 17, 2011 4:36 am

I've decided to update my http://www.fallout3nexus.com/downloads/file.php?id=2900&tab=6&navtag=/modules/comments/index2.php?tid=95290|:|fid= mod with the addition of Polarized & Transition lenses effects. However I can't figure out how to apply an image space modifier to transition from dark to normal when the glasses are equipped.

Let’s say I'm out in the wastes and walk to an interior cell, (or cloud covers the sun from the player, in the shade, ect…) with a transition sunglasses equipped, I would like to have them automatically change from dark to normal. And how I have the image space modifier set up by default, the user has to un-equip the sunglasses to change the image space modifier from dark to normal.



As for the polarized lens effect, what’s the best way to modify the image space modifier to give it a gradient from dark on top to light on bottom?
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Tue May 17, 2011 4:38 pm

I did an 'Automatic' setting for my night vision glasses in my 'next' version of the Levelers Chamber. This version has a lot of advancements and will include sorters for all the DLC generic items.

In my case, in the script that is on the glasses, it controls which 'intensity' of nightvision is applied. In the automatic setting, I only check if your inside or not.
If inside, apply power x1.5 enhanced vision.
If outside, and the hours are night time, apply power x1.5 enhanced vision.
Otherwise, if outside and day time, remove the enhanced vision.

I am still testing and I was thinking about applying my 'darker' option when the time is from 11am to 2pm, the middle of the day.

It works pretty good, here is a snippet of code that controls it all.
;Automatic; myState 1=day exterior 2=night exterior 3=interior	if ProcessButton == 5		if timer >= 0			set timer to timer - GetSecondsPassed		else			set timer to 2			if player.IsInInterior				if myState == 3					Return				endif				player.addspell LC1NightVisionP15FXSpell				set myState to 3			else				set curHour to GameHour				if curHour > 4 && curHour < 21					if myState == 1						Return					endif					player.removespell LC1NightVisionP15FXSpell					set myState to 1				else					if myState == 2 || myState == 3						Return					endif					player.addspell LC1NightVisionP15FXSpell					set myState to 2				endif			endif		endif	endif

User avatar
nath
 
Posts: 3463
Joined: Mon Jan 22, 2007 5:34 am

Post » Tue May 17, 2011 7:09 am

Fascinating, I'm starting to see something happening here... Below is a script Cipscis wrote up for me almost 2 years ago:

scn 1SGObjectEffectScriptshort sIsActivebegin OnEquip player	ApplyImageSpaceModifier 1SGImageSpaceModifier	set sIsActive to 1endbegin OnUnequip player	RemoveImageSpaceModifier 1SGImageSpaceModifier	set sIsActive to 0endbegin OnDrop player	if sIsActive		RemoveImageSpaceModifier 1SGImageSpaceModifier		set sIsActive to 0	endifend


Incorporating that day/night and interior/exterior arguments into this script should be as easy as placing it under “end” correct? However I would have to replace a few syntaxes to match my code. For example in your snippet “if ProcessButton == 5”, would I have to replace it with “begin OnEquip player”? I guess what I see in your example is "processbutton" as an argument that if the night vision button is pressed to activate the NVG, continue with the rest of the script.
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Tue May 17, 2011 6:53 am

ProcessButton is a variable that stores a menu selection. When my glasses are equipped, the player is presented with a menu.
-2.5 power
+1.5 power
+2.5 power
+5.0 power
+7.5 power
Automatic

You would put the IsInInterior and Hour checks in your OnEquip block of code.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Tue May 17, 2011 4:53 am

You would put the IsInInterior and Hour checks in your OnEquip block of code.


Ah ok... Otherwise I would have duplicate code blocks that may cause inconsistencies or just make it hard to read.

And how about for the "MyState" condition, how did you declare that? Is the Colin a "comment out" the rest of the line after that point of the script check operator?

:edit:

Alright, I'm so lost here...
User avatar
OTTO
 
Posts: 3367
Joined: Thu May 17, 2007 6:22 pm

Post » Tue May 17, 2011 3:14 pm

Okay, I was tired and spoke wrong yesterday. If you want it to automatically update itself, you need to put the IsInInterior and hour checks in a GameMode block. I used ProcessButton to know 'when' the gameMode block should be looked at. So, onEquip, you set it to a '5' as in my code example above, and the gameMode will know the glasses are worn. In your UnEquip and OnDrop you could change ProcessButton to 0 so the gameMode block is not executed anymore. And you would remove any shaders you have active.

The semi-colon makes the text after it a comment.

; myState is defined as: 1=day exterior 2=night exterior 3=interior
I set this so I know what 'state' the code is currently in.

You can only have 1 'else' in any 'IF' function command. You are also missing the ENDIF.
IF
ELSEIF
[ELSEIF] you can have as many of these as you want...
ELSE
ENDIF
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Tue May 17, 2011 10:18 am

Ok I think I may have gotten it working. Now I just need to know if I can apply the script to all flaged eyepieces instead of applying them to each and every individual objects?
User avatar
helliehexx
 
Posts: 3477
Joined: Fri Jun 30, 2006 7:45 pm

Post » Tue May 17, 2011 4:11 am

You can apply it to any 'base' object.
I am not sure if FOSE will allow dynamic applying the scripts to only 'certain' random objects.
User avatar
Heather Kush
 
Posts: 3456
Joined: Tue Jun 05, 2007 10:05 pm

Post » Tue May 17, 2011 2:34 am

I was afraid of that; I at least didn't see a way to apply the script to only these "equipped as" flagged objects. Anyways I thought I had it working, but the script is not taking effect, I still have the Image Space applied to the object while indoors.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Tue May 17, 2011 2:53 am

Mine works fine. It turns on and off automatically when inside, or its dark out. It also 'darkens' during the mid-day hours.

You probably do not have it set up correctly. Probably a small bug (it took me a while to get mine to work correctly, with all the little bugs I had to squash) :lol:
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Tue May 17, 2011 10:51 am

Basicly what is happening is my script is incomplete, (for now) when I go into interriors its suposed to remove the effect, but it doesn't. I wanted to see if the script worked first.

As an example:

scn 1SGObjectEffectScriptshort sIsActivebegin OnEquip player	;Check to see if player has equipped the object	ApplyImageSpaceModifier 1SGImageSpaceModifier	set sIsActive to 1endbegin OnUnequip player	;Check to see if player has un-equipped the object	RemoveImageSpaceModifier 1SGImageSpaceModifier	set sIsActive to 0endbegin OnDrop player	;Check to see if player has object equiped on player while effect, but dropped item - Remove effect	if sIsActive		RemoveImageSpaceModifier 1SGImageSpaceModifier		set sIsActive to 0	endifendbegin GameMode			;Check to see if player is in an Interior Cell, with object equipped - remove the effect - Keep object equipped.		if player.IsInInterior		RemoveImageSpaceModifier 1SGImageSpaceModifier	endifend

User avatar
JUDY FIGHTS
 
Posts: 3420
Joined: Fri Jun 23, 2006 4:25 am

Post » Tue May 17, 2011 7:12 am

Well, for starters, you should never use a numeric as the first character of any new object you create. In certain instances, it confuses the compiler because the 'Editor ID' is replaced with the 'Form ID' in the compiled script, and the 'number' makes it think you are already using the Form ID. So it will not work. I am not saying that is the issue here, but you should not use numerics.

Next, verify that the script is actually attached to the helmet you are testing.

Finally, make sure you are not using a dirty save game. That is a save game where you had the mod 'active' at ANY time in the past for that save game. The helmet will be 'saved' in your save game and OVER RIDE any changes you make in the mod at a later date to the helmet.
User avatar
Ells
 
Posts: 3430
Joined: Thu Aug 10, 2006 9:03 pm


Return to Fallout 3