trashgarbage666 Posted October 18, 2019 Share Posted October 18, 2019 I'd like to make the pipboy light match the color of the player's HUD. I found a spell in the GECK called PipBoyLight. It uses a magic effect called PipLight, which seems to be the thing responsible for emitting PipboyLight640. Since magic effects can have conditions, you could theoretically have a quest script determine the player's current HUD color settings, set a variable, and then have the PipBoyLight spell check the variable to determine which light to emit. My problem is that I don't know of any "get menu setting" type variables. They may not even exist. I'm using JIP LN NVSE, if that helps! Thanks for reading! Link to comment Share on other sites More sharing options...
WarMachineDD7 Posted October 19, 2019 Share Posted October 19, 2019 (edited) I think either GetStringSetting or GetStringIniSetting will have the pipboy light color setting in there somewhere. If you wanna instead read the contents of the HUD, you can use GetUIString, but that won't give you the color of the HUD. Edit: Ok the INI has the UI and pipboy colors there, so you're gonna use the GetStringIniSetting function. Fallout_default.ini iSystemColorPipboyRed=26 iSystemColorPipboyGreen=255 iSystemColorPipboyBlue=128 iSystemColorHUDAltRed=255 iSystemColorHUDAltGreen=67 iSystemColorHUDAltBlue=42 iSystemColorHUDMainRed=26 iSystemColorHUDMainGreen=255 iSystemColorHUDMainBlue=128 Edited October 19, 2019 by WarMachineDD7 Link to comment Share on other sites More sharing options...
trashgarbage666 Posted October 19, 2019 Author Share Posted October 19, 2019 Thank you for the response! Although, I have to admit, I'm a little lost here because the GetStringIniSetting example code looks nothing like the code I'm used to dealing with. The iSystemColor settings appear to be RGB values, so they're probably not what I'm looking for. I scrolled down a little further and found uPipboyColor and uHUDColor. The good news is that they change whenever I alter my pipboy / HUD color! AmberuPipboyColor=4290134783BlueuPipboyColor=785383423GreenuPipboyColor=452952319WhiteuPipboyColor=3321888767 (Specifically, I'm looking at FalloutPrefs.Ini because I'm pretty sure Fallout_default.ini is only used to restore the default settings when you select "Restore Defaults" on the main menu.) The bad news is that whenever I bind them to a variable, it only returns a value of 1. But again, this is likely because I'm a dumb baby when it comes to string variables. Maybe someone can tell me what I'm doing wrong? String_Var nPipboyColor; Let nPipboyColor := GetStringIniSetting "Interface:uPipboyColor" ;Amber If (nPipboyColor == 4290134783); PrintToConsole "Amber"; ;Blue ElseIf (nPipboyColor == 785383423); PrintToConsole "Blue"; ;Green ElseIf (nPipboyColor == 452952319); PrintToConsole "Green"; ;White ElseIf (nPipboyColor == 3321888767); PrintToConsole "White"; Else; PrintToConsole "Didn't Work..."; PrintToConsole "Value: %g" nPipboyColor; EndIf; I'm not sure if it matters, but I'm currently running this in a GameMode block, and plan to move it to an appropriate MenuMode block whenever I get it running. Link to comment Share on other sites More sharing options...
WarMachineDD7 Posted October 19, 2019 Share Posted October 19, 2019 The second line seems correct to me, I don't know why it won't store anything other than a 1, but your if-statements are definitively wrong, you should be using eval and then compare against a string, not a number. Like this: string_var my_string let my_string := "76" if eval my_string == "76" ;this should return true endif Link to comment Share on other sites More sharing options...
trashgarbage666 Posted October 19, 2019 Author Share Posted October 19, 2019 (edited) So! I made the corrections to my if-statements, and wrote this test script to toggle between setting nMyString to "Interface:uPipboyColor" and "76". Depending on which one I have commented out, different things happen. String_Var nMyString; ;Let nMyString := GetStringIniSetting "Interface:uPipboyColor" Let nMyString := "76" If Eval nMyString == "4290134783" PrintToConsole "Amber"; ElseIf Eval nMyString == "785383423" PrintToConsole "Blue"; ElseIf Eval nMyString == "452952319" PrintToConsole "Green"; ElseIf Eval nMyString == "3321888767" PrintToConsole "White"; ElseIf Eval nMyString == "76" PrintToConsole "76"; PrintToConsole "Value: %g" nMyString; Else; PrintToConsole "Didn't Work..."; PrintToConsole "Value: %g" nMyString; EndIf; Setting nMyString to "Interface:uPipboyColor" shows this"Didn't Work...""Value: 2" But setting nMyString to "76" shows this"76""Value: 2" So the script is fine with me setting numbers manually, but doesn't play well with uPipboyColor, or %g. So out of curiosity, I opened up Fallout_default.Ini, and sure enough, uPipboyColor isn't there. It's only in FalloutPrefs.Ini. I assumed GetStringIniSetting is pulling from the .ini that doesn't have uPipboyColor, which is what's causing my problem. So I tried setting nMyString to something that actually is in the default.ini, and %g still returns a value of 2. The GECK wiki says "%g - This usually works just like "%.0f", displaying 0 decimal places. When the number is 1000000 or larger, though, the game diplays it in scientific notation (1E+006)". The values I'm trying to get it to spit out are 9 digits long, and instead of scientific notation, it's just giving me ...2. I'm stumped, and I've been at this all day. String variables suck. Edited October 19, 2019 by punchbattle Link to comment Share on other sites More sharing options...
WarMachineDD7 Posted October 19, 2019 Share Posted October 19, 2019 PrintToConsole is an old function from FOSE, so maybe it doesn't play well with string_vars since they came much later on NVSE, try using the ToString function ($) there: PrintToConsole "Value: %g" $nMyString ;I just added the '$' sign. That might fix the problem of the print out being "2". As for the 2nd line, I don't know what it could be other than it's not finding the setting you're asking for, but let me know if you get anything different on the print to console with the change I just mentioned. Also, you might wanna give the string_var tutorial a read: https://geckwiki.com/index.php?title=Tutorial:_String_Variables Link to comment Share on other sites More sharing options...
Recommended Posts