3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 10951|回复: 7
打印 上一主题 下一主题

[MOD] FileAccess Interface for Skyrim Script - FISS!!!不明覺勵

  [复制链接]

240

主题

1183

帖子

2410

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
358
金元
9775
积分
2410
精华
0
注册时间
2013-2-14
跳转到指定楼层
主题
发表于 2013-11-29 11:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
http://skyrim.nexusmods.com/mods/48265/?







~~~ FileAccess Interface for Skyrim Scripts ~~~
-- FISS --


OVERVIEW

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

This can useful in different 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.

For an example finished mod you can take a look at MinimalHUD, where FISS is used to save and reload user defined HUD Layouts.




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.06.16 or higher.



FAQ

-- Where are the created files located? --
All files are stored in “/Sykrim/Data/SKSE/FISS/”  (or if you use ModOrganizer in “ModOrganizer/overwrite/SKSE/FISS”)
You can create your own subfolders though: e.g. fiss.beginSave(“MySubfolderMyFile.xml”)
Global filenames (e.g. “c:myfoldermyfile.xml”) will NOT work

-- 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



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 save 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 <whatever>

;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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-4-19 23:19 , Processed in 0.027234 second(s), 15 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表