/[wryebash]/branches/upstream-dev/Mopy/Docs/Wrye Bash Technical Readme.html
ViewVC logotype

Contents of /branches/upstream-dev/Mopy/Docs/Wrye Bash Technical Readme.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations) (download) (as text)
Mon Sep 19 03:20:26 2016 UTC (3 years, 4 months ago) by william
File MIME type: text/html
File size: 65227 byte(s)
add upstream git branches for dev and master
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <link rel="shortcut icon" href="../bash/images/bash_32.ico"/>
4 <title>Wrye Bash Technical Readme</title>
5 <style>
6 html {font-family:Arial,sans-serif; background:#ffffcc; font-size:0.9em;}
7 h1, h2 { background: #9ACD32; margin-left: -8px; margin-right: -8px; padding:0.6em; }
8 h1 { margin-top:-8px; padding-left:1.5em;margin-bottom:0;}
9 h2 { margin-top:5em; padding-left:2em;}
10 h3 { font-size:1.1em; margin-top:3em;}
11 a:link { text-decoration:none; }
12 a:hover { text-decoration:underline; }
13 li ul, li ol {margin-top:0.4em;}
14 li {margin-bottom:10px;}
15 ol ol {list-style:lower-alpha;}
16 ol ol li {margin-bottom:0.2em;}
17 td, th {border:1px solid black; padding: 5px; vertical-align:top;}
18 table {margin:1em; background:#fdfdfd; border-collapse:collapse;}
19 thead {font-weight:bold; background:#8af;}
20 img {border:0;}
21 a[href^="http"]:after {padding-left:2px; content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);}
22 q {font-style:italic;}
23 code {display:inline-block; padding:2px 5px; background:#DDD;}
24 code.box {line-height:20px; white-space:pre; margin:1em 0 0 3em; display:table; padding:5px 10px;}
25 blockquote {background:#E6E6FA; display:table; padding:5px 30px 5px 10px;}
26 figure {margin:0;}
27 figcaption {font-style:italic; margin-bottom:2em;}
28 .missing {background:red; color:white; border:0.25em solid black;}
29 abbr {cursor:help;}
30
31 .indent {margin-left:2em;}
32 td > code.box {margin:0;}
33 </style>
34
35 <h1>Wrye Bash Technical Readme</h1>
36
37 <h2 style="margin-top:0;">Contents</h2>
38 <ol>
39 <li><a href="#intro">Introduction</a>
40 <li><a href="#wizards">BAIN Wizards</a>
41 <ol>
42 <li><a href="#wizards-overview">Overview</a>
43 <li><a href="#wizards-dialog">Dialogues</a>
44 <li><a href="#wizards-language">Language Structure</a>
45 <li><a href="#wizards-functions">Functions</a>
46 <li><a href="#wizards-keywords">Keywords</a>
47 <li><a href="#wizards-operators">Operators</a>
48 <li><a href="#wizards-constants">Standard Constants</a>
49 <li><a href="#wizards-escape">Escape Sequences</a>
50 <li><a href="#wizards-examples">Examples</a>
51 <li><a href="#wizards-obmm">Wizards vs. OBMM Scripts</a>
52 </ol>
53 <li><a href="#rulesets">Mod Checker Rulesets</a>
54 <ol>
55 <li><a href="#rulesets-overview">Overview</a>
56 <li><a href="#rulesets-syntax">Syntax</a>
57 <li><a href="#rulesets-example">Example</a>
58 </ol>
59 </ol>
60
61
62 <h2 id="intro">Introduction</h2>
63 <p>Wrye Bash is a powerful mod management utility for TES IV: Oblivion and TES V: Skyrim. Its features include:
64 <ul>
65 <li>A mod installation and conflict manager
66 <li>A plugin load order manager
67 <li>Increased mod compatibility
68 <li>Lifting of the 255 plugin limit through automatic merging of compatible mods
69 <li>.ini and settings files tweak management
70 <li>Screenshot management
71 <li>Many, many more features
72 </ul>
73 <p>Wrye Bash can appear daunting at first. To help make it more manageable, the documentation has been split into a few readmes that are targeted towards different usage requirements.
74 <p>This readme covers the most technical aspects of Wrye Bash, being the Wizard scripting language and the syntax used in Mod Checker rulesets. Information on the most commonly used aspects of Wrye Bash may be found in the <a href="Wrye%20Bash%20General%20Readme.html">General Readme</a>, and the <a href="Wrye%20Bash%20Advanced%20Readme.html">Advanced Readme</a> holds information on more advanced and less commonly used features. Wrye Bash's version history is stored in the <a href="Wrye%20Bash%20Version%20History.html">Version History</a> document.
75
76 <h2 id="darn">DarNified Books Wtxt Formatting</h2>
77 <p>The DarNified Books setting in the Bashed Patch's tweaks allows the use of Wtxt formatting, which is applied if the first line of a book is <code>== title ==</code>
78 <ul>
79 <li><code>&lt;&lt;</code>, <code>^^</code> or <code>&gt;&gt;</code> at the beginning of a line generate a <code>div align=left</code>, <code>div align=center</code> or <code>div align=right</code> tag respectively.
80 <li><code>== text ==</code> generates a level 2 header.
81 <li><code>=== text</code> generates a level 3 header.
82 <li><code>__text__</code>, <code>~~text~~</code> and <code>**text**</code> generate emphasised text.
83 </ul>
84
85 <h2 id="wizards">BAIN Wizards</h2>
86 <h3 id="wizards-overview">Overview</h3>
87 <p>Bain Wizards allow mod authors to include a simple configuration script with their packages. Wizards run on a simple scripting language similar to OBMM script, contained in a <code>wizard.txt</code> file in the package. When run, the wizard will run through a series of windows to allow you to select options, then show a summary page at the end telling you which sub-packages and esps/esms will be selected, and any INI tweaks that will be applied.
88 <p>Those using Notepad++ to write their install scripts may want to use utumno's <a href="http://oblivion.nexusmods.com/mods/32654">BAIN wizard Script Highlighter for Notepad plus plus</a> as it features code folding and syntax highlighting to make spotting mistakes easier.
89 <p>There is a similar <a href="http://oblivion.nexusmods.com/mods/34240">BAIN Wizard Syntax for EmEditor</a> syntax highlighter for EmEditor created by broken85.
90
91 <h3 id="wizards-dialog">Dialogues</h3>
92 <p>You may use a number of different dialogues in a wizard. The available dialogs are described in this section.
93
94 <p><dfn>SelectOne</dfn> - This <a href="../bash/images/readme/selectone.jpg">dialog</a> gives you a list of options, with the option to select one of them. It will be shown when a <a href="#wizardsSelectOne">SelectOne</a> keyword is used. Each option can display an image associated with it, and a description as well. To see a larger version of the image displayed, either right click or middle click on the image. The wizard can specify a default answer, and if you are running it as an Auto-Wizard, then this page will be skipped, using the default option.
95
96 <p><dfn>SelectMany</dfn> - This <a href="../bash/images/readme/selectmany.jpg">dialog</a> gives you a list of options, with the option to select one or more of them, or even none of them. It will be shown when a <a href="#wizardsSelectMany">SelectMany</a> keyword is used. Each option can display an image associated with it, and a description as well. To see a larger version of the image displayed, either right click or middle click on the image. The wizard can specify default options, and if you are running it as an Auto-Wizard, then this page will be skipped, using the default options.
97
98 <p><dfn>Cancel</dfn> - This <a href="../bash/images/readme/cancel.png">dialog</a> will be shown if the wizard cancels execution for some reason, activated by the <a href="#wizardsCancel">Cancel</a> keyword. If a reason is given, it will be displayed.
99
100 <p><dfn>Error</dfn> - This <a href="../bash/images/readme/error.jpg">dialog</a> will be shown if the wizard encounters an error in the wizard file. The wizard will then quit.
101
102 <p><dfn>Finish</dfn> - This <a href="../bash/images/readme/finish.png">dialog</a> will be shown at the end of the wizard, to show you which sub-packages, esps, and esms will be selected. It will be shown either when the end of a wizard file is reached, or if the <a href="#wizardsReturn">Return</a> keyword is used. It also shows what INI Tweaks will be applied, and also serves as a place for any extra notes from the mod author to be displayed.
103
104 <p><dfn>Version Warning</dfn> - This <a href="../bash/images/readme/versions.png">dialog</a> is displayed if the user's system doesn't meet the package's game, script extender or graphics extender requirements.
105
106
107 <h3 id="wizards-language">Language Structure</h3>
108 <p>Each line of a Wizard contains one statement. To carry a statement across multiple lines, end each line of the statement with a backslash <code>\</code>. This will cause BAIN to read the next line as if it were part of the first.
109 <p>Wizard syntax is case-sensitive, apart from filenames. Make sure when writing Wizards that you use the correct case.
110 <p>Variable names may contain any alphanumeric characters (a-z, A-Z, 0-9) and underscores (_), but cannot start with a number. You cannot declare a variable with the same name as a keyword, function or constant. Variables can be assigned values using an assignment operator, and can hold the following data types:
111 <ul>
112 <li>Integers: whole numbers that can be either positive, negative or zero. You can perform mathematical operations on integers using the mathematical operators.
113 <li>Decimals: real numbers that contain a decimal point, eg. <code>0.123</code>, <code>-3.5</code>, <code>7.0</code>. You can perform mathematical operations on decimals using the mathematical operators.
114 <li>Strings: any string of characters, eg. <code>"Hello"</code>, <code>'World!'</code>. As in the examples, strings must be enclosed within double or single quotes. Special characters may be included in strings by using an escape sequence. Strings can be added and multiplied using the addition and multiplication operators. One string may be checked for within another using the in operator.
115 </ul>
116 <p>Constants are variables that are pre-defined by BAIN and cannot have their values changed. You cannot create new constants.
117 <p>Comments are extra text ignored by the Wizard engine, to explain what the Wizard code does to other readers. Comments begin with a semicolon <code>;</code> and last until the end of the line.
118 <p>Expressions are evaluated using the standard order of operations, eg. <code>3 + 6 * 2</code> will evaluate to <code>15</code>.
119 <h4>Common Mistakes</h4>
120 <ul>
121 <li>Incorrect case. For example, make sure you're using <code>SelectSubPackage</code> and not <code>SeleCtsUbpacKage</code>.
122 <li>Mismatched quotes. Make sure that if you start a string with a double quote, you end it with a double quote, and similarly strings that start with a single quote should end with a single quote.
123 <li>Missing or extra backslashes at the end of a line. This causes an error or not all options to display.
124 <li>Extra spaces or tabs at the end of a line can cause issues with options showing up, eg. <code class="box">"","",""\ </code>
125 <li>Referencing images that don't exist. Make sure any images you try to display in the Wizard actually exist.
126 </ul>
127
128
129 <h3 id="wizards-functions">Functions</h3>
130 <p><dfn id="CompareObVersion">CompareObVersion</dfn> - Used to test the installed version of Oblivion against the one you specify. <strong>Deprecated</strong>. Use <a href="#wizardsCompareGameVersion">CompareGameVersion</a> instead.
131 <p><dfn id="wizardsCompareGameVersion">CompareGameVersion</dfn> - Used to test the installed version of the game Wrye Bash is running for against the version you specify.
132 <code class="box">CompareGameVersion(version_string)</code>
133 <ul>
134 <li><var>version_string</var> - A string formatted to hold a file version number, eg. <code>"1.2.0.416"</code>.
135 </ul>
136 <p class="indent">Return values:
137 <ul class="indent">
138 <li><code>-1</code> - Installed version is less than the version specified in <var>version_string</var>.
139 <li><code>0</code> - Installed version is equal to the version specified in <var>version_string</var>.
140 <li><code>1</code> - Installed version is greater than the version specified in <var>version_string</var>.
141 </ul>
142 <p><dfn id="wizardsCompareOBSEVersion">CompareOBSEVersion</dfn> - Used to test the installed version of OBSE against the one you specify. <strong>Deprecated</strong>. Use <a href="#wizardsCompareSEVersion">CompareSEVersion</a> instead.
143 <p><dfn id="wizardsCompareSEVersion">CompareSEVersion</dfn> - Used to test the installed version of the Script Extender of the game that Wrye Bash is running for against the one you specify.
144 <code class="box">CompareSEVersion(version_string)</code>
145 <ul>
146 <li><var>version_string</var> - A string formatted to hold a file version number, eg. <code>"0.0.20.1"</code>.
147 </ul>
148 <p class="indent">Return values:
149 <ul class="indent">
150 <li><code>-1</code> - Installed version is less than the version specified in <var>version_string</var>.
151 <li><code>0</code> - Installed version is equal to the version specified in <var>version_string</var>.
152 <li><code>1</code> - Installed version is greater than the version specified in <var>version_string</var>, or there is no Script Extender available for the game.
153 </ul>
154 <p><dfn id="wizardsCompareOBGEVersion">CompareOBGEVersion</dfn> - Used to test the installed version of OBGE against the one you specify. <strong>Deprecated</strong>. Use <a href="#wizardsCompareGEVersion">CompareGEVersion</a> instead.
155 <p><dfn id="wizardsCompareGEVersion">CompareGEVersion</dfn> - Used to test the installed version of the Graphics Extender of the game that Wrye Bash is running for against the one you specify.
156 <code class="box">CompareGEVersion(version_string)</code>
157 <ul>
158 <li><var>version_string</var> - A string formatted to hold a file version number, eg. <code>"0.0.20.1"</code>.
159 </ul>
160 <p class="indent">Return values:
161 <ul class="indent">
162 <li><code>-1</code> - Installed version is less than the version specified in <var>version_string</var>.
163 <li><code>0</code> - Installed version is equal to the version specified in <var>version_string</var>.
164 <li><code>1</code> - Installed version is greater than the version specified in <var>version_string</var>, or there is no Graphics Extender available for the game.
165 </ul>
166 <p><dfn>CompareWBVersion</dfn> - Used to test the installed version of Wrye Bash against the one you specify.
167 <code class="box">CompareWBVersion(version_string)</code>
168 <ul>
169 <li><var>version_string</var> - A string formatted to hold a file version number, eg. <code>"0.0.20.1"</code>.
170 </ul>
171 <p class="indent">Return values:
172 <ul class="indent">
173 <li><code>-1</code> - Installed version is less than the version specified in <var>version_string</var>.
174 <li><code>0</code> - Installed version is equal to the version specified in <var>version_string</var>.
175 <li><code>1</code> - Installed version is greater than the version specified in <var>version_string</var>.
176 </ul>
177 <p><dfn id="wizardsDataFileExists">DataFileExists</dfn> - Tests for the existence of a file in the Data directory. If the file you are testing for is an ESP or ESM, this will also detected ghosted versions of the file.
178 <code class="box">DataFileExists(file_name [, ..., file_name_n])</code>
179 <ul>
180 <li><var>file_name</var> - A string or variable holding a string, specifying the path relative to the Data directory to test. For example using "test.esp" would test for "<var>[path to game]</var>\Data\test.esp"
181 </ul>
182 <p class="indent">Return values:
183 <ul class="indent">
184 <li><code>True</code> - All of the files exist.
185 <li><code>False</code> - One or more of the files do not exist.
186 </ul>
187 <p><dfn id="wizardsGetEspmStatus">GetEspmStatus</dfn> - Tests the current status of an ESP or ESM in the Data directory. This function takes esp/m ghosting into account when testing the status.
188 <code class="box">GetEspmStatus(file_name)</code>
189 <ul>
190 <li><var>file_name</var> - A string or variable holding a string, specifying the path relative to the Data directory for the esp or esm to test.
191 </ul>
192 <p class="indent">Return values:
193 <ul class="indent">
194 <li><code>-1</code> - The esp/m does not exist.
195 <li><code>0</code> - The esp/m is not active, imported, or merged. Its checkbox in Wrye Bash's Mods tab is <img src="../bash/images/checkbox_green_off.png" alt="Inactive"/>.
196 <li><code>1</code> - The esp/m is not active, but has portions imported into the Bashed Patch. Its checkbox in Wrye Bash's Mods tab is <img src="../bash/images/checkbox_green_imp.png" alt="Imported"/>.
197 <li><code>2</code> - The esp/m is active. Its checkbox in Wrye Bash's Mods tab is <img src="../bash/images/checkbox_green_on.png" alt="Active"/>.
198 <li><code>3</code> - The esp/m is merged into the Bashed Patch. Its checkbox in Wrye Bash's Mods tab is <img src="../bash/images/checkbox_green_inc.png" alt="Merged"/>.
199 </ul>
200 <p><dfn id="wizardsEditINI">EditINI</dfn> - Tells Wrye Bash to create an ini tweak file with some tweaks in it. If the file that you tell Wrye Bash to apply the tweak to is from the current installer or is the game's ini file, then Wrye Bash will also automatically apply the tweak, otherwise, it will just be generated for the user to apply manually.
201 <code class="box">EditINI(file_name, section, setting, value [,comment])</code>
202 <ul>
203 <li><var>file_name</var> - The name of the ini file you wish to edit, relative to the Data directory.
204 <li><var>section</var> - The section in the ini where <var>setting</var> resides, or 'set' or 'setGS' (see examples below).
205 <li><var>setting</var> - The setting you wish to change.
206 <li><var>value</var> - The value to set the setting to.
207 <li><var>comment</var> - Optional comment to include with this tweak.
208 </ul>
209 <p><dfn id="wizardsExec">Exec</dfn> - This will cause the Wizard to execute lines that are passed to it. This is useful for creating dynamically generated menus.
210 <code class="box">Exec(lines)</code>
211 <ul>
212 <li><var>lines</var> - A string containing lines to execute, separated by newline characters, or a variable containing such a string. Any backslashes that are to be outputted must be written as triple backslashes. Eg. <code>\'</code> should be written <code>\\\'</code>.
213 </ul>
214 <p><dfn>str</dfn> - Used to convert a value into a string, for example when trying to concantenate a integer or decimal to a string.
215 <code class="box">str(value)</code>
216 <ul>
217 <li><var>value</var> - Any value. An integer, decimal, variable, constant or string.
218 </ul>
219 <p class="indent">Returns:
220 <ul class="indent">
221 <li>String representation of <var>value</var>. For example, <code>str(5)</code> would return <code>"5"</code>.
222 </ul>
223 <p><dfn>int</dfn> - Used to convert a value to an integer, for example converting a value held in a string to a integer value.
224 <code class="box">int(value)</code>
225 <ul>
226 <li><var>value</var> - Any value. An integer, decimal, variable, constant or string.
227 </ul>
228 <p class="indent">Returns:
229 <ul class="indent">
230 <li>Integer value of <var>value</var>, if possible. For example <code>int('65')</code> would return <code>65</code>.
231 <li><code>0</code> - If integer conversion is not possible.
232 </ul>
233 <p><dfn>float</dfn> - Used to convert a value to decimal, for example converting a value held in a string to a decimal value.
234 <code class="box">float(value)</code>
235 <ul>
236 <li><var>value</var> - Any value. An integer, decimal, variable, constant or string.
237 </ul>
238 <p class="indent">Return values:
239 <ul class="indent">
240 <li>Decimal value of <var>value</var>, if possible. For example <code>int('2.4')</code> would return <code>2.4</code>.
241 <li><code>0.0</code> - If decimal conversion is not possible.
242 </ul>
243 <p><dfn>len</dfn> - Used to find the length of a string.
244 <code class="box">len(string)</code>
245 <ul>
246 <li><var>string</var> - A string, variable, or constant.
247 </ul>
248 <p class="indent">Return values:
249 <ul class="indent">
250 <li>Length of the string if possible.
251 <li><code>0</code> - If length calculation was not possible.
252 </ul>
253 <p><dfn id="wizardsendswith">endswith</dfn> - Test what a string ends with.
254 <code class="box">endswith(string, ending_1 [, ..., ending_n])</code>
255 <ul>
256 <li><var>string</var> - A string, variable or constant.
257 <li><var>ending_1</var> through <var>ending_n</var> - A string, variable or constant.
258 </ul>
259 <p class="indent">Return values:
260 <ul class="indent">
261 <li><code>True</code> - If the string ends in any of the endings specified.
262 <li><code>False</code> - If the string does not end in any of the endings specified.
263 </ul>
264 <p><dfn id="wizardsstartswith">startswith</dfn> - Test what a string starts with.
265 <code class="box">startswith(string, prefix_1 [, ..., prefix_n])</code>
266 <ul>
267 <li><var>string</var> - A string, variable or constant.
268 <li><var>prefix_1</var> through <var>prefix_n</var> - A string, variable or constant.
269 </ul>
270 <p class="indent">Return values:
271 <ul class="indent">
272 <li><code>True</code> - If the string begin with any of the prefixes specified.
273 <li><code>False</code> - If the string does not begin with any of the prefixes specified.
274 </ul>
275 <p><dfn id="wizardslower">lower</dfn> - Convert a string to lower case.
276 <code class="box">lower(string)</code>
277 <ul>
278 <li><var>string</var> - A string or variable.
279 </ul>
280 <p class="indent">Return values:
281 <ul class="indent">
282 <li><var>string</var> converted to lowercase if possible.
283 <li>The original <var>string</var> if an error occurred.
284 </ul>
285 <p><dfn id="wizardsfind">find</dfn> - Return index of first occurrence of a substring.
286 <code class="box">find(string, substring [, start, stop])</code>
287 <ul>
288 <li><var>string</var> - A string or variable to search in.
289 <li><var>substring</var> - A string or variable to search for.
290 <li><var>start</var> - Index at which to start searching in <var>string</var>. If not specified, searching will start at the beginning of <var>string</var>.
291 <li><var>stop</var> - Index at which to stop searching. Optional. If not specified, searching will stop at the end of <var>string</var>.
292 </ul>
293 <p class="indent">Return values:
294 <ul class="indent">
295 <li>The index of the first occurrence of <var>substring</var> in <var>string</var>.
296 <li><code>-1</code> - If <var>substring</var> could not be found.
297 </ul>
298 <p><dfn id="wizardsrfind">rfind</dfn> - Return index of last occurrence of a substring.
299 <code class="box">rfind(string, substring [, start, stop])</code>
300 <ul>
301 <li><var>string</var> - A string or variable to search in.
302 <li><var>substring</var> - A string or variable to search for.
303 <li><var>start</var> - Index at which to start searching in <var>string</var>. If not specified, searching will start at the beginning of <var>string</var>.
304 <li><var>stop</var> - Index at which to stop searching. Optional. If not specified, searching will stop at the end of <var>string</var>.
305 </ul>
306 <p class="indent">Return values:
307 <ul class="indent">
308 <li>The index of the last occurrence of <var>substring</var> in <var>string</var>.
309 <li><code>-1</code> - If <var>substring</var> could not be found.
310 </ul>
311 <p><dfn id="wizardsGetFilename">GetFilename</dfn> - For a string that contains a path, returns the filename part of the string.
312 <code class="box">GetFilename(path_string)</code>
313 <ul>
314 <li><var>path_string</var> - A string or variable of the path to work with.
315 </ul>
316 <p class="indent">Return values:
317 <ul class="indent">
318 <li>The filename in <var>path_string</var>.
319 <li>An empty string, if <var>path_string</var> is not a path.
320 </ul>
321 <p><dfn id="wizardsGetFolder">GetFolder</dfn> - For a string that contains a path, returns the folder part of the string.
322 <code class="box">GetFolder(path_string)</code>
323 <ul>
324 <li><var>path_string</var> - A string or variable of the path to work with.
325 </ul>
326 <p class="indent">Return values:
327 <ul class="indent">
328 <li>The folder in <var>path_string</var>.
329 <li>An empty string if <var>path_string</var> does not contain a folder, or is not a path.
330 </ul>
331
332 <h3 id="wizards-keywords">Keywords</h3>
333 <p>Keywords are like functions, but don't require brackets around their arguments, and are used for controlling the flow of a wizard or performing special tasks.
334 <p><dfn id="wizardsSelectSubPackage">SelectSubPackage</dfn> - Cause the specified sub-package to be selected for installation. This is equivalent to checking the sub-package and all the esps or esms in that subpackage in the BAIN window.
335 <code class="box">SelectSubPackage name</code>
336 <ul>
337 <li><var>name</var> - A string or variable holding the name of the sub-package to select.
338 </ul>
339 <p><dfn>DeSelectSubPackage</dfn> - Cause the specified sub-package to be de-selected from installation. This is equivalent to un-checking the sub-package in the BAIN window.
340 <code class="box">DeSelectSubPackage name</code>
341 <ul>
342 <li><code>name</code> - A string or variable holding the name of the sub-package to de-select.
343 </ul>
344 <p><dfn>SelectEspm</dfn> - Cause the specified esp or esm to be selected for installation. This is equivalent to checking the esp or esm from the BAIN window.
345 <code class="box">SelectEspm name</code>
346 <ul>
347 <li><var>name</var> - A string or variable holding the name of the esp or esm to select.
348 </ul>
349 <p><dfn>DeSelectEspm</dfn> - Cause the specified esp or esm to be deselected from installation. This is equivalent to un-checking the esp or esm from the BAIN window.
350 <code class="box">DeSelectEspm name</code>
351 <ul>
352 <li><var>name</var> - A string or variable holding the name of the esp or esm to de-select.
353 </ul>
354 <p><dfn>SelectAll</dfn> - Cause all sub-packages, esps, and esms to be selected for installation. This is equivalent to first checking all sub-packages in the BAIN window, then checking all esps and esms in the BAIN window.
355 <code class="box">SelectAll</code>
356 <p><dfn>DeSelectAll</dfn> - Cause all sub-packages, esps, and esms to be de-selected from installation. This is equivalent to first un-checking all esps and esms in the BAIN window, then un-checking all sub-packages in the BAIN window.
357 <code class="box">DeSelectAll</code>
358 <p><dfn>SelectAllEspms</dfn> - Cause all esps and esms to be selected for installation. This is equivalent to checking all esps and esms in the BAIN window.
359 <code class="box">SelectAllEspms</code>
360 <p><dfn>DeSelectAllEspms</dfn> - Cause all esps and esms to be de-selected from installation. This is equivalent to un-checking all esps and esms in the BAIN window.
361 <code class="box">DeSelectAllEspms</code>
362 <p><dfn id="wizardsRenameEspm">RenameEspm</dfn> - Change the installed name of an esp or esm.
363 <code class="box">RenameEspm original_name, new_name</code>
364 <ul>
365 <li><var>original_name</var> - The name of the esp or esm, as it appears in the BAIN package.
366 <li><var>new_name</var> - The new name you want to have the esp or esm installed as.
367 </ul>
368 <p><dfn>ResetEspmName</dfn> - Resets the name of an esp or esm back to its default name.
369 <code class="box">ResetEspmName original_name</code>
370 <ul>
371 <li><var>original_name</var> - The name of the esp or esm, as it appears in the BAIN package.
372 </ul>
373 <p><dfn>ResetAllEspmNames</dfn> - Resets the names of all the esps and esms back to their default names.
374 <code class="box">ResetAllEspmNames</code>
375 <p><dfn>Note</dfn> - Add a note to the user to be displayed at the end of the wizard, on the finish page. The <code>'- '</code> will be added automatically.
376 <code class="box">Note text</code>
377 <ul>
378 <li><var>text</var> - A string, string variable, or expression that evaluates to a string, to be displayed on the finish page.
379 </ul>
380 <p><dfn id="wizardsReturn">Return</dfn> - Signals completion of the wizard. This will jump right to the finish page.
381 <code class="box">Return</code>
382 <p><dfn id="wizardsCancel">Cancel</dfn> - Cancels the wizard, with an optional text to display in a dialog as to why the wizard was canceled.
383 <code class="box">Cancel [text]</code>
384 <ul>
385 <li><var>text</var> - Optional. Text to display in a dialog as to why the wizard was canceled.
386 </ul>
387 <p><dfn id="wizardsRequireVersions">RequireVersions</dfn> - Tests the users system against version requirements you specify. If the requirements are not met, a warning dialog will be shown asking if you wish to continue anyway.
388 <code class="box">RequireVersions game_version [, se_version, ge_version, wrye_bash_version]</code>
389 <ul>
390 <li><var>game_version</var> - Version of the game to test for. See <a href="#wizardsCompareGameVersion">CompareGameVersion</a> for the proper format of the string.
391 <li><var>se_version</var> - Optional. Version of the Script Extender to test for. See <a href="#wizardsCompareSEVersion">CompareSEVersion</a> for the proper format of the string.
392 <li><var>ge_version</var> - Optional. Version of the Graphics Extender to test for. See <a href="#wizardsCompareGEVersion">CompareGEVersion</a> for the proper format of the string.
393 <li><var>wrye_bash_version</var> - Optional. Version of Wrye Bash to test for. See <a href="#wizardsCompareWBVersion">CompareWBVersion</a> for more info.
394 </ul>
395 <p><dfn>If-Elif-Else-EndIf</dfn> - A basic If control block.
396 <code class="box">If statement
397 lines
398 Elif statement
399 lines
400 Elif statement
401 lines
402 Else
403 lines
404 EndIf</code>
405 <ul>
406 <li><code>If</code> - Begins the control block.
407 <ul>
408 <li><var>statement</var> - If <var>statement</var> evaluates to <code>True</code>, then the lines following it will be run, until the next Elif, Else, or EndIf.
409 </ul>
410 <li><code>Elif</code>
411 <ul>
412 <li><var>statement</var> - If <var>statement</var> evaluates to <code>True</code>, and the initial <code>If</code> and none of the previous <code>Elif</code>s were <code>True</code>, then the lines following this <code>Elif</code> will be run, until the next <code>Elif</code>, <code>Else</code>, or <code>EndIf</code>.
413 </ul>
414 <li><code>Else</code> - If the initial <code>If</code> and none of the previous <code>Elif</code>s were <code>True</code>, then the lines following will be run until an <code>EndIf</code> is met.
415 <li><code>EndIf</code> - Signals the end of the <code>If</code> control block.
416 </ul>
417 <p><dfn>While-Continue-Break-EndWhile</dfn> - A while loop.
418 <code class="box">While statement
419 lines
420 Continue
421 lines
422 Break
423 lines
424 EndWhile</code>
425 <ul>
426 <li><code>While</code> - Begins the while loop.
427 <ul>
428 <li><var>statement</var> - If <var>statement</var> evaluates to <code>True</code>, execution of the lines begins, otherwise execution skips to after the <code>EndWhile</code>.
429 </ul>
430 <li><code>Continue</code> - Signals the while loop to begin over again at the <code>While</code> statement.
431 <li><code>Break</code> - Signals the while loop to end execution, skipping to after the <code>EndWhile</code>.
432 <li><code>EndWhile</code> - Ends the while loop. <var>statement</var> is re-evaluated, and if <code>True</code>, execution begins again at the start of the <code>While</code> block.
433 </ul>
434 <p><dfn id="wizardsForContinueBreakEndFor">For-Continue-Break-EndFor</dfn> - A For loop.
435 <code class="box">For <var>var</var> to <var>start_value</var> to <var>end_value</var> [by <var>increment_value</var>]
436 lines
437 Continue
438 lines
439 Break
440 lines
441 EndFor
442
443 For sub in SubPackages
444 For file in sub
445 lines
446 EndFor
447 EndFor</code>
448 <ul>
449 <li><code>For</code> - Begins the for loop. There are three types of for loop.
450 <ul>
451 <li><code><var>var</var> from <var>start_value</var> to <var>end_value</var> [by <var>increment_value</var>]</code>
452 <ul>
453 <li><var>var</var> - A variable that will hold values.
454 <li><var>start_value</var> - Initial value of <var>var</var>.
455 <li><var>end_value</var> - value of <var>var</var> that will end the for loop.
456 <li><var>increment_value</var> - Optional. This the value that will be added to <var>var</var> at the end of each run of the loop. Defaults to <code>1</code> if <var>start_value</var> is greater than <var>end_value</var> or <code>-1</code> otherwise.
457 </ul>
458 <li><code><var>sub</var> in SubPackages</code> - This type of for loop iterates over the names of the SubPackages in the current package.
459 <ul>
460 <li><var>sub</var> - A variable that holds the names of the SubPackages.
461 </ul>
462 <li><code><var>file</var> in <var>sub</var></code> - This type of for loop iterates over the names of the files in the given subpackage. Filenames are relative to the Data directory, before any remapping that would normally be done by BAIN.
463 <ul>
464 <li><var>file</var> - A variable that holds the filenames.
465 <li><var>sub</var> - The name of the subpackage to iterate through.
466 </ul>
467 </ul>
468 <li><code>Continue</code> - Signals the for loop to begin over again at the <code>For</code> statement.
469 <li><code>Break</code> - Signals the for loop to end execution, skipping to after the <code>EndFor</code>.
470 <li><code>EndFor</code> - Ends the for loop.
471 </ul>
472 <p><dfn id="wizardsSelectOne">SelectOne</dfn> - Shows a dialog where the user can select one option from a list of options.
473 <code class="box">SelectOne 'description', \
474 'option 1', 'description 1', 'image 1', \
475 'option 2', 'description 2', 'image 2', \
476 ..., \
477 'option n', 'description n', 'image n'
478 Case 'option 1'
479 lines
480 Break
481 Case 'option 2'
482 lines
483 Break
484
485 Case 'option n'
486 lines
487 Break
488 Default
489 lines
490 Break
491 EndSelect</code>
492 <ul>
493 <li><code>SelectOne</code> - After the user presses the "Next" button, this begins a Select control block.
494 <ul>
495 <li><var>description</var> - The text that will be displayed at the top of the dialog.
496 <li><var>option n</var> - The text of the specific option. If the text begins with a "|", this is considered the default option and will be selected by default.
497 <li><var>description n</var> - The description to display when <var>option n</var> is selected.
498 <li><var>image n</var> - The image to display when <var>option n</var> is selected. An empty string will make no image display.
499 </ul>
500 <li><code>Case <var>option</var></code> - The lines following the <code>Case</code> will be run if the user selected its corresponding option on the dialog, until a <code>Break</code> or <code>EndSelect</code> is met.
501 <ul>
502 <li><var>option</var> - The option that the <code>Case</code> corresponds to.
503 </ul>
504 <li><code>Default</code> - The lines following the <code>Default</code> will be run, until a <code>Break</code> or <code>EndSelect</code>, if none of the <code>Case</code> options have been run.
505 <li><code>Break</code> - Stops running lines in the current <code>Case</code> or <code>Default</code> block.
506 <li><code>EndSelect</code> - Signals the end of the Select control block.
507 </ul>
508 <p><dfn id="wizardsSelectMany">SelectMany</dfn> - Shows a dialog where the user can select multiple options from a list. After the user presses the "Next" button, this begins a Select control block. See SelectOne for usage.
509 <code class="box">SelectMany 'description', \
510 'option 1', 'description 1', 'image 1', \
511 'option 2', 'description 2', 'image 2', \
512 ..., \
513 'option n', 'description n', 'image n'
514 Case 'option 1'
515 lines
516 Break
517 Case 'option 2'
518 lines
519 Break
520
521 Case 'option n'
522 lines
523 Break
524 EndSelect</code>
525
526 <h3 id="wizards-operators">Operators</h3>
527 <h4>Assignment Operators</h4>
528 <p>Assignment operators are used to assign values to variables. Compound assignment operators are a combination of assignment operator and mathematical operator, performing the operation and assigning it to a variable in one step.
529 <p><dfn>Assignment</dfn>: <code>=</code>
530 <code class="box">variable = value</code>
531 <p><dfn>Compound Assignment</dfn>: <code>+=</code>, <code>-=</code>, <code>*=</code>, <code>/=</code>, <code>^=</code>
532 <code class="box">variable += value
533 variable -= value
534 variable *= value
535 variable /= value
536 variable ^= value
537 </code>
538 <h4>Mathematical Operators</h4>
539 <p>Mathematical operators allow you to add, subtract, multiply, divide and exponentiate integers and decimals. The addition and multiplication operators can also be used on strings.
540 <p><dfn>Addition</dfn>: <code>+</code>
541 <code class="box">var1 + var2</code>
542 <p><dfn>Subtraction</dfn>: <code>-</code>
543 <code class="box">var1 - var2</code>
544 <p><dfn>Multiplication</dfn>: <code>*</code>
545 <code class="box">var1 * var2</code>
546 <p><dfn>Division</dfn>: <code>/</code>
547 <code class="box">var1 / var2</code>
548 <p><dfn>Exponentiation</dfn>: <code>^</code>.
549 <code class="box">var1 ^ var2</code>
550 <h4>Boolean Operators</h4>
551 <p>Boolean operators can be used to test the logical truth of values.
552 <p><dfn>And</dfn>: <code>&amp;</code>, <code>and</code>. Returns <code>True</code> if both sides of the expression are true and <code>False</code> otherwise.
553 <code class="box">var1 & var2</code>
554 <code class="box">var1 and var2</code>
555 <p><dfn>Or</dfn>: <code>|</code>, <code>or</code>. Returns <code>True</code> if either side of the expression is true and <code>False</code> otherwise.
556 <code class="box">var1 | var2</code>
557 <code class="box">var1 or var2</code>
558 <p><dfn>Not</dfn>: <code>!</code>, <code>not</code>. Returns <code>True</code> if the expression is <code>False</code>, and <code>False</code> if the expression is <code>True</code>.
559 <code class="box">!value</code>
560 <code class="box">not value</code>
561 <p><dfn>In</dfn>: <code>in</code>. Returns <code>True</code> if the left hand side of the expression is contained in the right hand side, and <code>False</code> otherwise.
562 <code class="box">var1 in var2</code>
563 <h4>Comparison Operators</h4>
564 <p>Comparison operators are used to compare two values or variables with one another.
565 <p><dfn>Equal</dfn>: <code>==</code>. Returns <code>True</code> if the left hand side of the expression is equal to the right hand side of the expression, and <code>False</code> otherwise.
566 <code class="box">var1 == var2</code>
567 <p><dfn>Not Equal</dfn>: <code>!=</code>. Returns <code>True</code> if the left hand side of the expression is not equal to the right hand side of the expression, and <code>False</code> otherwise.
568 <code class="box">var1 != var2</code>
569 <p><dfn>Greater Than or Equal</dfn>: <code>&gt;=</code>. Returns <code>True</code> if the left hand side of the expression is greater than or equal to the right hand side of the expression, and <code>False</code> otherwise.
570 <code class="box">var1 &gt;= var2</code>
571 <p><dfn>Greater Than</dfn>: <code>&gt;</code>. Returns <code>True</code> if the left hand side of the expression is greater than the right hand side of the expression, and <code>False</code> otherwise.
572 <code class="box">var1 &gt; var2</code>
573 <p><dfn>Less Than or Equal</dfn>: <code>&lt;=</code>. Returns <code>True</code> if the left hand side of the expression is less than or equal to the right hand side of the expression, and <code>False</code> otherwise.
574 <code class="box">var1 &lt;= var2</code>
575 <p><dfn>Less Than</dfn>: <code>&lt;</code>. Returns <code>True</code> if the left hand side of the expression is less than the right hand side of the expression, and <code>False</code> otherwise.
576 <code class="box">var1 &lt; var2</code>
577 <h4 id="wizards-operators-ci">Case Insensitive Operators</h4>
578 <p>Some of the operators have case insensitive versions, which function in the same way as their normal versions, but when comparing strings they ignore case. Case insensitive versions of operators end with a colon <code>:</code>. The following case insensitive operators are available:
579 <ul>
580 <li><code>==:</code>
581 <li><code>!=:</code>
582 <li><code>&gt;=:</code>
583 <li><code>&gt;:</code>
584 <li><code>&lt;=:</code>
585 <li><code>&lt;:</code>
586 <li><code>in:</code>
587 </ul>
588 <h4 id="wizards-operators-dot">Dot Operator</h4>
589 <p>The dot operator can be used to call a function on a variable without having to specify the variable in the function's arguments. This functionality will be familiar to anyone with experience in Object-Orientated programming. The syntax is:
590 <code class="box">variable.function</code>
591 <p>The following functions can be used with the dot operator:
592 <ul>
593 <li><code>len</code>
594 <li><code>endswith</code>
595 <li><code>startswith</code>
596 <li><code>lower</code>
597 <li><code>find</code>
598 <li><code>rfind</code>
599 </ul>
600 <h4>Indexing</h4>
601 <p>Indexing is used to access a specific location in a sequence. Currently only strings and string variables can be indexed. The syntax used is similar to Python's indexing syntax.
602 <code class="box">string[start:stop:step]</code>
603 <p>Arguments:
604 <ul>
605 <li><var>start</var>: The index to start at. The first item in a sequence has an index of 0. If not specified, indexing will begin at 0.
606 <li><var>stop</var>: The index to stop at. If not specified but a colon <code>:</code> is supplied, indexing will continue to the end of the sequence. If not specified and no colon is supplied, only one character will be indexed.
607 <li><var>step</var>: How much to increment by when indexing. For example, a value of <code>2</code> would return every second item in the sequence. If not specified, a value of <code>1</code> will be used.
608 </ul>
609 <p>Negative values for <var>start</var> and <var>stop</var> will be relative to the end of the sequence. For example, <code>-1</code> would mean the first character from the end of the sequence.
610 <p>Examples:
611 <code class="box">"Hello"[0] ;returns "H"
612 "Hello"[0:] ;returns "Hello"
613 "Hello"[:] ;returns "Hello"
614 "Hello"[0:2] ;returns "He"
615 "Hello"[-1] ;returns "o"
616 "Hello"[1:3] ;returns "el"
617 "Hello"[-2:] ;returns "lo"
618 </code>
619
620 <h3 id="wizards-constants">Standard Constants</h3>
621 <p>Only two constants are defined in BAIN Wizards.
622 <p><dfn>True</dfn> - <code>True</code>. Equal to boolean <code>true</code> (text representation) or <code>1</code> (binary representation).
623 <p><dfn>False</dfn> - <code>False</code>. Equal to boolean <code>false</code> (text representation) or <code>0</code> (binary representation).
624
625 <h3 id="wizards-escape">Escape Sequences</h3>
626 <p>Escape sequences are special sequences of characters you can use to get a different character outputted. The escape sequences allowed are:
627 <ul>
628 <li><code>\"</code>: Outputs a double quote character <code>"</code>. This allows you to put quotes in a string without causing the Wizard engine to think it's reached the end of the string.
629 <li><code>\'</code>: Outputs a single quote character <code>'</code>. This allows you to put quotes in a string without causing the Wizard engine to think it's reached the end of the string.
630 <li><code>\t</code>: Outputs a tab.
631 <li><code>\n</code>: Outputs a new line.
632 <li><code>\\</code>: Outputs a backslash <code>\</code>.
633 </ul>
634
635 <h3 id="wizards-examples">Examples</h3>
636 <h4>Wizards In The Wild</h4>
637 <p>The following mods have Wizard scripts that may be useful references: <a href="http://oblivion.nexusmods.com/mods/19628">Animated Window Lighting System and Chimneys - AWLS</a>, <a href="http://oblivion.nexusmods.com/mods/31062">Bain Conversion Files</a>, <a href="http://oblivion.nexusmods.com/mods/16513">Bananasplit Better Cities</a>, <a href="http://oblivion.nexusmods.com/mods/36005">Fast and Easy Frans WIZBAIN Archive Maker -ENGLISH ONLY-</a>, <a href="http://oblivion.nexusmods.com/mods/35856">Metallicow Cursor Mod</a>, <a href="http://oblivion.nexusmods.com/mods/19370">Unique Landscapes Compilation</a>, <a href="http://oblivion.nexusmods.com/mods/18305">Weather - All Natural</a>.
638 <h4>Create A Package Overview</h4>
639 <p>Every Wizard should have a short overview for the user to read before proceeding with the actual installation questions. Notice how in the example below there are no <code>Case</code> statements used and the default character <code>|</code> is before the <code>Start Here_Readme</code>.
640 <code class="box">SelectOne "Welcome to the ExampleMod's mod Setup Wizard", \
641 "|Start Here_Readme", "If this is the first time you install this mod it's recommended that you carefully read the rest of the selections readme's to have an idea of what the optional parts of this mod do.", "", \
642 "ExampleMod Overview", "ExampleText bla bla bla \n\nBla Bla Bla \n\n Bla Bla\n Bla", "", \
643 "Changelog", "Example Fixes Release 1.01 \nExample Full Public 1.0 Release \nExample 2nd Beta Release 0.91 \n0.9 - Example Beta Release \n0.3 - Example Alpha Release \n0.01 - Example Initial Release", "", \
644 "Guidelines for a Example install", "", "", \
645 "ExampleMod Screenshots", "", "Screenshots\\ExampleScreenshot.jpg", \
646 "Credits\\Authors", "Wrye - For BAIN. Woooooooot! \nLojack - For the wonderful BAIN wizard installer feature. \nMetallicow - For chewing the cud.", "", \
647 "Language", "Language or Nationality this BAIN wizard was written in. \n\n English (USA)", "Wizard Images\\EnglishUSA.jpg"
648 EndSelect
649 </code>
650 <h4>Yes/No Question</h4>
651 <p>Useful for when you want to ask the user a yes/no question. <code>SelectOne</code> and <code>SelectSubPackage</code> in the example below could be replaced by another keyword.
652 <code class="box">SelectOne "Example: Yes/No Question?", \
653 "Yes", "Description", "Wizard Images\\Yes.jpg", \
654 "No", "Description", "Wizard Images\\No.jpg"
655 Case "Yes"
656 SelectSubPackage "00 Example Subpackage" ;;;Action/No Action
657 Break
658 Case "No"
659 ;No Plugin ;;Action/No Action
660 Break
661 EndSelect
662 </code>
663 <h4>Check For A Plugin</h4>
664 <p>Lets say that you want to check the users data folder for a specific plugin, to check if a patch (you might have created) should apply.
665 <code class="box">If DataFileExists("ExamplePlugin.esp")
666 Note "ExamplePlugin Detected." ;;;Action/No Action
667 SelectEspm "PatchPlugin.esp" ;;;Action/No Action
668 Else ; ExamplePlugin.esp wasn't detected
669 ;No Plugin ;;;Action/No Action
670 EndIf
671 </code>
672 <h4>Use New BAIN Wizard Features Safely</h4>
673 <p>Useful for when you use features available only in recent versions of Wrye Bash but want to retain support for users with older versions.
674 <code class="box">If CompareWBVersion('292') >= 0
675 ; User is running 292+
676 ; Do some 292+ only stuff here, like...
677 EditINI('Oblivion.ini', 'Display', 'bAllowScreenShot', 1)
678 Else
679 ; User is running &lt; 292, so EditINI is unavailable.
680 Note "Don't forget to enable screenshots in Oblivion.ini"
681 EndIf
682 </code>
683 <h4>Misc. Function Examples</h4>
684 <p>These:
685 <code class="box">EditINI('TargetINI.ini', 'set', 'ANVars.UseEW', 1)
686 EditINI('TargetINI.ini', 'setGS', 'fPCBaseMagickaMult', 1)
687 </code>
688 <p>Would create Ini Tweaks:
689 <code class="box">set ANVars.UseEW to 1
690 setGS fPCBaseMagickaMult 1
691 </code>
692 <p>This:
693 <code class="box">GetFilename("C:\Program Files\Bethesda Softworks\Oblivion\Oblivion.exe")</code>
694 <p>Would return <code>"Oblivion.exe"</code>. This:
695 <code class="box">GetFilename("C:\Program Files\Bethesda Softworks\Oblivion")</code>
696 <p>Would return an empty string.
697 <p>This:
698 <code class="box">GetFolder("Data\mine.esp")</code>
699 <p>Would return <code>"Data"</code>. This:
700 <code class="box">GetFolder("mine.esp")</code>
701 <p>Would return an empty string.
702
703 <h3 id="wizards-obmm">Wizards vs. OBMM Scripts</h3>
704 <p>This section compares the functions and keywords available in Wizards against those available in OBMM scripts.
705 <h4>Functionality with direct correlation between OBMM scripts and Wizards</h4>
706 <table>
707 <thead><tr><th>OBMM Script<th>Wizards
708 <tbody>
709 <tr><td><code class="box">If &lt;function&gt; [...]
710 IfNot &lt;function&gt; [...]</code>
711 <td><code class="box">If statement
712 If not statement</code>
713 <tr><td><code class="box">Else
714 EndIf</code>
715 <td><code class="box">Elif
716 Else
717 EndIf</code>
718 <tr><td><code class="box">If DialogYesNo &lt;Message&gt; [Title]</code>
719 <td><code class="box">SelectOne message, "Yes", yes_description, yes_image, "No", no_description, no_image
720 Case "Yes"
721 statements
722 Break
723 Case "NO"
724 statements
725 Break
726 EndSelect</code>
727 <tr><td><code class="box">If DataFileExists &lt;FileName&gt;</code>
728 <td><code class="box">If DataFileExists(filename)</code>
729 <tr><td><code class="box">If ScriptExtenderPresent</code>
730 <td><code class="box">If CompareSEVersion("0.0.0.0") == 1</code>
731 <tr><td><code class="box">If ScriptExtenderNewerThan &lt;version&gt;</code>
732 <td><code class="box">If CompareSEVersion(version) == 1</code>
733 <tr><td><code class="box">If GraphicsExtenderPresent</code>
734 <td><code class="box">If CompareGEVersion("0.0.0.0") == 1</code>
735 <tr><td><code class="box">If GraphicsExtenderNewerThan &lt;version&gt;</code>
736 <td><code class="box">If CompareGEVersion(version) == 1</code>
737 <tr><td><code class="box">If OblivionNewerThan &lt;version&gt;</code>
738 <td><code class="box">If CompareGameVersion(version) == 1</code>
739 <tr><td><code class="box">If Equal &lt;arg1&gt; &lt;arg2&gt;
740 If GreaterThan &lt;arg1&gt; &lt;arg2&gt;
741 If GreaterEqual &lt;arg1&gt; &lt;arg2&gt;
742 If fGreaterThan &lt;arg1&gt; &lt;arg2&gt;
743 If fGreaterEqual &lt;arg1&gt; &lt;arg2&gt;</code>
744 <td><code class="box">If statement == statement
745 If statement > statement
746 If statement >= statement
747 If statement > statement
748 If statement >= statement</code>
749 <tr><td><code class="box">Select &lt;Title&gt; &lt;Option1&gt; [Option2] [...]
750 SelectWithPreview &lt;Title&gt; &lt;Option1&gt; &lt;ImagePath1&gt; [Option2] [ImagePath2] [...]
751 SelectWithDescriptions &lt;Title&gt; &lt;Option1&gt; &lt;Description1&gt; [Option2] [Description2] [...]
752 SelectWithDescriptionsAndPreviews &lt;Title&gt; &lt;Option1&gt; &lt;ImagePath1&gt; &lt;Description1&gt; [Option2] [ImagePath2] [Description2] [...]</code>
753 <td><code class="box">SelectOne title, option1, description1, image1, option2, description2, image2 [...]</code>
754 <tr><td><code class="box">SelectMany &lt;Title&gt; &lt;Option1&gt; [Option2] [...]
755 SelectManyWithPreview &lt;Title&gt; &lt;Option1&gt; &lt;ImagePath1&gt; [Option2] [ImagePath2] [...]
756 SelectManyWithDescriptions &lt;Title&gt; &lt;Option1&gt; &lt;Description1&gt; [Option2] [Description2] [...]
757 SelectManyWithDescriptionsAndPreviews &lt;Title&gt; &lt;Option1&gt; &lt;ImagePath1&gt; &lt;Description1&gt; [Option2] [ImagePath2] [Description2] [...]</code>
758 <td><code class="box">SelectMany title, option1, description1, image1 [...]</code>
759 <tr><td><code class="box">Case &lt;option&gt;
760 Default
761 Break
762 EndSelect</code>
763 <td><code class="box">Case option
764 Default
765 Break
766 EndSelect</code>
767 <tr><td><code class="box">For Count &lt;Variable&gt; &lt;Start&gt; &lt;End&gt; [Step]
768 Continue
769 Exit
770 EndFor</code>
771 <td><code class="box">For variable from start to end by step
772 Continue
773 Break
774 EndFor</code>
775 <tr><td><code class="box">Return</code>
776 <td><code class="box">Return</code>
777 <tr><td><code class="box">DontInstallPlugin &lt;Plugin&gt;
778 InstallPlugin &lt;Plugin&gt;</code>
779 <td><code class="box">DeSelectEspm plugin
780 SelectEspm plugin</code>
781 <tr><td><code class="box">CopyPlugin &lt;CopyFrom&gt; &lt;CopyTo&gt;</code>
782 <td><code class="box">RenameEspm original_name new_name</code>
783 <tr><td><code class="box">EditINI &lt;section&gt; &lt;key&gt; &lt;value&gt;</code>
784 <td><code class="box">EditINI("Oblivion.ini", section, setting, value)</code>
785 <tr><td><code class="box">FatalError</code>
786 <td><code class="box">Cancel [message]</code>
787 <tr><td><code class="box">SetVar &lt;Variable&gt; &lt;Value&gt;</code>
788 <td><code class="box">variable = value</code>
789 <tr><td><code class="box">StringLength &lt;Variable&gt; &lt;String&gt;</code>
790 <td><code class="box">variable = len(string)
791 variable = string.len()</code>
792 <tr><td><code class="box">iSet &lt;Variable&gt; &lt;expression&gt;
793 fSet &lt;Variable&gt; &lt;expression&gt;</code>
794 <td><code class="box">variable = expression</code>
795 <tr><td><code class="box">ExecLines &lt;lines&gt;</code>
796 <td><code class="box">Exec(lines)</code>
797 <tr><td><code class="box">SubString &lt;Variable&gt; &lt;String&gt; &lt;startfrom&gt; [length]</code>
798 <td><code class="box">find(variable, string, start, stop)
799 variable.find(string, start, stop)</code>
800 </table>
801 <h4>Functions in OBMM with equivalent methods in Wizards</h4>
802 <table>
803 <thead><tr><th>OBMM Script<th>Wizards
804 <tbody>
805 <tr><td><code class="box">If VersionGreaterThan &lt;version&gt;
806 If VersionLessThan &lt;version&gt;</code>
807 <td>Use <code>CompareWBVersion</code> to check the Wrye Bash version.
808 <tr><td><code class="box">Message &lt;Message&gt; [Title]
809 DisplayImage &lt;Image File Path&gt; [Title]
810 DisplayText &lt;Text File Path&gt; [Title]</code>
811 <td>Similar functionality can be reproduced using <code>Note</code> and <code>SelectOne</code> or <code>SelectMany</code> keywords.
812 <tr><td><code class="box">ConflictWith &lt;ModName&gt; [Comment] [Level]
813 DependsOn &lt;ModName&gt; [Comment] [Level]</code>
814 <td>Similar functionality can be reproduced using <code>If DataFileExists(modname)</code>.
815 <tr><td><code class="box">DontInstallDataFile &lt;FileName&gt;
816 InstallDataFile &lt;FileName&gt;
817 DontInstallDataFolder &lt;FolderName&gt; [RecurseSubfolders]
818 InstallDataFolder &lt;FolderName&gt; [RecurseSubfolders]
819 CopyDataFile &lt;CopyFrom&gt; &lt;CopyTo&gt;
820 CopyDataFolder &lt;CopyFrom&gt; &lt;CopyTo&gt; [RecurseSubfolders]</code>
821 <td>Similar functionality can be obtained by packaging the mod differently, and then using <code>SelectSubPackage</code> and <code>DeSelectSubPackage</code>.
822 <tr><td><code class="box">For Each DataFolder &lt;Variable&gt; &lt;FolderPath&gt; [RecurseSubFolders] [SearchString]
823 For Each DataFile &lt;Variable&gt; &lt;FolderPath&gt; [RecurseSubFolders] [SearchString]
824 For Each PluginFolder &lt;Variable&gt; &lt;FolderPath&gt; [RecurseSubFolders] [SearchString]
825 For Each Plugin &lt;Variable&gt; &lt;FolderPath&gt; [RecurseSubFolders] [SearchString]</code>
826 <td>Use:
827 <code class="box">For subpackage in SubPackages</code>
828 <p>and/or:
829 <code class="box">For file in subpackage</code>
830 <p>to iterate over files and folders in an installer. Then use:
831 <code class="box">file.lower().endswith(".esp")
832 GetFilename(file)
833 GetFolder(file)</code>
834 <p>and other string manipulation functions to test file names and folders.
835 </table>
836 <h4>Functions in OBMM without equivalent methods in Wizards</h4>
837 <code class="box">SelectVar &lt;Variable&gt;
838 SelectString &lt;Variable&gt;
839 Goto &lt;label&gt;
840 Label &lt;label&gt;
841 LoadBefore &lt;Plugin1&gt; &lt;Plugin2&gt;
842 LoadAfter &lt;Plugin1&gt; &lt;Plugin2&gt;
843 UncheckESP &lt;plugin&gt;
844 SetDeactivationWarning &lt;plugin&gt; &lt;warning&gt;
845 ConflictsWith &lt;ModName&gt; &lt;MinMajorVersion&gt; &lt;MinMinorVersion&gt;&lt;MaxMajorVersion&gt; &lt;MaxMinorVersion&gt; [Comment] [Level]
846 ConflictsWithRegex &lt;ModName&gt; [Comment] [Level]
847 ConflictsWithRegex &lt;ModName&gt; &lt;MinMajorVersion&gt; &lt;MinMinorVersion&gt;&lt;MaxMajorVersion&gt; &lt;MaxMinorVersion&gt; [Comment] [Level]
848 DependsOn &lt;ModName&gt; &lt;MinMajorVersion&gt; &lt;MinMinorVersion&gt;&lt;MaxMajorVersion&gt; &lt;MaxMinorVersion&gt; [Comment] [Level]
849 DependsOnRegex &lt;ModName&gt; [Comment] [Level]
850 DependsOnRegex &lt;ModName&gt; &lt;MinMajorVersion&gt; &lt;MinMinorVersion&gt;&lt;MaxMajorVersion&gt; &lt;MaxMinorVersion&gt; [Comment] [Level]
851 RegisterBSA &lt;FileName&gt;
852 UnregisterBSA &lt;FileName&gt;
853 EditShader &lt;ShaderPackage&gt; &lt;ShaderName&gt; &lt;BinaryObjectPath&gt;
854 SetGMST &lt;file&gt; &lt;Editor ID&gt; &lt;new value&gt;
855 SetGlobal &lt;file&gt; &lt;Editor ID&gt; &lt;new value&gt;
856 SetPluginByte &lt;file&gt; &lt;offset&gt; &lt;new value&gt;
857 SetPluginByte &lt;file&gt; &lt;offset&gt; &lt;new value&gt;
858 SetPluginShort &lt;file&gt; &lt;offset&gt; &lt;new value&gt;
859 SetPluginLong &lt;file&gt; &lt;offset&gt; &lt;new value&gt;
860 SetPluginFloat &lt;file&gt; &lt;offset&gt; &lt;new value&gt;
861 GetFolderName &lt;Variable&gt; &lt;path&gt;
862 GetFileName &lt;Variable&gt; &lt;path&gt;
863 GetFileNameWithoutExtension &lt;Variable&gt; &lt;path&gt;
864 CombinePaths &lt;Variable&gt; &lt;path1&gt; &lt;path2&gt;
865 RemoveString &lt;Variable&gt; &lt;String&gt; &lt;startfrom&gt; [length]
866 InputString &lt;Variable&gt; [Title] [Initial]
867 ReadINI &lt;Variable&gt; &lt;section&gt; &lt;value&gt;
868 ReadRenderInfo &lt;Variable&gt; &lt;value&gt;
869 EditXMLLine &lt;file&gt; &lt;line number&gt; &lt;new line&gt;
870 EditXMLReplace &lt;file&gt; &lt;text to find&gt; &lt;text to replace&gt;
871 </code>
872 <h4>Functions in Wizards without equivalent methods in OBMM</h4>
873 <code class="box">CompareWBVersion(version)
874 GetEspmStatus(plugin)
875 str(value)
876 int(value)
877 float(value)
878 SelectAll
879 DeSelectAll
880 SelectAllEspms
881 DeSelectAllEspms
882 While expression
883 Continue
884 Break
885 EndWhile
886 RequireVersions oblivion, obse, obge, wrye_bash
887 </code>
888 <h4>Functions in OBMM that are meaningless in Wrye Bash</h4>
889 <table>
890 <thead><tr><th>OBMM Script<th>Wizards
891 <tbody>
892 <tr><td><code class="box">PatchDataFile &lt;NewFile&gt; &lt;FileToPatch&gt; [Create]
893 PatchPlugin &lt;NewFile&gt; &lt;FileToPatch&gt; [Create]</code>
894 <td>Unnecessary due to BAIN's conflict resolution abilities.
895 <tr><td><code class="box">AllowRunOnLines</code><td>Wizards support run-on lines as standard.
896 </table>
897
898 <h2 id="rulesets">Mod Checker Rulesets</h2>
899 <h3 id="rulesets-overview">Overview</h3>
900 <p>Rulesets allow the expansion of Wrye Bash's Mod Checker to analyse active load orders based on additional rules. There can be any number of ruleset files, which must be plain text files located in <code><var>[Game]</var>\Data\Bash Patches</code>, with filenames ending in <code>Rules.txt</code>, for Wrye Bash to recognise them.
901 <p>Rulesets are processed in alphabetical order of their filenames. A ruleset's output is given in the following order:
902 <ol>
903 <li>A header containing the ruleset name, and any supplied header text.
904 <li>Warnings for any rules violated.
905 <li>ModSet reports, in the order that they are defined in the ruleset. These consist of:
906 <ol>
907 <li>A configuration recap.
908 <li>Any suggestions made.
909 <li>Any include, exclude or merge only warnings generated.
910 </ol>
911 </ol>
912
913 <h3 id="rulesets-syntax">Syntax</h3>
914 <h4>Comments</h4>
915 <p>Any text beginning with <code>##</code> will be ignored when the ruleset is processed, so can be used for making silent comments.
916 <code class="box ruleset">xxx ## [comment]</code>
917 <h4>Header</h4>
918 <p>The header command can be used to define what text is displayed in the header of the ruleset's output.
919 <code class="box ruleset">&gt;&gt; HEADER [text]
920
921 ## A bulleted list:
922 * [text]
923 * [text]
924 * [text]
925 </code>
926 <h4>NOTES</h4>
927 <p>The <code>NOTES</code> command lets you output notes to the Mod Checker report. The possible formatting options are given in the formatting sub-section below. Notes can be multiline.
928 <h4>ONLYONE</h4>
929 <p>The <code>ONLYONE</code> command is a simple rule that states that only one of the rules following it may be active at any one time.
930 <code class="box ruleset">&gt;&gt; ONLYONE
931 Cobl Races.esp
932 Cobl Races - Balanced.esp
933 </code>
934 <h4>IF</h4>
935 <p>The <code>IF</code> command is used to specify that the <code>NOTES</code>, <code>CONFIG</code>, <code>SUGGEST</code> and <code>WARN</code> commands following it are conditional on the existence of the plugin(s) specified as part of the <code>IF</code> command. The effect of an <code>IF</code> command lasts until the next <code>IF</code> command or the end of the file, whichever comes first.
936 <p>If the <code>IF</code> command lists more than one plugin, then the condition statement is a logical AND combination of all listed plugins. You can also specify logical OR and NOT combinations.
937 <ul>
938 <li><code>|</code>: This is the symbol for an OR combination of the previous plugin and the following plugin.
939 <li><code>-</code>: This is the symbol for a NOT combination of the following plugin.
940 </ul>
941 <p>To specify that none of a set of plugins may exist, use a NOT for the first plugin of the set, then OR combine the it with the rest.
942 <code class="box ruleset">&gt;&gt; IF Alpha.esp
943 Beta.esp
944 | Gamma.esp
945 | Delta.esp
946 - Epsilon.esp
947 - Zeta.esp
948 | Eta.esp
949 Theta.esp
950 </code>
951 <p>The above equates to Alpha AND (Beta or Gamma or Delta) AND NOT(Epsilon) AND NOT(Zeta or Eta) AND Theta.</p>
952 <h4>CONFIG</h4>
953 <p>The <code>CONFIG</code> command lets you specify check the status of a plugin or plugins and output its/their status (active/inactive/merged) and a comment. It is intended as a way of reminding the user what plugins they have active.
954 <code class="box ruleset">&gt;&gt; CONFIG
955 o Plugin1.esp //[comment]
956 o Plugin2.esp //[comment]
957 </code>
958 <p>The <code>o</code> symbol denotes an <q>Option</q> rule type.
959 <h4>SUGGEST</h4>
960 <p>The <code>SUGGEST</code> command is intended as a way of providing non-critical suggestions. Its syntax is similar to that of the <code>CONFIG</code> command, but it has different rule types available for usage. The rule types are:
961 <ul>
962 <li><code>x</code>: <q>Inclusion</q> rule type. The specified plugin must be active. If the plugin is not active, the Mod Checker will output a message.
963 <li><code>-</code>: <q>Exclusion</q> rule type. The specified plugin must <b>not</b> be active. If the plugin is active, the Mod Checker will output a message.
964 <li><code>+</code>: <q>Merge Only</q> rule type. The specified plugin must be merged but <b>not</b> active. If the plugin is active or inactive and not merged, the Mod Checker will output a message.
965 <li><code>e</code>: <q>Existence</q> rule type. The specified file must exist. The file can be any file type, with the file path being given relative to the Data folder. If the file does not exist, the Mod Checker will output a message.
966 </ul>
967 <code class="box ruleset">&gt;&gt; SUGGEST
968 x Plugin1.esp //[comment]
969 - Plugin2.esp //[comment]
970 + Plugin3.esp //[comment]
971 e Plugin4.esp //[comment]
972 </code>
973 <h4>WARN</h4>
974 <p>The <code>WARN</code> command is intended as a way of providing critical suggestions. It shares the same rule types as the <code>SUGGEST</code> command.
975 <code class="box ruleset">&gt;&gt; WARN
976 x Plugin1.esp //[comment]
977 - Plugin2.esp //[comment]
978 + Plugin3.esp //[comment]
979 e Plugin4.esp //[comment]
980 </code>
981 <h4>ASSUME</h4>
982 <p>The <code>ASSUME</code> command inserts the assumption that the given plugin exists into any <code>IF</code> statements following the command.
983 <ul>
984 <li><code>ASSUME</code> commands last until the next <code>ASSUME</code> command or until the end of the file, whichever occurs first.
985 <li><code>ASSUME</code> commands are <b>not</b> additive: each <code>ASSUME</code> command completely replaces the previous one.
986 <li>To cancel the effect of an <code>ASSUME</code> command, use an <code>ASSUME</code> command with no mod listed for it.
987 <li>To assume the existence of multiple plugins, list them on separate lines after the <code>ASSUME</code> command, like how is done for the <code>IF</code> command.
988 </ul>
989 <code class="box ruleset">&gt;&gt; ASSUME Master.esm
990 Plugin1.esp
991 Plugin2.esp
992 </code>
993 <h4>Formatting</h4>
994 <p>Non-silent comment lines have a few formatting options:
995 <ul>
996 <li><code>__[bold text]__</code>
997 <li><code>~~[italic text]~~</code>
998 <li><code>**[bold italic text]**</code>
999 <li><code>[[http://example.com|Link to example.com]]</code>
1000 </ul>
1001 <h3 id="rulesets-example">Example</h3>
1002 <p>The example ruleset below is a simple ruleset for Cobl.
1003 <code class="box ruleset">&gt;&gt; HEADER This ruleset covers Cobl (Common Oblivion) and related mods.
1004
1005 &gt;&gt; ONLYONE
1006 Cobl Races - Balanced.esp
1007 bgBalancingEVCore.esp
1008
1009 &gt;&gt; IF Cobl Main.esm
1010 &gt;&gt; CONFIG
1011 o Cobl Glue.esp // Glues Cobl items into vanilla lists, cells
1012 o Cobl Si.esp // Glues Cobl items into Shivering Isles cells.
1013 o Cobl Tweaks.esp // Adds Cobl items to creatures and NPCs.
1014 o Cobl Races.esp // Additional races, hairs, eyes.
1015 o Cobl Races - Balanced.esp // Races and birthsigns given better balanced pros and cons.
1016 o Salmo the Baker, Cobl.esp // Enhances Salmo the Baker in Skingrad.
1017 o Cobl Filter Late.esp // Adds foods from various mods to the Dinner Plate. (Requires OBSE.)
1018 &gt;&gt; SUGGEST
1019 - Denock Arrows.esp // **Deactivate** and use Cobl Denock instead. (See Options menu.)
1020 ## HOMES
1021 - AlchemistsCave.esp // Use [[http://planetelderscrolls.gamespy.com/View.php?view=OblivionMods.Detail&amp;id=3996|Coblized version]] instead.
1022 - Jagnot-SI-Bliss Aquaduct House.esp // Use [[http://ljosa.proboards57.com/index.cgi?board=releases&amp;action=display&amp;thread=548|Coblized version]] instead.
1023 - PrincessImperialCityApartment.esp // Use [[http://planetelderscrolls.gamespy.com/View.php?view=OblivionMods.Detail&amp;id=3997|Coblized version]] instead.
1024 - PrisonersCampsite.esp // Use [[http://planetelderscrolls.gamespy.com/View.php?view=OblivionMods.Detail&amp;id=4106|Coblized version]] instead.
1025 - SkyShip.esp // Use [[http://ljosa.proboards57.com/index.cgi?board=releases&amp;action=display&amp;thread=548|Coblized version]] instead.
1026 &gt;&gt; WARN
1027 ## Required
1028 e meshes\Cobl\StaticApp\apparatusalembics.nif // __Missing meshes [StaticApp].__ Try reinstalling full Cobl package (including all textures/meshes).
1029 ## Obsolete components
1030 - Cobl Glue MW Ingred.esp // **Deactivate.** Obsolete. (Merged into Cobl Glue.esp.)
1031 ## Superceded mods.
1032 - Beer! for Oblivion.esp [1.2.3:]-- **Deactivate.** Included in Cobl Main.esm.
1033 - DaggerfallBooks.esp // **Deactivate.** Included in Cobl Main.esm.
1034 - FirstEditionGuidetotheEmpire.esp // **Deactivate.** Included in Cobl Main.esm.
1035 - Ingredient Storage Shelves.esp // **Deactivate.** Included in Cobl Glue.esp
1036 - MorrowindBooks.esp // **Deactivate.** Included in Cobl Main.esm.
1037 - Salmo the Baker v2.0.esp // **Deactivate** Use Salmo the Baker, Cobl instead.
1038 - Tamrielic_Ingredients.esm // **Deactivate.** Included in Cobl Main.esm.
1039 - Tamrielic_Ingredients.esp // **Deactivate.** Included in Cobl Main.esm.
1040
1041 &gt;&gt; ASSUME Cobl Main.esm
1042
1043 &gt;&gt; IF Cobl Races.esp
1044 &gt;&gt; WARN
1045 e meshes\characters\saram\femalehair\type0\01.nif // __Missing meshes [Saram].__ Be sure that you have installed [[http://oblivion.nexusmods.com/mods/21104|Cobl Cosmetics Res 01]].
1046 e meshes\clothes\asxivilai\xivilaicollar.nif // __Missing meshes [xivilai].__ Be sure that you have installed [[http://oblivion.nexusmods.com/mods/21104|Cobl Cosmetics Res 01]].
1047 x DLCShiveringIsles.esp // **Activate** Required (meshes and textures).
1048
1049 &gt;&gt; IF Cobl Races - Balanced.esp
1050 &gt;&gt; WARN
1051 x Cobl Races.esp // **Activate.** Required.
1052
1053 &gt;&gt; IF Cobl Si.esp
1054 &gt;&gt; WARN
1055 x DLCShiveringIsles.esp // **Activate.** Required.
1056
1057 ## Patch Mods ----------------------------------------------------------------
1058 &gt;&gt; IF FF_REAL_Thirst.esp
1059 &gt;&gt; SUGGEST
1060 x FF_REAL_Thirst, Cob.esp // Patch FF Real Thirst to work with Cobl water wells.
1061 </code>
1062
1063

  ViewVC Help
Powered by ViewVC 1.1.22