whitehawk69 Posted May 21, 2011 Share Posted May 21, 2011 I know how to do OMOD scripts... But not FOMOD scripts! :( Could someone please help me! I don't want a lengthy tutorial on how to do general FOMOD scripting, all I want to do is create some script for a FOMOD where it detects to see if the user has a certain esp/esm file before installing the FOMOD and if they don't have it...doesn't install and tells them to go and get it!Now I know that with the good old OMOD it would have been a simple case of "if DataFileExists..." but the FOMM is sadly different. :wallbash: Link to comment Share on other sites More sharing options...
whitehawk69 Posted May 22, 2011 Author Share Posted May 22, 2011 :ermm: Anyone? Link to comment Share on other sites More sharing options...
rickerhk Posted May 22, 2011 Share Posted May 22, 2011 There's some tutorials here: http://zumbs.wordpress.com/category/game-mods/fallout-3/fallout-mod-manager/ Link to comment Share on other sites More sharing options...
schlangster Posted May 22, 2011 Share Posted May 22, 2011 (edited) i haven't tested it, but it should give you an idea: using System; using System.Text; using System.IO; using System.Windows.Forms; using fomm.Scripting; class Script : FalloutNewVegasBaseScript { public static bool IsPluginInstalled(String name) { string[] installedPlugins = GetAllPlugins(); foreach (string plugin in installedPlugins) if (plugin.Equals(name, StringComparison.InvariantCultureIgnoreCase)) return true; return false; } public static bool OnActivate() { if (! IsPluginInstalled("blabla.esp") { MessageBox("Get blabla.esp", Error"); return false; } PerformBasicInstall(); return true; } } Edited May 22, 2011 by schlangster Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted June 18, 2011 Share Posted June 18, 2011 The alternative to using the C# scripts is to use the xml config scripts. They're much easier (imo) to use and don't require you to create a bunch of functions to do checks. A script can be as simple as just declaring a bunch of install files, or giving the user options through multiple pages, conditionalized, etc. An example of a simple script:<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd"> <moduleName>Mod Name Here</moduleName> <requiredInstallFiles> <file source="Readme - Mod Name Here.txt"/> </requiredInstallFiles> <installSteps> <installStep name="Options"> <!--This name does not appear to the user, and is for internal organization only. --> <optionalFileGroups> <group name="DLC Compatibility" type="SelectAny"> <plugins order="Explicit"> <!--The order in which the plugin list will appear: Explicit (as written), Ascending, Descending (alphabetic)--> <plugin name="Dead Money"> <description> <![CDATA[Put a description of what the plugin does here.]]> </description> <image path="fomod/images/imagename.jpg/> <!--The path to the image relative to the root of the fomod. If unused remove this line--> <files> <file source="ModName.esp"/> </files> <typeDescriptor> <dependencyType> <defaultType name="NotUsable"/> <patterns> <pattern> <dependencies> <fileDependency file="DeadMoney.esm" state="Active"/> </dependencies> <type name="Optional"/> </pattern> <pattern> <dependencies> <fileDependency file="DeadMoney.esm" state="Inactive"/> </dependencies> <type name="CouldBeUsable"/> </pattern> </patterns> </dependencyType> </typeDescriptor> </plugin> </plugins> </group> </optionalFileGroups> </installStep> </installSteps> </config>The above code is a simple script. The <group> tag will place all the plugins listed under it under a named heading in the installer panel. Each group has a name and a type. The types are: SelectAll, SelectAny, SelectAtLeastOne, SelectAtMostOne, SelectExactlyOne. The names are pretty self explanatory, so I won't go into more detail on those. The rest of it is all dependent on what you want to do. If your file has a master that needs to be installed before it can be used, then you want to just use the <typeDescriptor> tag just the way it is, except replace DeadMoney.esm with the name of the master your plugin needs. If the file doesn't need a master, then you can remove all of that, and replace it with:<typeDescriptor> <type name="Optional"/> </typeDescriptor> There's a lot more, but it would take way too long to describe here. At some point I should make up a document detailing how to make these things. If you, or anyone, need more information, just send me a PM, I'm glad to help people learn how to make FoMM scripts. Link to comment Share on other sites More sharing options...
Recommended Posts