FiendishGhoul Posted March 25, 2015 Share Posted March 25, 2015 (edited) I'm working on a relatively simple mod which adds a new melee weapon to the game. I would like for this weapon to be used by Raiders, Fiends, Powder Gangers and the like, as well as popping up infrequently in loot. Having exhausted Google search terms, I have come down to 3 principal methods for accomplishing this, but none of them are exactly perfect. I would like to know what the community thinks is the best method for mucking about with Form Lists and Leveled Lists in a way that presents the least invasive and most user-friendly means to accomplish this. Method One: A script utilizing NVSE and Lutana functions. SCN FGBushLeagueBladeFormListSCRIPTBEGIN GameModeIf (GetGameLoaded || GetGameRestarted)LeveledListAddForm RaiderWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm FiendInt1WeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm FiendInt2WeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm FiendWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm PowderGangerWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm LL2Tier1MeleePowderGanger50 FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm LL2Tier1MeleePowderGangerSimple50 FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm VFSFreesideThugWeaponRandom FGCondWeapBushLeagueBladeRaider 1 1 1.0LeveledListAddForm LL2Tier2MeleeProspector25 FGCondWeapBushLeagueBladeNPC 1 1 1.0LeveledListAddForm LootWeaponsMeleeTier1 FGCondWeapBushLeagueBladeLoot 1 1 1.0ListAddForm NVAllWeapons FGWeapBushLeagueBlade1handListAddForm WeaponListMeleeALL FGWeapBushLeagueBlade1handListAddForm NVImprovedHoldoutWeapons FGWeapBushLeagueBlade1handEndIfEND The "pros" to this method are that all changes are held in memory as opposed to in save games, thus users can safely uninstall the mod at any time if they are dissatisfied for any reason without messing up their lists. The "cons" would be that users must have previously installed both NVSE and Lutana. Also, I'm concerned that this method leaves the quest script firing all the time (due to no call to StopQuest). If this is not the case, or nothing to worry about, or there is some method to disable the quest/script that I'm not aware of, please address this in your response if possible. Method Two: A script utilizing pre-existing non-NVSE functions. SCN FGBushLeagueBladeFormListSCRIPTShort DoOnceBEGIN GameModeIf (DoOnce == 0)AddItemToLeveledList RaiderWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList FiendInt1WeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList FiendInt2WeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList FiendWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList PowderGangerWeaponMelee FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList LL2Tier1MeleePowderGanger50 FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList LL2Tier1MeleePowderGangerSimple50 FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList VFSFreesideThugWeaponRandom FGCondWeapBushLeagueBladeRaider 1 1 100AddItemToLeveledList LL2Tier2MeleeProspector25 FGCondWeapBushLeagueBladeNPC 1 1 100AddItemToLeveledList LootWeaponsMeleeTier1 FGCondWeapBushLeagueBladeLoot 1 1 100AddFormToFormList NVAllWeapons FGWeapBushLeagueBlade1handAddFormToFormList WeaponListMeleeALL FGWeapBushLeagueBlade1handAddFormToFormList NVImprovedHoldoutWeapons FGWeapBushLeagueBlade1handSet DoOnce to 1StopQuest FGBushLeagueBladeFormListQUESTEndIfEND "Pros" to this method would seem to be no prerequisites to use, but the "cons" include changes to the lists being written to save games. Method Three: No script at all, just hammer in the changes to the Form Lists and Leveled Lists and instruct users that a Merged or Bashed Patch is mandatory. The "pros" for this method are- I don't know. Ease? The "cons" are that users must use Wrye Bash or some other utility to merge their Lists in a patch and those changes will be written to a game save (I assume). I'm genuinely very curious as to what some of the more experienced users here will say is the best method to accomplish what seems, at face value, to be a fairly common and ostensibly simple task, and, as always, there's also the distinct possibility that I am overlooking or otherwise ignorant to some very obvious thing that could simplify the whole process. Thanks in advance for any help you can provide! Edits begin: 3/26/2015 3:08pm EST Due to the apparent scarcity of response, I'm now considering a fourth method. Method Four: Create 3 different .esp files, each relying on one of the aforementioned methods, and leave it to users to figure out which best fits their needs. "Pros" to this method are that one of the the three will likely work right. "Cons" include having to support three different .esp files and the potential for user confusion. I'm still very concerned about my use of the NVSE functions, specifically whether or not my script will continue running in the background once every frame or whatever. I'd like to avoid that, obviously, and I'd very much appreciate if someone with more experience could tell me of a way to maybe, like, suspend a quest (as opposed to StopQuest, which I assume would prevent the script from adding the weapon to the appropriate lists every load as it's supposed to). 3/26/2015 3:39pm EST I seem to be noticing that the major concern with adding things to Leveled Lists appears to be with regard to ammo types, wherein overridden records can cause serious foul ups. I'm wondering if maybe my concerns are largely unfounded due to the fact that I'm merely adding a melee type weapon to inventory lists and perk form lists and such. Perhaps I'll just run with method 2, the old-school non-NVSE functions AddItemToLeveledList & AddFormToFormList in a one-time quest script and only worry about alternatives if some theoretical user complains. What I'm coming to think of as the "burn that bridge when I get to it" approach. Either way, I'm leaving all of this here in case someone wants to witness a real-time depiction of a person over-thinking a fairly simple issue. Edited March 26, 2015 by FiendishGhoul Link to comment Share on other sites More sharing options...
Ladez Posted April 4, 2015 Share Posted April 4, 2015 Method one is definitely the one I prefer, there's no conflicts and no permanent changes being made. If you uninstall the mod, there's no garbage left over in your save file. NVSE usage is widespread and most have no concerns over it, but they might have concerns over you requiring another 3rd party plugin though. Having the LeveledListAddForm function integrated into standard NVSE would be a big help. I recommend against method two for the reason you stated, and while method three may be a good option, it ultimately leaves things in the hands of the user, which is often a bad idea. As for method four... Eh. Generally I'm an advocate of user choice, but this is too much. It's too much work for you and it's too much for the average user to consider and handle. I'm still very concerned about my use of the NVSE functions, specifically whether or not my script will continue running in the background once every frame or whatever. I'd like to avoid that, obviously, and I'd very much appreciate if someone with more experience could tell me of a way to maybe, like, suspend a quest (as opposed to StopQuest, which I assume would prevent the script from adding the weapon to the appropriate lists every load as it's supposed to). The proper way to implement it is in a GameMode block using GetGameLoaded, which you have done. The method only returns true once per game session, so the following commands are only run once. Of course, the script itself will continue to call the function, but the performance impact is negligible, if it's there at all. Either way, I'm leaving all of this here in case someone wants to witness a real-time depiction of a person over-thinking a fairly simple issue. Nah, not overthinking. :) These are genuine concerns if you want to deliver a solid product. (Can we call it that when it's not made for profit?) Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 4, 2015 Share Posted April 4, 2015 Method one is the way I would do it, and I wouldn't (don't) worry about Lutana, and now JIP, plugin usage. I'll use the plugin I want to use, and if people don't want to use them they can not use the mod. I've worked with Luthien helping to figure out some of the functions to add to Lutana, and I know JIP's work well. The source for both plugins is available, so people can't complain about not knowing what they're installing. My general modding practice is to do what is easiest and best for me and let everyone else worry about themselves. Quick little tidbit about scripts, they run all the way through whether or not the code actually executes. To quickly end a script, and relieve whatever performance impact you're worried about, make your GetGameLoaded call work like this if GetGameLoaded == 0 Return endif That'll throw it back out as soon as it hits that condition, preventing the rest of the script from running. This is negligible for a single quest script, but does cut down on nesting, which is a good thing. Also, you don't need to use GetGameRestarted. That checks every time the game reloads a save, which would make your script run every time the player dies, etc, adding lots of copies to the Leveled Lists. Link to comment Share on other sites More sharing options...
drithius Posted April 5, 2015 Share Posted April 5, 2015 (edited) Gribble, I think you got this backwards (and I don't say that lightly considering you're a scripting god!) Using GetGameLoaded in that manner causes it to load everytime a save is loaded. I was testing it with my new Lutana'ized mod and I saw continual growth in Leveled Lists using the GetNumLevItems function. getGameRestarted worked correctly. So it's: Begin GameMode if GetGameRestarted == 0 return endif ;----------------------------------------- LeveledListAddForm STUFF ;----------------------------------------- End Edited April 5, 2015 by drithius Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 5, 2015 Share Posted April 5, 2015 Well that's what I get for not checking before saying something. To be perfectly honest I get those two confused all the time anyway, poorly named functions. Thanks for clearing things up, and if I remember I'll do a couple tests, but if you already did then I'll just take your word for it. Link to comment Share on other sites More sharing options...
RoyBatterian Posted April 5, 2015 Share Posted April 5, 2015 Now if only NVSE reinitialized variables when loading save games or returning to the main menu. Link to comment Share on other sites More sharing options...
nivea Posted April 5, 2015 Share Posted April 5, 2015 Really depends on how much your adding to the game, I know people look down on manual edits but sometimes it is needed. However when its just a couple of items I think the first is most ideal if its true the stuff is not written into the save game like non-NVSE tend to do. Truthfully they are all perfectly acceptable so long as you post about any issues people might have on installing or uninstaling the mod. Link to comment Share on other sites More sharing options...
FiendishGhoul Posted April 7, 2015 Author Share Posted April 7, 2015 Wow, thanks guys! I kind of missed that people were responding to this until now! I will likely stick with the first version, then, especially given code that drithius suggested, which appears to alleviate the script overhead as well as avoiding extraneous additions. Thanks again. Once again, the Nexus forum wins out (with patience)! Link to comment Share on other sites More sharing options...
mastahbossu Posted November 27, 2017 Share Posted November 27, 2017 Old (?) thread but I've got questions regarding Method 1, I plan on using both ListAddForm and ListRemoveForm. However I noticed a couple of quest scripts with these commands that just ran them as a "do once" and then used StopQuest, are those faulty scripts then? If I understood it correctly they need run with GetGameRestarted || GetGameLoaded ? Link to comment Share on other sites More sharing options...
Recommended Posts