public class NiftyFunc
extends java.lang.Object
Constructor and Description |
---|
NiftyFunc() |
Modifier and Type | Method and Description |
---|---|
static void |
allocateMoreMemory(java.lang.String startingMem,
java.lang.String maxMem,
java.lang.String jarPath,
java.lang.String... args)
A function that starts a new java program with more memory.
|
static java.util.ArrayList<MajorRecord> |
deepCopySubRecords(MajorRecord in,
ModListing targetMod)
Copies each major record from the target mod that is referenced in the major record.
|
static java.lang.String |
EDIDtrimmer(java.lang.String origEDID)
Replaces all "naughty" characters with "" or "_"
|
static RACE |
genSafeScriptAttachingRace(ScriptRef script,
RACE raceToDup,
java.lang.String uniqueID)
A common way to attach scripts to NPCs that normally cannot have scripts
attached
(Any NPC that is referenced by a LVLN) is to give a racial spell to them that has a magic effect that has the desired script. This function streamlines the process and gives you a duplicate race which will attach the desired script. You can then set it to be the target NPCs race. |
static SPEL |
genScriptAttachingSpel(ScriptRef script,
java.lang.String uniqueID)
A common way to attach scripts to NPCs that normally cannot have scripts
attached
(Any NPC that is referenced by a LVLN) is to give a racial spell to them that has a magic effect that has the desired script. This function streamlines the process and gives you a SPEL/MGEF setup that will attach the desired script. Simply give this SPEL to the NPC's race. NOTE: Attaching a script attachment spell to an NPCs race will affect ALL NPCs with that same race. If you do not want this, then consider using genSafeScriptAttachingRace(). |
static LVLN |
isTemplatedToLList(FormID npc,
NPC_.TemplateFlag... templateFlagsToCheck)
Checks the given template flag "chains" to see if the NPC is templated to
a Leveled List at any point.
|
static LVLN |
isTemplatedToLList(NPC_ npc,
NPC_.TemplateFlag... templateFlagsToCheck)
Checks the given template flag "chains" to see if the NPC is templated to
a Leveled List at any point.
|
static QUST |
makeScriptQuest(ScriptRef script)
Makes a new quest that starts immediately in-game, that has this script
attached to it.
|
static MajorRecord |
mergeDuplicate(MajorRecord in)
Checks global path for duplicate record.
|
static void |
modifyPluginsTxt(java.util.ArrayList<Mod> add,
java.util.ArrayList<Mod> remove)
Adds and removes desired mods from the plugins list.
|
static void |
modifyPluginsTxt(Mod add)
Adds a mod to the plugins list if it doesn't exist.
|
static int |
replaceAll(java.util.ArrayList<FormID> src,
FormID target,
FormID... with)
Replaces formIDs in arraylist.
|
static void |
runBOSS(boolean errorMessages)
Runs BOSS and sorts the load order.
|
static void |
setupMissingPatchFiles(java.util.ArrayList<Mod> mods)
Creates empty files for non existent mods.
|
static void |
setupMissingPatchFiles(Mod... mods)
Creates empty files for non existent mods.
|
static boolean |
startProcess(java.io.File directory,
java.lang.String... args)
Starts a process as if from the command line, with the given working
directory.
|
static boolean |
startProcess(java.lang.String... args)
Starts a process as if from the command line.
|
static java.lang.String |
trimToFour(java.lang.String in)
Trims or expands a string (with _) to have exactly four characters.
|
static boolean |
validateRecordLengths(java.io.File testFile,
int numErrorsToPrint)
Reads in the file and confirms that all GRUPs and Major Records have
correct lengths.
|
static boolean |
validateRecordLengths(java.lang.String testFilePath,
int numErrorsToPrint)
Reads in the file and confirms that all GRUPs and Major Records have
correct lengths.
|
static int |
versionToNum(java.lang.String version)
Converts a string version to a unique number
Only supports XX.XX.XX.XX with numbers for X |
public static SPEL genScriptAttachingSpel(ScriptRef script, java.lang.String uniqueID)
script
- Script to have the SPEL attachuniqueID
- A unique string to differentiate the records from any
other SkyProc user's setups.public static RACE genSafeScriptAttachingRace(ScriptRef script, RACE raceToDup, java.lang.String uniqueID)
script
- Script to have the SPEL attachuniqueID
- A unique string to differentiate the records from any
other SkyProc user's setups.raceToDup
- Original race that you wish to duplicate.public static LVLN isTemplatedToLList(FormID npc, NPC_.TemplateFlag... templateFlagsToCheck)
npc
- NPC formID to investigate.templateFlagsToCheck
- Template flags to consider.public static LVLN isTemplatedToLList(NPC_ npc, NPC_.TemplateFlag... templateFlagsToCheck)
npc
- NPC to investigate.templateFlagsToCheck
- Template flags to consider.public static QUST makeScriptQuest(ScriptRef script)
script
- The script to add to the quest.public static void allocateMoreMemory(java.lang.String startingMem, java.lang.String maxMem, java.lang.String jarPath, java.lang.String... args) throws java.io.IOException, java.lang.InterruptedException
startingMem
- Memory to start the new program with.maxMem
- Max amount of memory to allow the new program to use.jarPath
- Path to the jar file to open. Usually, just put the name
of your jar.args
- Any special main function args you want to give to the second
program.java.io.IOException
java.lang.InterruptedException
public static java.lang.String EDIDtrimmer(java.lang.String origEDID)
origEDID
- public static int versionToNum(java.lang.String version)
version
- public static boolean validateRecordLengths(java.io.File testFile, int numErrorsToPrint)
testFile
- File to test.numErrorsToPrint
- Number of error messages to print before
stopping.public static boolean validateRecordLengths(java.lang.String testFilePath, int numErrorsToPrint)
testFilePath
- Path to the file to test.numErrorsToPrint
- Number of error messages to print before
stopping.public static boolean startProcess(java.io.File directory, java.lang.String... args)
directory
- args
- public static boolean startProcess(java.lang.String... args)
args
- public static java.lang.String trimToFour(java.lang.String in)
in
- public static int replaceAll(java.util.ArrayList<FormID> src, FormID target, FormID... with)
src
- Target arraylist to look intarget
- FormID to replacewith
- FormIDs to substitute in place of targetpublic static void setupMissingPatchFiles(java.util.ArrayList<Mod> mods) throws java.io.IOException
mods
- java.io.IOException
public static void setupMissingPatchFiles(Mod... mods) throws java.io.IOException
mods
- java.io.IOException
public static void modifyPluginsTxt(java.util.ArrayList<Mod> add, java.util.ArrayList<Mod> remove) throws java.io.IOException
add
- Mods to add if they don't already exist on the listremove
- Mods to remove if they do exist.java.io.IOException
public static void modifyPluginsTxt(Mod add) throws java.io.IOException
add
- java.io.IOException
public static void runBOSS(boolean errorMessages)
errorMessages
- public static java.util.ArrayList<MajorRecord> deepCopySubRecords(MajorRecord in, ModListing targetMod)
in
- targetMod
- public static MajorRecord mergeDuplicate(MajorRecord in)
in
- Major Record to check for duplicates.