How to utilize OBMM.

This page updated on May 29 2017 CST

Script Examples

This page contains examples of scripts that I put together for mods that I have converted into OMODs. These examples will allow you to copy-paste into your scripts to avoid the trial-and-error approach to figuring out how to do it yourself.

NOTE: These examples are based off how I convert mods. They are not intended to try and preserve the original archive structure and contents. My purpose is to create a standardized feel and ease the installation and update process.

If you would like to request specific examples, please let me know on the feedback page.

Table of Contents

Harvest Flora 3.0

Date Added: 6/20/2007
Date Updated: 6/20/2007
Purpose: A script by -pk- for Harvest Flora

This shows a bit of old version detection, a pretty informative option setup, and using DontInstallAnyDataFiles along with InstallAllDataFiles (I figured some people might not know you can use both, the one that gets set last will be used because no files are actually installed until after the script completes).

Also LoadAfter isn't useless, it is true that your mod will be added to the end with or without it, but it will force mods added later (like DLCHorseArmor) to load before your mod, as well as prevent the user from manually using the Move Up or Move Down past the specified order.


The Code:

Oscuro's Oblivion Overhual 1.32 RC2

Date Added: 6/20/2007
Date Updated: 6/20/2007
Purpose: A script by -pk- that allows you to fully script the installation of OOO.

The script is now almost entirely dynamic (which took quite a bit of extra work in order to keep my favorite OOO Lite feature intact: "Prompt to install OOO Full if all addons from the full version are selected"). The doc/folder copy|install script worked out pretty good too. It's now extremely easy to update the script for new releases of OOO.

The script is completely built around the default folder structure, so you do not need to re-arrange all those plugins and other files. All you have to do is extract the OOO 1.3 Base and OOO 1.32 RC2 Patch to the same folder and add this script during the omod creation. You might have to get some of the code back on to one line depending on how it copies and pastes in to the editor.


The Code:

Kobu's Character Advancement System 2.4.1

Date Added: 3/1/2007
Date Updated: 3/1/2007
Purpose: A script by chimera134 that allows you to choose which options to install for Kobu's Character Advancement System

The Code:

Tweaked AWS Weather

Date Added: 1/9/2007
Date Updated: 1/9/2007
Purpose: A script by EnTropiA that allows you to choose which options to install for Tweaked AWS Weather

The Code:

TNR Races

Date Added: 1/9/2007
Date Updated: 1/9/2007
Purpose: A script by EnTropiA that allows you to choose which TNR race plugins to use. You'll need to download all the individual plugins and put them into one archive.

The Code:

Unofficial Shivering Isles Patch 1.0.0

Date Added: 6/6/2007
Date Updated: 6/6/2007
Purpose: My script for the Unofficial Shivering Isles Patch mod. (Manual version)

The Code:

Unofficial Oblivion Patch 2.1.2

Date Added: 10/15/2006
Date Updated: 6/6/2007
Purpose: My script for the Unofficial Oblivion Patch mod. (Manual version)

The Code:

Mighty Magick 5.25 Gold

Date Added: 9/12/2006
Date Updated: 10/15/2006
Purpose: This is my current script for the Mighty Magick mod.

This script isn't as easy as extracting the files from the downloaded archive and applying a script. The files in the archive need to be re-arranged to make the scripting part easier and cleaner. Here is what I did to the original downloaded archive.

IMPORTANT: Because the script uses the CopyPlugin and CopyDataFile, OBMM documentation states that it wreaks havoc on the conflict detection tool. The only way to avoid using those functions is to create multiple OMOD packages for each scenario (not likely with this complexity)

  1. Extract to the OMOD folder which will be something like obmm\omod\Mighty Magick\
  2. Move Optional Extras\Mundane Enchantment Adjustment.esp to the root of the mod folder.
  3. Move all files from the documentation folder to the root of the folder Mighty Magick
  4. Delete the Documentation folder
  5. Rename the following files to easily identify them in the data folder:
    1. MAIN README - READ THIS FIRST.txt --> Mighty Magick Readme.txt
    2. Racial Bonuses And Penalties.xls --> Mighty Magick Racial Bonuses And Penalties.xls
    3. Racial Magicka Amounts.xls --> Mighty Magick Racial Magicka Amounts.xls
    4. Birthsigns Bonuses and Penalties.xls --> Mighty Magick Birthsigns Bonuses and Penalties.xls
    5. Making KCAS and MM Compatible.txt --> Mighty Magick Making KCAS and MM Compatible.txt
    6. How to Upgrade Altmer to MM version 5.1+.TXT --> Mighty Magick How to Upgrade Altmer to MM version 5.1+.txt
    7. Fixing Summoned Creatures Permanently Affected by Side Effects.txt --> Mighty Magick Fixing Summoned Creatures Permanently Affected by Side Effects.txt
    8. Mighty Magick Full Version History.txt --> Mighty Magick Full Version History.txt
  6. Move Mighty Magick - Races.esp (English)\Beautiful People Support\Mighty Magick - Races.esp to the root of Mighty Magick and rename it to Mighty Magick - Races BeautyPeople.esp
  7. Move Mighty Magick - Races.esp (English)\Magistrate's Eyes Support\Mighty Magick - Races.esp to the root and rename it to Mighty Magick - Races MagistrateEye.esp
  8. Move Mighty Magick - Races.esp (English)\Nequam's Elaborate Eyes Support\Mighty Magick - Races.esp to the root and rename it to Mighty Magick - Races ElaborateEye.esp
  9. Move Mighty Magick - Races.esp (English)\Regular\Mighty Magick - Races.esp to the root and rename it to Mighty Magick - Races Regular.esp
  10. Extract Raised Enchantment and Spellmaking Limits\(DarkUI) WyldStar's Raised Limits.rar to the root of the mod folder and rename the files to the following:
    Menus\dialog\enchantmentsetting_menu.xml --> Menus\dialog\dark_enchantmentsetting_menu.xml
    Menus\prefabs\horiz_floating_scroll2.xml --> Menus\prefabs\dark_horiz_floating_scroll2.xml
    Readme.txt --> Raised Enchangement.txt
  11. Extract Raised Enchantment and Spellmaking Limits\(Regular UI) BloodBob's Raised Limits.rar to the root of the mod folder and rename the files to the following:
    Menus\dialog\enchantmentsetting_menu.xml --> Menus\dialog\reg_enchantmentsetting_menu.xml
    Menus\prefabs\horiz_floating_scroll2.xml --> Menus\prefabs\reg_horiz_floating_scroll2.xml
    Readme.txt --> DELETE DUPLICATE TEXT FILE
  12. Here is a look at the complete file list before and after.
  13. Here is a look at just the files that were re-arranged before and after.
  14. Edit Mighty Magick Readme.txt and add the standard header info:
    Name: Mighty Magick
    Version: 5.25 Gold
    Date: 10/14/2006
    Category: Gameplay Effects and Changes
    Author: Damar Stiehl (olgerthheidern@hotmail.com)
    Source: http://www.tesnexus.com/downloads/file.php?id=5746
  15. Open OBMM and follow the tutorial on Creating an OMOD.
  16. When it gets to the Script section, add the script below.

The Code:

Ring of Wings Levitation 0.2

Date Added: 9/26/2006
Date Updated: 9/26/2006
Purpose: My script for the Ring of Wings Levitation mod.

The Code:

Ringwraith Armor 1.3

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: This is my current script for the Ringwraith Armor mod.

The Code:

Ringwraith Armor 1.3 (Alternate)

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: This was the first version of the script for this mod before TimeSlip introduced "DontInstallAnyPlugins." It works fine but there is a bunch of code.

The Code:

ArmoryLab 3.3

Date Added: 9/7/2006
Date Updated: 11/13/2006
Purpose: My script for the ArmoryLab mod. Please note that I modified the original archive by removing the gardening component since I already have it as a stand-alone OMOD.

The Code:

BadMagic's Light Knight's Armor 1.0

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for BadMagic's Light Knight's Armor mod. This is the kind of script you use when a mod's readme says to use one .esp or the other but not both.

The Code:

House Map Markers 1.4

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for the House Map Markers mod. This is the kind of script you use when a mod's readme says to use one .esp or the other but not both. I added an additional popup message to explain the choices that are about to be displayed.

The Code:

The Atlantean Sword 1.4

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for the Atlantean Sword mod. Since the mod allows both types of swords to run at the same time, I used a SelectMany fuction.

The Code:

Ancient Goblin City 2.0

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for the Ancient Goblin City mod. Here is a way to check for the existance of a required mod, the .esp name was specified.

The Code:

AC Stock Armor 0.2

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for the AC Stock Armor mod. Here is a way to check for the existance of a required mod, the mod name was specified.

The Code:

Ren's Beauty Pack 1.1

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for Ren's Beauty Pack mod. In this example, I felt it was better to simply inform the player of known conflicts rather than trying to detect them since a detection script would likely not catch all versions that were named differently.

The Code:

Weather Inside [Seasons] 1.2

Date Added: 9/7/2006
Date Updated: 9/17/2006
Purpose: My script for Weather Inside [seasons] mod.

The Code:

Alternate Dwarven Helmet 1.1

Date Added: 9/8/2006
Date Updated: 9/17/2006
Purpose: This Alternate Dwarven Helmet mod had me puzzled on how to cleanly build an omod. It packaged a custom helmet that was placed in the game and could be purchased (used the .esp file) and it included a model/texture replacer which replaces all existing Dwarven Helmets. I could have combined both of them and used script to allow the user to pick one or the other or both, but it would have been complex and time-consuming. Instead, I separated them into two folders and called one "Alternate Dwarven Helmet" and the other "Alternate Dwarven Helmet Replacer" and created two separate OMODs and didn't need any script at all!

The Code:

--SCRIPT TITLE HERE--

Date Added: 1/9/2007
Date Updated: 1/9/2007
Purpose: --INSERT PURPOSE HERE

The Code: