Fallout 2 mod How-To Journal: Creation of the Mod "Innocence Lost"

Discussion in 'Fallout General Modding' started by Robert B, Jun 7, 2017.

  1. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Hey Everyone, this thread is going to be my attempt to document the major tasks and activities that go into creating a replacement mod for fallout 2. My intention is to help new modders consider the bigger picture in how to approach such a massive project. I'm going to do this in the context of creating my own replacement mod, so anticipate we'll cover what goes right and wrong as a part of this process.

    I encourage everyone in the modding community at NMA to provide their own thoughts. I am NOT a veteran modder for FO2. I am going to be posting what I learn, as I learn it. I've received significant help just to get the basics down and you should anticipate it'll take you a while to figure things out as well.

    Now to begin...

    When I first got the modding bug for FO2, I really had a tough time getting started. I was already very familiar with FO1 and FO2 (Fallout 1 and Fallout 2) as well as a number of major mod's that have been published in the last several years. I'd done mod's for other games (primarily the Bethesda series of Fallout and Elder Scrolls). They include much more mature and complete tools and provided only the barest of preparations to work with the original Fallout games.

    First of all, there's no single tool you use to mod FO2 (or FO1 for that matter). All the tools we have today were pioneered by folks more talented than ourselves and have been made available so that we can have an easier job of modding this classic game. This means that there's a lot of materials out there; but you have to be introduced to them and understand them in context of creating FO2 mods.

    So let's start this thread with what you need to do BEFORE you ever embark on creation of a replacement Mod...
    • [Like] [Like] x 2
  2. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    First, you need to have a place to play with mods. I deleted and did a clean re-install of FO2 from Steam. Using Steam is advantageous because you don't need a NO-CD patch and you can copy/paste multiple versions of the FO2 directory without any restrictions. DO NOT TOUCH THIS INITIAL INSTALLATION DIRECTORY WITH MODS SO THAT YOU CAN ALWAYS GO BACK TO IT LATER AND RE-CREATE YOUR MODDING DIRECTORY WITH A SIMPLE COPY / PASTE!

    Second, you copy and paste the entire FO2 main directory and subfolders to the location of your choice. I chose c:\Fallout 2 [Modded] as my directory. You can do whatever you like.

    As for installation of using the original FO2 CD? Well, I'm not covering that here. I long ago lost my CD and I don't want to give any mis-information.
  3. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    What's next? Well, there's sfall by timeslip. He created both an end user version of the tool along with a modder's pack. While the end user version of sfall does come included with your installation of Steam, we want to use the latest version and the modders pack.

    The latest files are available on sourceforge.net at the following links...

    sfall - https://sourceforge.net/projects/sfall/

    sfall modders pack - https://sourceforge.net/projects/sfall/files/Modders pack/

    Install sfall just by copying the contents of the file into your FO2 [modded] main directory. It gives you the ability to make numerous changes to the gameplay for FO2 AND is a valuable tool for creation of your own custom mods.

    I put the sfall modders pack into it's own subdirectory under the FO2 [modded] main directory. In this case c:\Fallout 2 [modded]\sfall modders pack. You can put it elsewhere, but I find it convenient to have it where I can easily find it.

    Familiarize yourself with the parameters in sfall. Create a backup copy of the ddraw.ini file and then tweak the settings as much as you like. I first became interested in how FO2 could be modified by playing with sfall and wondering "what if?". There are more tweaks than I can reasonably cover in this thread, so just trust me. You'll want to learn the parameters of the end user version of sfall. Spend a few weeks on it if you have the time to burn.

    So what should we do with the sfall modders pack? Well nothing for now. Eventually we'll use a tool it provides called a script editor. This will allow you to write code to control objects and actions within FO2. ...but this is for a later post after we get you started on a few other things.
  4. naossano

    naossano Vault Fossil

    Oct 19, 2006
    I am very excited to follow this thread.
  5. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    So, you've spent anywhere from a few minutes to a few weeks playing with sfall configuration parameters. You're off to a good start!

    Now we get into some more interesting stuff. I know you want to change "real" stuff in FO2, not just parameters, and we're getting closer to that objective.

    So what's next on the list? Well, you can't just mod FO2 the way it is. We need to be able to get to the detailed map, graphic and script files that make up the game. As it is now, they're compressed in the *.dat files. These are critter.dat, F2_res.dat, master.dat and patch000.dat.

    ATTENTION: If you don't have a patch000.dat file, you're probably following these instructions but are using a CD installed version of FO2. Back in the day, you needed to patch your game to get it up to the latest version. That's not necessary with Steam, but if you find yourself in that position. Go look for the official fallout 2 patches and install them before you complete this step.

    Okay, back to the instructions... What do we need to crack these guys open? Well, it's the DAT Explorer by Dims. You can find that right here on the NMA site at http://www.nma-fallout.com/resources/dat-explorer-by-dims.56/.

    Download it and unpack it into a folder under you FO2 [modded] main directory. In my case I put it under c:\fallout 2 [modded]\Dat Explorer. In truth, you can put it anywhere on your PC... I just like putting these utilities under the main Fallout 2 folder.

    So let's unpack those *.dat files! Navigate into that folder you just created and look for Dat Explorer 1.43.exe. Double click on it and you'll be brought to a window that says "Startup Form" with a graphic that says "open". Double click on that.

    Now it's time to navigate the program to your FO2 [modded] folder. You know (from above) where I put mine. Navigate to yours and select the first *.dat file. This should be critter.dat. Open it.

    At the top of the screen there is now a menu selection called "Extract", pick that and select the menu option "Extract all files to...". Yet again, you must navigate to your FO2 [modded] folder. Click "OK" when you're there.

    Now let the program run until everything is extracted. Do each *.dat file in turn until you end with the last file patch000.dat. Get that unpacked and you're done with this step.
  6. NovaRain

    NovaRain Casual Modder

    Mar 10, 2007
    I'd suggest using killap's unofficial patch instead of extracting contents from official 1.02d's patch000.dat, if you want a more up-to-date vanilla FO2 as the modding base. And I'm not really sure why you want to extract all stuff from master.dat and critters.dat. It's kinda overkill IMO.
    Last edited: Jun 7, 2017
  7. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    So can we mod yet??? Um, well, yes... ...but right now we're just set up to mod scripts (remember the sfall's modders pack and the script editor?). That has quite the learning curve and isn't as immediately satisfying as modding what we call "maps".

    Maps represent the various locations you run around in when you're playing FO2. You can add objects, items and creatures to existing maps and really get the sense you are accomplishing (or breaking) something quite quickly.

    So let's go ahead and install the next tool. That is the BIS Mapper. You can also find this right here on the NMA website here... http://www.nma-fallout.com/resources/bis-mapper.55/

    It's critical as a modding tool. Not only does it allow you to modify maps; but it has a large number of reference scripts and items you can include in your mods. It's simply the most important tool you'll use along with sfall's script editor. There's a lot more to it that just the BIS Mapper itself.

    Just a warning, this is an OLD tool. You're going to learn to love and hate it at the same time. It's nothing like the modding tools we have for newer games, but it gets the job done.

    So, let's install the BIS Mapper tool and resources...

    Download it and unpack it into a folder under you FO2 [modded] main directory. In my case I put it under c:\fallout 2 [modded]\BIS Mapper. As I've said before, you can put it anywhere on your PC... I just like putting these utilities under the main Fallout 2 folder.

    Now for a bit more eclectic part. This is old school and you need to use the DOS Command Window... The BIS Mapper needs to be told where to find the FO2 files and it can only handle the 8 character limit directory names.

    Open the DOS command window by searching for CMD.EXE from your start menu or find it by navigating to the All Programs/Accessories folder in the START menu. Once it's open and running there, you're going to type "CD \" in the DOS command window and then hit enter. This will get you to the c:\ directory.

    Now the reason I put my FO2 directory at the root of the C: drive is simple. It makes it easy to navigate to for these old tools. You need to type "Dir /x" into the command window and confirm the 8 character name of your Fallout 2 [Modded] directory. In my case it was c:\Fallou~1.

    Now that you know that, you can configure the BIS Mapper. You need to find the following lines and edit them...




    I know, I know. It's not something you'll ever use anywhere else; but it's good to be able to figure this out. NOW you are ready to Mod Maps!
  8. NovaRain

    NovaRain Casual Modder

    Mar 10, 2007
    No need to bring up DOS command as you can simply use relative paths in mapper2.cfg.
    For example here's my BIS mapper w/ hi-res patch 3.0.2 in a subfolder of FO2 main directory: http://www.mediafire.com/?0dwlf6vklxemwei
  9. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Good idea on using killap's patch but I received a warning on the download from fileplanet. https://www.fileplanet.com/210600/210000/fileinfo/Fallout-2---Unofficial-Killap's-Patch

    Let's just call that an optional step you can perform prior to doing the *.dat extract. I could be getting (yet another) false positive on my virus scanner.

    I totally agree it's overkill to extract everything; but it is the simplest approach. I hope you'll forgive me for taking the easy way out!
  10. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Another good option. So you can use @NovaRain 's BIS Mapper hi res patch on the standard BIS Mapper that I provided the link to on NMA. You can also use relative paths in the config file.
    Last edited: Jun 7, 2017
  11. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Alright, it's on to modding with either the BIS Mapper from NMA downloads or as suggested by @NovaRain to use the BIS Mapper and then patch it. I'm not going to give you detailed instructions on how to use the mapping tools. They all include some remedial instructions on making changes. What I will suggest is that you do the following...

    Find the map "artemple.map" in your Maps folder under your FO2 [Modded] directory. Make a backup copy of it, just to get in the habit of saving off these things before you break them. Next, open your mapping tool...

    Find the map "artemple.map" by using the File/Open command. This is the first one you want to play with as it's the first one accessed by the game when it starts. Here's a couple of ideas for projects you can complete...

    - Create a chest with an inventory of starting items for your toon
    - Delete some objects to make space for your next task...
    - Build a small building and notice how much of a pain it is... Recommendation, start with the back wall and work forward.

    Save your changes and then play a new game to see the results! A few major items you'll see. If you gave your toon items in the chest that DO NOT have an associated tribal toon graphic associated with it, the game with crash to desktop (aka super sledge hammer doesn't work but a spear does). ...of course give him a leather jacket and there's no problem!

    Next, find the file arcaves.map and back that one up. Then restart your mapping tool and select that file. You'll see you're in the 1st level of the temple with 2 ants on the screen. Here are your projects...

    - Use the up/down arrows to see all of the temple levels in the arcaves map.
    - Copy or create a new ant WITHOUT editing it to add a script to him
    - Copy or create an ant and add the same script you find in the existing two ants (no, I'm not telling you how... ...figure it out)

    Save your changes and then play a new game to see the results. You'll notice the one ant doesn't react to your player and the other new ant does. It's an important lesson.

    Hmmm... This is enough to get you started with the mapper tools and allow you to begin exploration on your own. Not sure when I'll get to the next installment (this was a lot to do in one sitting), but next time I get the chance we'll talk about scripting (objects, critters and maps) and where to find how-to references.
    Last edited: Jun 7, 2017
  12. Lexx

    Lexx Lived Through the Heat Death

    Apr 24, 2005
    But this is wrong? Ever since I started modding Fo2 back in 2005 I had much longer directory paths. You can just install the mapper normally and then apply the high-res patch, it shouldn't change much except screen resolution and possible color corruption fix. I also never used the command line for anything except these stupid audio and mask file converter tools.

    Also about your mod setup, you can just use this approach to keep your Fallout files close together.
  13. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Hey @Lexx I'm unsure on the file path requirements. I just documented what I had to do to get it to work. I could be over thinking it.

    Good idea on how to keep mod files together. I'm documenting the approach I used; there are clearly other (perhaps better) ways.
  14. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Alright, so we have one of the biggest topics to discuss now... Scripting... aka using the programming language of FO2. It can seem onerous to learn; but in FO2 it isn't that bad. We have a whole host of references available to use and you'll need them.

    So what are the big concepts? Well, scripting is used in a variety of places. It can be attached to maps, critters, objects and items. There's even a script for the most important critter in the game "Dude_Obj". That's the player.

    You've already attached an existing script to an ant in the exercise for the arcaves.map update. In that lesson, you learned that scripts don't automatically come attached to objects and that you need to manually assign them. Scripts attached to maps (fortunately) have the same name as the associated *.map file. For other objects and critters, you need to use the edit button in your mapping tool to see/assign scripts. You also attach these to maps using the mapper program (but we're using existing maps 'n scripts here so you don't need to know that).

    The biggest warning is that scripts attached to items have been documented to be extremely buggy. How do I know? Well, I haven't tested item scripts. I'm basing the advice to avoid them on the guidance of other, more experienced hands at modding. If someone knows better, I welcome the input here. I don't want to pass along bad advice.

    Now we know where scripts are used, how do I edit them? Well, remember we installed the sfall modders pack, right? Go into that folder and find the one called Script Editor. Go into that folder and start up the ScriptEditor.exe program.

    A BLANK SCREEN! How exciting! Alright, let's look at some code...

    We're going to pick on the artemple script because you've already played with the map and you should learn what's going on in this script. I'm ONLY going to tell you that FO2 programs are structured with declarations at the beginning and proceedures that are called as the program runs. I'll give you some references later so you can figure out the detail.

    Programs are saved, uncompiled, in *.ssl files. When you compile them, they are turned into *.int files and put into the folder that YOU choose for Compiled Scripts. You must MANUALLY move these scripts to your Fallout 2 [Modded]/Data/Scripts folder. Wonder why your new code isn't working? As a new scripter, it's often because you forgot to move your compiled code to the right location.

    Your exercises are simple...
    - Review each procedure and try to figure out what it's doing
    - Go ahead and add some display messages in each procedure, so you can see when/how frequent they're called
    - Add some items to the character's starting inventory
    - Go back into the Mapper program to find the script that was being used for the ants, then go open that code in the script editor and figure out what it's doing

    So wait, is this totally unfair? I haven't told you any details... Well, that's on purpose. A lot of work needs to go into figuring these things out on your own. The key is knowing where to look for answers.

    #1 - You can search the NMA Forums on your question, but to be honest most of the new modder info isn't housed here..
    #2 - You can review the NMA Archives for articles on modding, including how to get started in scripting - http://archive.nma-fallout.com/content.php?page=fo-modding. It's a good starting point.
    #3 - There's another good website, Vault-Tec Labs that has a bunch of tutorials on how to mod FO2 - http://falloutmods.wikia.com/wiki/Category:Fallout_2_tutorials. Be sure to look at the article on Commands, macros, procedures, variables, operators and headers. It explains how to leverage the header files found in the BIS Mapper\scripts\headers folder.
    #4 - You can see all of the scripting commands in the Fallout_Editor.pdf file in your BIS Mapper main folder
    #5 - You MUST review the content of the BIS mapper\scripts\HEADERS folder. - HINT: Look at the PID files like ITEMPID.H. You can "include" that header file in your updated script or simply look up the ID number of the object you want to add to the player inventory in the exercise above.

    Hmmm... There are probably more references, but these are the primary ones that I've found or been directed to. It'll give you a good start. Now go ahead and start scripting!
  15. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    What else is there to mod? Well, you can modify the worldmap, items and critters. (I haven't learned where/how to edit objects yet but we'll include that in this thread when I do...)

    For attributes of items and critters, I use Cubik's Critter and Items Editors. They're two tools that are pretty easy to use. I suggest you download the tools and check them out. Your exercises here are to modify existing item/critter stats. F2wedit v. is the item editor and (duh) Fallout 1/2 Critters Editor v. is the critter editor. You can find the links right here on the NMA forums. http://www.nma-fallout.com/threads/new-tools-for-fallout-1-2.196393/#post3871106

    Oh and what about the worldmap? The graphic creation processs is documented here... http://fkmoddingstudio.4t.com/Worldmap.htm I started creating my own world map for my mod (using GIMP) but ultimately decided it'd be easier to work with the existing worldmap from FO2. I really don't know much more about what it takes to create and implement your own worldmap; so advice from other (more experienced) modders on resources to would be great.

    What else is there... Oh yeah, modifying the sprites/graphics themselves... For this your reference is out on Vault-Tec Labs - http://falloutmods.wikia.com/wiki/Category:Fallout_2_tutorials_-_art. I haven't done this myself; but this will get you started.
  16. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    I don't know if you've noticed, but the intention of this thread is to document the major tasks and activities that go into creating a replacement mod for fallout 2. Up until now, I've only given you information on how to get in and modify existing maps, scripts and graphics. The reason for that is obvious. You need to learn how to perform these tasks on your own and the best way to do it is to have you work from examples that already exist.

    How long should you work on existing maps and scripts? Well, you really need to be comfortable with how to use all the commands, inclusions and editing the maps. I'd say several weeks to months; but there are those of you that are ready to dive in. Before we do that though, I want to give this thread several days to simmer and get the advice of our other more experienced modders.

    The key questions are:

    1 - Did we miss anything that a new modder should learn before they ever consider starting a replacement mod?
    2 - Is there anything I've documented for which alternatives exist or there's a better way than I've suggested?

    The next entry in this thread is going to be "Now that you know how to mod, what are the initial preparation steps in creating a replacement mod"... So if you have any advice in this area, hold off until I make that post.


  17. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Hmmm... Alright, I was sincerely hoping for some additional input on the fist section; but I guess we're ready to move on to the next stage. The first section was just "figuring out first how to mod" and I tried to provide my own experience, draw out the opinions of others and share the resources that I'd found.

    This next section is putting yourself in the best position to succeed with a replacement mod. It's much harder to stay organized than with a single function mod, small town, addition encounter, bug fixes or new features. So, what are the initial preparation steps in creating a replacement mod? Let's speak generally and then we can talk specifics...

    1) Have a story outline: Know the basics of how you want to begin, where it's going to happen and the toons involved. What is driving the player through your mod? Is it exploration, a dire mission or just flat out survival? For this I went ahead and drafted everything in an RTF file that I keep in my mod development folder. Every time I get an idea for the story, a new location, lore, quest step or development idea; I drop it in.

    2) Describe your locations: Know where they will reside on the map and how they relate to one another. This will help further develop your story line.

    3) Develop your characters: Each location will have main characters that you will rely on to develop your overall world story line. Take a few moments to come up with preliminary names and descriptions of them in addition to any dialog ideas you may have. A toon with a little bit of background and a personality really helps with player immersion in your mod.

    4) Consider encounter mechanics: To kick off my quest, I know that I want to eject the player from their home vault and that I'll want to trigger an explosion that collapses the entrance to that vault. I have this documented along with how I intend to implement it in the scripting. I will allow you to script the basics, leave placeholders and then come back and enhance it later.

    5) Comment the crap out of your code: Just because you figured out how to script something once, doesn't mean you'll remember it later. For your own sanity, make some notes in the code as you go. I can't tell you how many times this has saved me a boatload of rework.

    6) Don't forget your side quests: I keep a running list in each of my location descriptions of the side quests I want. You can then put these in when you have time, after the main story line is in place. Don't hesitate to brainstorm with others to come up with side quest ideas. Friends can help out a lot.

    7) Use iterative development cycles: I don't recommend marathon mapper or scripting sessions. You've created a roadmap in the steps above. When it comes to doing the actual development, take advantage of it. Get the basic framework in place first with some simple location maps, basic scripts and dialog before you start enhancing. You don't want to burn yourself out. Be creative when you are in the mood, script when you have the focus, graphics when you feel an abundance of patience and do map updates when you're just of the mind to kill time. This approach also allows you to get feedback on how well your story works BEFORE you've invested hundreds of hours of development.

    8) Don't give up: There are things that you'll find easy to do and others that you'll want to break a few chairs and toss the room. When you get stuck, have done your research, taken a break, come back to it and still come up empty on a solution, ASK for help. There are some really diligent, dedicated and downright helpful modders in the forums. I am humbled by how willing they are to share their insights, opinions and knowledge.

    9) Take criticism lightly: There are a lot of opinions out there and you NEED to hear them. You have a vision of how you want your mod to look, feel and flow. Other people may or may not "get it" or provide feedback that you don't consider helpful. Consider for every turd you get, you also have the chance to get a gem of a suggestion for how to improve your mod. It's just part of the process. You can take it personally or you can move on and focus on the ideas that help make your mod better.

    I'm sure there is more good advice out there and I know that I'd love to hear it. Please feel free to comment!

    My next entry will assume you have your storyline, locations, characters and mechanics of your mod outlined. I'm going to share what I did first when I started "doing" my mod, not just preparing to do it.
  18. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Okay, first things first. In my mod, I decided to utilize the existing FO2 worldmap. That saves me a step of creating a new worldmap for my mod. If you want to create a new worldmap, we've mentioned those resources above and I won't cover that aspect of mod creation here.

    Secondly, you know you have your storyline, locations, characters, etc. outlined. We need to tackle building the framework for your mod's world. We know we need location maps for each of the locations in our story line, so...

    Step 1) I created a generic map file that was just one big desert location. I simply filled the level zero with all desert tiles, set the edges, a starting hex, an exit grid and called it good. Please make it BIG, so that it's easy to work with later. You don't want to hassle with small maps. They're a pain.

    Step 2) I created a generic script for my generic map pulling the basics from the artemple.int file. I commented out the initial inventory procedure (and related lines of code calling it) and saved it off with the same name as my generic map.

    Step 3) I copied and renamed the map and script files so that I created above and named them for each of my storyline locations. I then went in to each of the map files and assigned that related script. Don't forget you need to update your SCRIPTS.LST file with all these new script names/descriptions.

    Step 4) I then did my modifications of the MAP.TXT and CITY.TXT files. In my case I knew I would not use more locations than the existing FO2 game; so I didn't need to apply the City Patch (that updates the FO2 EXE file and allows you to have more locations). I put all my new locations in as replacements for the existing locations and then moved them all close together on the worldmap. (Modify the world_pos= variable to do so). [This was a suggestion that @Lexx gave to me and it's a good one. ] Just be sure the location circles don't overlap and leave comments on the original locations (if you want to put them back there later).

    Step 5) Now go in to your ddraw.ini and update the starting map to be one of your newly created maps.

    Step 6) Next you test that you can go to each of your new locations on the world map and that you didn't screw something up.

    From this point on, you start filling in detail. It's the point I've reached in my own replacement mod efforts. I recommend working on your core locations and characters first, then moving on to secondary ones. Start your main quest dialog EARLY. Fill in the cool details later.

    Your main quest is the most important to model so that you can get feedback from others. Don't spend all your time updating maps/locations. The character/critter/encounter development is where your mod will succeed or fail.

    Ummmmm... Yeah, that's all the preparation steps that I have. I'm sure there is more feedback we can get from other modders. I don't know that my approach is the "best" one; it's just how I figured it out for myself. Comments here are welcome.

  19. Lexx

    Lexx Lived Through the Heat Death

    Apr 24, 2005
    Well, so far nothing wrong. Most important is to have something playable fast. Seeing something substantial being done also helps as motivation.

    Oh, and of course it helps if you want to recruit others for your project, as you can showcase how and to what extend you can contribute by yourself. You know.. ideas, everyone got them, so that's rarely what makes people join your project.

    About the city limits patch.. not sure right now, but I think with the current Sfall release it isn't necessary anymore anyway.
  20. Robert B

    Robert B Kitty's got some rads!

    May 29, 2017
    Continuing this thread on how to make a replacement mod, please see this thread where @Lexx helped me out!

    Summary: I was having problems getting all of the configuration/text settings working properly between the CITY.TXT, MAP.TXT, MAP.MSG and (we discovered) the WORLDMAP.MSG file. In addition, I was unable to get the Town Map Art to display correctly. See all the answers here! --> http://www.nma-fallout.com/threads/town-map-art.213455/