Jump to content

Need help with INI/Text-files-handling.


didisaan

Recommended Posts

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

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 by didisaan
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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