didisaan Posted March 19, 2018 Author Share Posted March 19, 2018 I've had some success with the INI-file reading.But I tried DoctaSax:s RefToString and that doesn't seem to work.As an example, it puts "FalloutNV.esm:00000001" instead of the repairlist. Link to comment Share on other sites More sharing options...
EPDGaffney Posted March 20, 2018 Share Posted March 20, 2018 Was it the Break vs Continue that was giving you trouble? You should post your script as it stands now, using RefToString. If it's returning the wrong thing, it should be down to what you've associated with the variable, so we'd need the context. When you were talking about scripting 'masters' in your OP, Sax may be humble enough to disagree, but that Keith Richards image is one of the first things that popped into my head. I've never used this function, but I'll see about working through it with you as we wait for more input from Docta Sax, who doesn't come round nearly as often as I do, but may be back to help us. Link to comment Share on other sites More sharing options...
didisaan Posted March 20, 2018 Author Share Posted March 20, 2018 (edited) Here's the test code as of now: ScriptName aaaWeaponDistributionMainScript array_var AllWeapons ref rWeaponId ref rRepairList int iNumOfLoadedMods int iCount string_var sModName string_var sIconPath array_var smRepairLists array_var aTempExcludedMods array_var aExcludedMods string_var sScriptReference string_var sRepairTest Begin GameMode If (GetGameLoaded || GetGameRestarted) let iCount := 00 let iNumOfLoadedMods := GetNumLoadedMods let aExcludedMods := Ar_Construct "array" let aExcludedMods := GetINISectionNames ;Ar_Dump aExcludedMods if eval (Ar_Find "FalloutNV.esm", aExcludedMods) != Ar_BadNumericIndex print "fallout" endif if eval (Ar_Find "CaravanPack.esm", aExcludedMods) != Ar_BadNumericIndex print "caravan" endif while iCount < (iNumOfLoadedMods + 1) let sModName := GetNthModName iCount let rRepairList := GetRepairList WeapBaseballBat if IsFormValid rRepairList let sScriptReference := "aaa" + RefToString rRepairList + "Script" print $sScriptReference else ; let svKey := GetIconPath rWeaponID endif let iCount += 1 loop endif StopQuest aaaWeaponDistributionMain End Edited March 20, 2018 by didisaan Link to comment Share on other sites More sharing options...
EPDGaffney Posted March 20, 2018 Share Posted March 20, 2018 At the moment, I don't really see why it's not working. Can you describe the problem with more detail? Although it should work as is (as far as I can tell), maybe try simplifying the bit where it prints the string. Also, I tend to use PrintC, but I don't think you need to stringise these when using Print, so maybe that's actually confusing it? I don't have a lot of experience with the regular Print function so I'm not sure. Obviously, the GetIconPath line isn't working because you haven't declared that variable, but you probably knew that. And last, if you stop the quest, it will never run again, so if someone's load order changes and they load their save after this script has been run, it won't run again to account for that change to the load order. This is another reason running it in MenuMode 4 is better, as it always runs on the main menu at the beginning of the game session, and never again until you quit to desktop and start a new session. Link to comment Share on other sites More sharing options...
Recommended Posts