FileAccess Interface for Skyrim Script – FISS

Skyrim Mods |

FileAccess Interface for Skyrim Script – FISS

Easy to use interface for modders to save&reload in-game variables (e.g. MCM settings) to/from file.

~~~ FileAccess Interface for Skyrim Scripts ~~~

OVERVIEW

FISS is an easy to use interface for modders to save&reload in-game variables to/from file.

This could be useful in various scenarios.
For example, more and more mods offer extensive MCM settings which have to be reset from scratch whenever you start a new game.
FISS allows modders to provide the possibility to create user defined presets which can be saved, reloaded or shared.

Here’s a list of mods currently using FISS
Take Notes – Journal of the Dragonborn
MinimalHUD
Spellmaking in Skyrim – The last altar
Dynamic Potions – Poisons – Ingredients – Food(Source Code included)
Dynamic Magicka and Stamina Growth
A Matter of Time – A HUD clock widget
Enchanted Arsenal
Widget Mod
Living takes time
Timing is everything (source included)
Awakened Magicka

HOW TO USE(Players)
1. Download and install FISS (Extract to folder “Skyrim/Data/”
2. Activate FISS.esp in your load order
3. Place any FISS supporting mod after that

HOW TO USE(Modders)
1. Download and install FISS (Extract to folder “Skyrim/Data/”
2. Activate FISS.esp in your load order
3. Use FISS in your scripts (see API and example below)
4. When releasing your mod, include the following files in your bsa(or as loose files)
– FISSFactory.pex
– FISSInterface.pex
Do not include any other fiss files.

REQUIREMENTS
FISS requires SKSE 1.6.16 or higher.

FAQ

— Where are the created files located? —
All files are stored in “/Sykrim/Data/SKSE/Plugins/FISS/” (or if you use ModOrganizer in “ModOrganizer/overwrite/SKSE/Plugins/FISS”)
You can create your own subfolders though: e.g. fiss.beginSave(“MySubfolderMyFile.xml”)
Global filenames (e.g. “c:myfoldermyfile.xml”) will NOT work.
If you create your own subfolder, make sure to ship that folder-structure with your mod, cause – depending on the specific game setup – FISS might not have the rights to create that folder by itself.

— Do I have to release different versions of my mod for people that do/do not have FISS? —
No. Just do a simple check to see if fiss is installed, e.g.
FISSInterface fiss = FISSFactory.getFISS()
If !fiss
debug.MessageBox(“FISS not installed. Save/Reload disabled”)
return
endif

CREDITS & THANKS
I’d like to thank
– Bethesda for releasing this awesome game
– the SKSE Team for offering modders so many great possibilities
– mttankard, who made the original MinimalHUD LayoutManager, for his support

API(also see optional file “Documentation”)

The FISS API consists of two scripts. The FISSFactory to get a reference to the FISS Interface and the FISS Interface itself for file operations.
FISSFactory consists of a single global function and can be included in your own scripts.

FISSFactory Functions

FISSInterface Function getFISS()
Retrieves a reference to the FISS Interface. Returns “none” when FISS is not installed

FISSInterface Functions

Load Functions
All loading operations have to start with a beginLoad statement and end with an endLoad statement

Function beginLoad(string filename)
Declares the beginning of a set of load operations.

string Function endLoad()
Declares the end of a set of load operations. Returns error messages as a string. String is empty, if all load operations were successful.

bool Function loadBool(string name)
Loads the boolean with the given name

string Function loadString(string name)
Loads the string with the given name

float Function loadFloat(string name)
Loads the float with the given name

int Function loadInt(string name)
Loads the integer with the given name

Save Functions
All saving operations have to start with a beginSave statement and end with an endSave statement

Function beginSave(string filename, string modname)
Declares the beginning of a set of save operations. filename should (but needs not) end with “.xml”.
Modname is the name of the mod

string Function endSave()
Declares the end of a set of save operations. Returns error messages as a string. String is empty, if all save operations were successful.

Function saveBool(string name, bool value)
Saves a boolean under the given name.

Function saveString(string name, string value)
Saves a string under the given name.

Function saveFloat(string name, float value)
Saves a float under the given name.

Function saveInt(string name, int value)
Saves an integer under the given name.

Other Functions
float Function getVersion()
Gets the installed FISS version

float Function getInterfaceVersion()
Gets the version of the interface

string Function saveTextToTxtFile(string filename, string text)
Directly save a string to a text file. This function must be used without BeginSave, EndSave

A SIMPLE EXAMPLE(also see optional file “Documentation”)

In the following example a mod called “MyMod” wants to save and reload three variables to/from the file “MyFile.xml”.
To do so it defines two functions “MySaveFunction” and “MyLoadFunction”.

Script MyScript extends
;Variables
bool bMyBool
int iMyInt
string sMyString

;import the FISSFactory to create the FISS Interface
import FISSFactory

;Save Function
Function MySaveFunction
; get a reference to the FISS Interface
FISSInterface fiss = FISSFactory.getFISS()

; check if FISS is installed
If !fiss
debug.MessageBox(“FISS not installed. Saving disabled”)
return
endif

; save variables
fiss.beginSave(“MyFile.xml”)
fiss.saveBool(“MyBool”, bMyBool)
fiss.saveInt(“MyInt”, iMyInt)
fiss.saveString(“MyString”, sMyString)
string saveResult = fiss.endSave()
; check the result
if saveResult != “”
debug.Trace(saveResult)
endif
EndFunction

; Load Function
Function MyLoadFunction
; get a reference to the FISS Interface
FISSInterface fiss = FISSFactory.getFISS()

; check if FISS is installed
If !fiss
debug.MessageBox(“FISS not installed. Loading disabled”)
return
endif

; load variables
fiss.beginLoad(“MyFile.xml”)
bMyBool = fiss.loadBool(“MyBool”)
iMyInt = fiss.loadInt(“MyInt”)
sMyString = fiss.loadString (“MyString”)
string loadResult = fiss.endLoad()
; check the result
if loadResult != “”
debug.Trace(loadResult)
endif
EndFunction


Author: Lord Conti
This content was uploaded by website visitors. If you notice any mistake, please let us know.



Useful Information:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *