The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

Tutorial: How to unscript a weapon mod

General modding guides and authoring tutorials.
Post Reply
User avatar
Puppettron
Gary
Posts: 1715
Joined: Sat Nov 23, 2013 10:47 pm

Tutorial: How to unscript a weapon mod

Post by Puppettron » Tue Jul 01, 2014 5:36 pm


How to unscript a weapon mod


 


This tutorial will make some basic assumptions.  It will assume that you don't know how to do this already, that you don't know why you would want to do this, and that you'd like to know the basics and the whys and hows before you start doing this on your own with automated processes.  It also assumes that you're willing to read to the end to see the warnings displayed there.  Failure to follow directions or read the warnings is now your fault, since you've been made aware of them.


 


I'm sure you've gotten a weapon mod before, one that promises full integration without needing to adjust your merge patch, and you probably made little squealing noises as you added it to your load order because it's just such a damn cool gun.  And then you probably forgot about it until you got to the point where you needed to make some changes to your LO because you were hitting critical mass.  Well, I'm going to show you how to make those mods and other mods like them, more compatible and to stop them from needing to be locked into your LO to keep your save from being borked.  This is actually standard for Millenia mods, so it's a larger issue than you may have thought.  I'm going to do this with the Tactical Flamer Revamp mod, because serendipitously, I haven't gotten around to fixing the mod, and because I like flamers.


 


Before we start anything, though, I need to mention that this walkthrough only covers changing your mods to prevent future save borking.  If your save is already borked, this will not fix it.  If your save is already borked, you'll have to reintroduce the original mod and add a script to undo what that script did, which I'm not going to cover.  Hopefully this will help you in the future though, so you'll remember to look at mods when you add them, even though that will delay the satisfaction of running your game with the new mod and awesome weapons and armor it adds.


 


So, first things first, we need to explain how these mods achieve integration without needing merge patch work or even nvse.  It's all handled with a script, much like the one below.  And the only thing that script does is add the weapon or included leveled lists to the proper formlists and leveledlists.  Seems pretty harmless when you look at it, but there's a huge problem with it.  You see, the commands “addformtoleveledlist” and “addformtoformlist” were originally designed to handle DLC stuffs, which are intended to never be removed from your load order, because why would you?  As such, the commands actually throw the item to the top of the list, meaning those lists now have new records sitting ahead of all the other lists.  Which also means if the items in those records go missing, you now have unresolvable records sitting at the top of your list.  So, if you ever remove these mods from your LO, the saves that had these mods on them become unplayable, because now those records are unresolvable and the game has a stroke.  This means that the very moment you save a game with mods using this sort of script, you can't reload that game without them in your Load Order, effectively locking those mods into you LO whether you like them or not.






 


Now, you may be wondering why a mod author would do such a thing.  It's a pretty simple explanation, actually.  When you make mods to be hosted on a giant community like Nexus, you'll run into some pretty annoying “problems” right off the bat.  There's a large contingent of players who have no desire whatsoever to learn anything about modding;  they just want to play the game with their shiny toys.  So you end up with a bunch of people making weird demands of you, such as asking where in your LO to put the mod, asking for the formIDs of things in mods they have a copy of, and people blaming you and your mod for user-caused problems.  To alleviate that, mod authors will go out of their way to make things as simple as possible, making their mods' requirements as minimal as possible, and taking as much work out of the hands of the user as possible.  And when you make it as simple as possible, all you've really accomplished is reducing user-caused issue complaints to a much smaller number.  You'll still get people who're adamant that your mod screwed up their game in ways that are actually impossible.  Personally, I make my mods for people who know at least a little about what's in their folder and how to make it work, but I'm also gifted with lots of spare time and above-average patience, so I'm also willing to help people understand things when things happen.  I also don't crank out front page mods every week, so that might have a bit to do with it.


 


So, how do we fix it?  Well, the simple answer would be to redo the script using nvse functions, but that wouldn't tell you anything about the workings of the game bits we're working on, so I've opted to masochistically show you how to set everything manually so you can get rid of the script entirely.


 


So, let's start at the top.  We're going to open up the file in Geck, we could do this in edit easily enough, but edit search functions are practically nonexistant and that'll just make this thing so much more time-consuming on your end while I just fly through instructions that it's just easier to do it in Geck.  The first thing we'll need to do is open the script so we can look at at.  Generally speaking, authors will name everything in their mod with a 3 to 4 letter prefix related to the mod, so looking for that prefix will get you the results you want.  If you still can't find it, try looking up the weapon(s) added and, rightclicking, check the use info.  If it's used in a script, that'll show up in the use info window and you can click the script from there.  The script is generally very simple, it just adds weapons to lists, and then calls it a day.  You won't need to know how the script works, though, because what we're doing is making it obsolete and disabling it.  Keep the script window open, however, as a guide to where you're going and what you're doing.  Although I suppose you could just copy it and paste it to a notebook or something if you'd rather not risk making changes to the script.






 


The first thing on my script that does something is the line “AddItemToLeveledList GunRunnerStoreEnergyTier3 TacFBasic 1 1 75”  This tells me the following:  We're adding things to a Leveled Item, the name of that Leveled Item is GunRunnerStoreEnergyTier3, the item I'm adding is TacFBasic, it's adding one of them at Level 1 with a health of 75.  So let's find GunRunnerStoreEnergyTier3.  Since it's a Leveled List, it'll be in the Leveled Item section in your left pane of Geck, which is under the Items header.  Using the filter bar at the top of the left pane, you can limit the things shown to simply GunRunnerStoreEnergyTier3, or just GunRunnerStore or whatever you feel like typing.  Below is a picture of me doing it.




 


Pop that open with a doubleclick, and you'll be greeted with a window that looks like this:






 


There's a bit of information there, but most of it is unnecessary for our uses.  So, rightclick the area where the items are listed, select “new”.  That'll put a new record in the list.  To the right, there's a pull-down window labeled “Object”, that's where we'll select the object used in the record.  I know this is somewhat confusing, since so much of the Geck does all the record altering in the object selected instead of in a separate area, but this is how leveled lists work.  Luckily, pull-down windows are typing enabled and will sort to the first valid entry that matches what you've typed, so just type the formid of the weapon in that pulldown, which in this case is TacFBasic.  Below that are the entries for Level, Count, and Health.  That's where you're going to put the numbers at the end of the script line, left to right, so Level 1, Count 1, and Health 75.  Click OK and bob's your uncle.  Now you just have to repeat this process for all the AddItemToLeveledList entries, keeping in mind that some of the items added to the Leveled Lists by the script are Leveled Lists that are included in the mod.  This is fine, Leveled Lists can do some pretty weird and amazing things, and containing other Leveled Lists is pretty normal for them.  You'll notice that Leveled Lists, when added to Leveled Lists, have the health section greyed out at 100%.  That's normal, nothing to worry about.  Now, just finish doing all the Leveled Lists, and we can move on to Formlists.  I can wait, I just made a box of pad thai and got some more drinks.


 


Next is FormLists.  Like everything else on the Geck, formlists are important and used for everything, and for some reason have their own editing mechanics.  So the first line on the Tactical Flamers integration script dealing with Formlists is AddFormToFormList Everything TacFBasic.  This tells me we're adding TacFBasic to the formlist Everything.  Since Formlists are essentially just records that hold a list of formids, there's no need to count how many you're adding, or anything else like that.  You just add the form and call it a day.  So, first I'm going to go find the Formlist “Everything”.  Formlists have their own category on the left, under the Miscellaneous header.  Click that, then in the filter at the top, I typed Everything.  Then pop it open.  You should immediately realize that this isn't like any other record in the geck, if you weren't already aware of that (still running under the assumption that you don't know things, sorry).  If you rightclick, you'll get edit and use info options for the object you clicked.  There doesn't seem to be an option to add things or remove them or really anything.  That's fine, take a breath, and keep reading, I've got you.   Have a cigarette if it helps (still running under the assumption that you're easily panicked by written words, sorry).  Formlists are edited either by script, or by hand.  If you're editing them by hand, which is what we're doing here, we get to use such interesting things as “drag and drop” and “delete”.  






 


So, looking at the script, we're adding an item called TacFBasic to Everything.  Well, we have Everything open still, right?  So move that window off to the side where it won't be eclipsed by your Object Window, then in the Object Window, we're going to go find the item TacFBasic.  I already know what this is, it's a weapon, but if you're given an item to add that you don't know, you can actually filter your object window to that word, then select “All” at the very bottom of the left pane (if you're using Geck Powerup, you can do a Find Text in the Edit menu to find it).  Click the item and drag it over to your Formlist window so the cursor gets the little plus sign next to it, then drop it.  I would've included a picture, but Print Screen doesn't include your cursor.  Trust me, you'll notice it when you do it, since the dragged form changes the cursor to a No Circle until you have it over something you can drop it on.  If you accidently dragged the wrong item, don't panic.  You can go into the formlist, select the item you dropped there, and delete it with your delete key on your keyboard.  Then you can grab the right item and drag it over there, while cursing your mouse, like I do every damn time I do that.  When you're done, click OK and that'll save the Formlist.  Repeat this step with all your AddFormToFormlist entries, and I'll meet you down in the next paragraph for what to do with the now useless script.


 


As you do this, you may notice that all your new entries are showing up at the top of the list, and saying “But Puppettron, isn't this the bad thing you were warning about?”  Nope, not in the slightest.  You see, the formlists we're altering are being saved to the mod itself, so adding it or removing it will only effect  those formlists (or whatever you have set for your override in your merged patch).  The script makes changes to the base formlists, the ones included in FNV.esm and whatever else is a master.  And those changes are saved in your save file.  Making formlists as overrides, however, doesn't change the base formlists, and can be added or removed to your heart's content.  Remember, mods alter records in their own esps, scripts like this alter core records, and the way these scripts do it is bad.


 


We now have all our lists altered to now include the items in the mod, and we're now stuck with a script that's redundant.  There's two things you can do with this script now.  If you're the brave sort who never wants to look at that script again, then you can delete it.  Before doing so, however, you should also remove the quest it's attached to.  You see, scripts don't run on their own, they have to be attached to something in order to go.  Scripts like these are run out of quests, which are more than just something to point your character to in-game.  Quests do all sorts of things, but for right now, the quest we're dealing with just holds a script that runs.  To find this quest, find the script again in your Object Window, rightclick it and click Use Info.  In the window that just popped open – the Use Report window – you'll note that it's used in a quest.  I've included a picture to break up the monotony of the wall of text so far:




 


Go up to quests in your Object Window, which is under the header Actor Data – the first header, and find the quest.  Check to make sure the Quest doesn't do anything else besides run the script.  If it has Quest Stages, Quest Objectives, or anything under any other tab in the quest, you probably don't want to delete this quest.  And generally, if the Quest itself does things, it might be storing variables on the integration script.  If that's the case, and I'm just stating this in case someone came up with a script and quest that does more than just alter your lists – I have yet to see one, then what you're probably going to want to do is just comment out all the script bits that alter lists.  Do this by adding a semicolon “;” in front of these lines.  This will prevent the game engine from reading these lines.  However, if you've got one of the 99% of the mods that run integration scripts, the quest you're looking at is simply a holder of the integration script, and can be simply deleted.


Now, if you're one of the people who want to save things intact in case you need them later, which I often find myself doing, you can simply disable the quest.  These quests are designed to run the script at the beginning of the game and then shut off.  To do this, they have the “Start Game Enabled” checkbox checked, and the script does all the rest.  If you uncheck that box, then the game doesn't have a method of starting that quest by itself and that script will not run.  You can leave the quest and script in the mod for the rest of time without worry.  If, however, you've got a mod that does more than run the script, like mentioned above with extra stuff in the quest or script, then you can just comment out all the areas that just add things to lists and call it a day.


 


And now, for some warnings, which I put at the end to keep from boring you before now:


What you're doing is making alterations to your copy of the mod.  This in itself does not give permission to share your copy, you still need permissions of the mod authors to share, upload, or otherwise distribute this copy of the mod.  Check the mod on the download site you got it from to find the permissions.


 


There may be things not included in this walkthrough.  I took a very general path to explain how the majority of situations can be dealt with, but I wouldn't be surprised if someone went and did different things or completely new things that I didn't account for.  Feel free to ask for help in situations like that.


 


You may make mistakes, which may make the mod unusable.  It happens to the near-best of us, and might even happen to the gods of modding.  Since you made the alterations yourself, however, blaming anyone but yourself is pointless, although asking for help is always a good thing to do.  You might have to download another copy and start over.  This is frustrating, but it actually happens to pretty much anyone who's done any modding, so don't feel stupid about it.


 


The alterations you've made will require making a merged or bashed patch to allow for full integration and compatibility.  If you're unaware of how to do that, feel free to ask, although there's tons of information about these things online if you'd prefer to completely DIY.  The best modders all use merged or compatibility patches on their own LO's, although some of the more detail-oriented ones may do all the compatibility work themselves to put together the perfect LO for their game.  If you're unwilling to do a merged patch, then you're unwilling to do this walkthrough or you're wanting to run your game with whatever last mod in your LO has as its lists, which can make for disappointing play.  Merged and Bash Patches are very simple to do, easy to learn, and take less than 10 minutes to do;  if you don't know how to do them, there's no shame in learning.


 


Again, the alterations you're making are for your game only.  There's nothing wrong with altering your mods to your liking.  It is, in fact, encouraged.  It's how most of us learned how to mod.  Sharing or uploading or otherwise distributing your version of the mod requires permission from the mod authors, however, and if you're caught doing this without permission, I'll be the first to round up a posse and set about tar and feathering you.  I live in a state where this would probably be allowed, by the way.

You do not have the required permissions to view the files attached to this post.
perms:  either a full fireworks display spelling out "Puppettron Made This" anytime a user accesses my content in-game, or just give me credit somewhere.

TJ
Posts: 2181
Joined: Mon Sep 17, 2012 1:06 pm

luthien wrote:

Post by TJ » Tue Jul 01, 2014 9:55 pm

[quote=luthien]


Most users don't even know what those are any more in the days of NXMM "automatically" installing mods for them.  :/


[/quote]


Sad times indeed fella.


My project Dash is on Kickstarter!



User avatar
Puppettron
Gary
Posts: 1715
Joined: Sat Nov 23, 2013 10:47 pm

like i kept saying, everyone

Post by Puppettron » Tue Jul 01, 2014 10:42 pm

like i kept saying, everyone should know how to do that, and if you don't, ask.  unless i'm in the middle of eviscerating something or making a box of dinner, even i'd be happy to help.


perms:  either a full fireworks display spelling out "Puppettron Made This" anytime a user accesses my content in-game, or just give me credit somewhere.

TJ
Posts: 2181
Joined: Mon Sep 17, 2012 1:06 pm

Puppettron wrote:Everyone

Post by TJ » Tue Jul 01, 2014 11:10 pm

[quote=Puppettron]Everyone should know how to do that[/quote]


Quoted for great justice and truth. If you can't manage this you probably shouldn't be playing a Bethesda game. Sorry if that hurts anyone's feelings but it needed said.


My project Dash is on Kickstarter!



User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

You mean people might

Post by RoyBatty » Wed Jul 02, 2014 1:39 am

You mean people might actually have to DO something for themselves? *GASP* say it ain't so!


-redacted rant about entitlement and lazyness-


Good tutorial Puppettron, I hope some people learn something from it and gain a better understanding of modding, and creating and merging leveled lists.


 


Image

paragonskeep
Posts: 738
Joined: Thu Oct 25, 2012 6:19 pm

Huh????? I don't get it

Post by paragonskeep » Wed Jul 02, 2014 2:15 am

Huh?????


I don't get itwink


If life is but a test, where's the damn answer key?!?!?

Chaophim
Posts: 58
Joined: Sat Sep 21, 2013 2:29 am

Great tutorial - thanks for

Post by Chaophim » Tue Sep 15, 2015 1:47 am

Great tutorial - thanks for the help!



Easy trick I use to find scripts in mods is to open it in FNVEdit first and expand the mod's script tree, so I can see JUST what the mod adds/changes before trying to play 'where are you?' in GECK. 


I then either write down the script name/prefix I need, or I take a screenshot that I can reference on a second monitor after closing FNVEdit and opening GECK. :)



Post Reply