Jump to content

didisaan

Premium Member
  • Posts

    14
  • Joined

  • Last visited

Nexus Mods Profile

About didisaan

Profile Fields

  • Country
    Sweden

didisaan's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. I'll change the code according to your recommendations and do some more test later today. I always indent my code, but when i pasted the text, it was removed and well, I'm lazy sometimes ;) Thanks
  2. ScriptName test array_var aExcludedMods string_var sModName int iNumOfLoadedMods int iCount Begin MenuMode 4 If (GetGameLoaded || GetGameRestarted) let aExcludedMods := GetINISectionNames let iNumOfLoadedMods := GetNumLoadedMods let iCount := 00 while iCount < (iNumOfLoadedMods + 1) let sModName := GetNthModName iCount if eval (Ar_Find $sModName, aExcludedMods) != Ar_BadNumericIndex let iCount += 1 print "not used " + $sModName Continue else print "used " + $sModName let iCount += 1 endif loop endif EndThis should work, right? It seems to be working.
  3. Hi I have a mod that cycles through all loaded mod-files and I want to be able to skip certain mod-files that have been added to an ini-file or something similar. Anyone has any tips?
  4. 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
  5. 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.
  6. I got some inspiration from your comments and I will test some new code later today. :)
  7. Haha, managed to post the wrong version of the code... Sorry. Here's the correct code. ScriptName aaaWeaponDistributionMainScript array_var AllWeapons ref rWeaponId ref rRepairList int iNumOfLoadedMods int iCount string_var sModName string_var sIconPath Array_Var tempArrOuter String_var iniSection Begin GameMode If (GetGameLoaded || GetGameRestarted) let iCount := 00 let iNumOfLoadedMods := GetNumLoadedMods while iCount < (iNumOfLoadedMods + 1) let sModName := GetNthModName iCount ForEach tempArrOuter <- GetINISectionNames let iniSection := $tempArrOuter["value"] if eval sModName == iniSection print "not used " + iniSection Break else ;Gets all weapons from the current modindex and puts them in the correct formid/leveled lists print "used " + iniSection foreach AllWeapons <- (GetLoadedTypeArray 40 iCount) let rWeaponId := *AllWeapons let rRepairList := GetRepairList rWeaponId ; Gets the Repair List from the current weapon let sIconPath := GetIconPath rWeaponId ; Gets the icon path from the current weapon ; If a Repair List is found, call the corresponding script. endif loop Break endif loop let iCount += 1 loop endif StopQuest aaaWeaponDistributionMain End It seems to work at first, but then it stops checking the file.
  8. ScriptName aaaWeaponDistributionMainScript <lots of variables> Begin GameMode If (GetGameLoaded || GetGameRestarted) let iCount := 00 let iNumOfLoadedMods := GetNumLoadedMods while iCount < (iNumOfLoadedMods + 1) let sModName := GetNthModName iCount ; Checks for excluded mods if eval sModName == "FalloutNV.esm" let iCount += 1 Continue <lots of excluded mods> else ;Gets all weapons from the current modindex and adds them to the correct formid/leveled lists foreach AllWeapons <- (GetLoadedTypeArray 40 iCount) let rWeaponId := *AllWeapons let rRepairList := GetRepairList rWeaponId ; Gets the Repair List from the current weapon let sIconPath := GetIconPath rWeaponId ; Gets the icon path from the current weapon ; If a Repair List is found, call the corresponding script. if rRepairList == "Repair10mmPistol" call aaaRepair10mmPistolScript rWeaponId <lots more repair list checking action> endif loop Break endif loop let iCount += 1 endif StopQuest aaaWeaponDistributionMain EndThis is the script, with repeating code shortened down.
  9. Nice. Well, the master script as it is now, goes through all the loaded mods. Then it reads all weapons/armors and distributes them through subscripts. What I want to do is: Whenever it loads in a new modfile, before it does anything else, it should first check the ini/txt-file if that mod is excluded and if it is, it should "restart" the loop and check the next modfile. If have messed around with GetINISectionNames, but can't get it working.
  10. Hi I'm the author of the Item Distribution Framework mod. I have been trying to get INI/Text-file-handling to work, so that the users of the mod can exclude mods that they don't want processed by my mod, but have hade no luck. Anyone who is a master at this and willing to help?
  11. I'm trying to create a script that takes all the weapons from a formlist and gets their name and repair list, and prints them out to the console (for testing purposes). It gets the name but not the repair list. Someone please help :) array_var Entry ref rForm string_var sWeaponName ref rRepairList Begin Gamemode If (GetGameLoaded || GetGameRestarted) foreach Entry <- (GetListForms aaaWeaponList) let rForm := *Entry let sWeaponName := GetName rForm let rRepairList := GetRepairList rForm Print "Name: " + $sWeaponName + " Repair List: " + $rRepairList loop endif End
  12. Hi I am wondering if it is possible to make a script, that goes through a mod file and lists all weapons in it in an array? Yes, I have locked at the documentation for geck/nvse scripts.
×
×
  • Create New...