Maxandmov Posted October 22, 2016 Share Posted October 22, 2016 (edited) Hello, guys. I'm back with another issue w/my code >:CI need to read the file from a certain location so I do it. The issue is, though, that it refuses to be read. if GetGameLoaded == 1;ÐÑи каждой загÑÑзке игÑÑ ÑÑиÑÑваем Ñайл заного. let cItem := ReadArrayFromFile "Data\menus\MoltenCloudsMCItemDescriptions.ini" let sItem := Ar_Size cItem printC "%.0f" sItem endif I check whether game loaded (this check passes since I get PrintC outputs), then I read the array from designed .ini file and check its size. Size is -1 always, no matter whether I rename the file, change its extension or whatever. I even rewrote the contents of the file once.What is wrong? Why it refuses to read? This code is in begin GameMode block.The function is JIP's creation in his JIP NVSE plugin; its page on GECK wiki roughly describes on how-to and my only idea was to use let. :/ Edited October 22, 2016 by Maxandmov Link to comment Share on other sites More sharing options...
PushTheWinButton Posted October 22, 2016 Share Posted October 22, 2016 Are you using NVSE's script compiler override in the GameMode block ("_" before "GameMode")? JIP's file functions don't work when you use them in a block with the override active. I once wasted many hours because of that quirk. Link to comment Share on other sites More sharing options...
Maxandmov Posted October 22, 2016 Author Share Posted October 22, 2016 (edited) Nope, it starts just like 'Begin GameMode'. Actually, I never even HEARD of overrides. begin GameMode if GetGameLoaded == 1;При каждой загрузке игры считываем файл заного. let cItem := ReadArrayFromFile "Data\menus\MoltenCloudsMCItemDescriptions.ini" let sItem := Ar_Size cItem printC "%z" ItemDesc printC "%.0f" sItem let sItem /= 2 let sItem -= 1;Эл-ты массива от 0 до Size-1 printC "%.0f" sItem endif end Here's the code for you - nothing special, @PushTheWinButton Edited October 22, 2016 by Maxandmov Link to comment Share on other sites More sharing options...
Maxandmov Posted October 23, 2016 Author Share Posted October 23, 2016 Bump.I need to deal with the issue ASAP. Link to comment Share on other sites More sharing options...
RoyBatterian Posted October 23, 2016 Share Posted October 23, 2016 Glad you found your typo m8 ;) Link to comment Share on other sites More sharing options...
dubiousintent Posted October 23, 2016 Share Posted October 23, 2016 (edited) Just some general coding suggestions. (I don't do mod creation for FNV.) Generally the game engine is expecting things related to mods to be in the "Data" folder. See if that path works without "Data", as in "menus\MoltenCloudsMCItemDescriptions.ini". That filename has "relative" pathing (which is required). Make sure your default (working) folder when you test is the correct starting point for that path. For the path to start with "Data" you need to be in the "common\Fallout New Vegas" folder. With my suggestion you should be in "Data". (I know the wiki page says "relative to the game installation path", but it's been wrong before. Worth a test.) ReadArrayFromFile requires the file contents to be "tab" separated. As this is a non-printing character it is easy to miss one. Make sure you have at least one tab for each "array value", even if there is none. You might want to use a "placeholder" for visual verification of "null content" (like "~") and then remove them once you have verified the format of each line. [Edit: Ninja'd by RoyBatterian, so it looks like you fixed it.] -Dubious- Edited October 23, 2016 by dubiousintent Link to comment Share on other sites More sharing options...
Maxandmov Posted October 23, 2016 Author Share Posted October 23, 2016 The issue have been fixed. Link to comment Share on other sites More sharing options...
Recommended Posts