Jump to content

[LE] FISS Can't get any of the scripts to work


Recommended Posts

Dear morogoth35,

IsharaMeradin has given you the right answer. Imho it's a really bad behavior to open a new forum topic and not given an answer here.

 

 

mod: FISS - FileAccess Interface for Skyrim Script http://www.nexusmods.com/skyrim/mods/48265/? by Lord Conti

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.

 

 

DeathCounterScriptTest - script from above a bit changed, no warranty

 

Scriptname DeathCounterScriptTest extends ReferenceAlias  
{rewritten by ReDragon 2017}

; https://forums.nexusmods.com/index.php?/topic/5752702-fiss-cant-get-any-of-the-scripts-to-work/
; morogoth35 wrote: "So something with my integer is wrong.."

Import SKSE
Import FISSFactory                    ; FISS requires SKSE 1.6.16 or higher

; FISS - FileAccess Interface for Skyrim Script by Lord Conti
; http://www.nexusmods.com/skyrim/mods/48265/?

; Taleden wrote (30-Mar-2015):
; I am not so sure global filename support is such a great idea; seems like a serious security issue,
; especially for users who run Skyrim as the administrator for whatever reason.
; I for one would not want to give some Skyrim mod the ability to read or erase any file on my system;
; much better to keep it quarantined to the Skryim/Data/SKSE folder.
;
; Edit: Also, have you considered making your DLL source code available?
; I for one am never keen on running compiled code from an anonymous source without being able to at least glance at the source.

  FISSInterface fiss
  Int iCounter                        ; script variable init by 0


; -- EVENT --

EVENT OnDeath(Actor akKiller)
IF myF_IsOK()
    LoadData()                        ; take the counter from "*.xml", first time it should be Zero, because xml-file does not exist
    iCounter = iCounter + 1           ; increase the counter
    SaveData()                        ; write updated counter back to xml file
;ELSE
    ; this branch of condition is useless, no saving possible
    ; using of a GlobalVariable does not work, if player has died!
ENDIF
ENDEVENT

; -- FUNCTIONs -- 3

;-----------------------
Bool FUNCTION myF_IsOK()
;-----------------------
    int i = SKSE.GetVersionRelease()            ; Returns SKSE release version or Zero

IF (i == 0)
    Debug.MessageBox("SKSE is missing!")
    Return False    ; skse not found
ENDIF
;---------
    float f = SKSE.GetVersion()                 ; 1  = major version
    f = f + (SKSE.GetVersionMinor() * 0.01)     ; 06 = minor version
    f = f + (SKSE.GetVersionBeta() * 0.0001)    ; 16 = build

IF (f < 1.616)                                  ; http://www.creationkit.com/index.php?title=GetVersion_-_SKSE
    Debug.MessageBox("SKSE has bad v"+f)
    Return False    ; skse version error
ENDIF
;---------
    fiss = FISSFactory.getFISS()

IF ( fiss )
    Return TRUE        ; ok found!
ENDIF
;---------
    Debug.MessageBox("FISS is not installed!")    ; should be removed on release
    Return False    ; bad..
ENDFUNCTION


;------------------
FUNCTION LoadData()
;------------------
IF (iCounter == 0)
    RETURN    ; - STOP -    skip Data "loading" before "saving"
ENDIF
;---------------------
    fiss.beginLoad("DeathCounter.xml")    ; >> LOAD
    iCounter = fiss.loadInt("DC")
    string s = fiss.endLoad()             ; << end

IF (s == "")
ELSE
    Debug.Trace("DCPlayer: Load() - errorMsg = " +s)
ENDIF
ENDFUNCTION

;------------------
FUNCTION SaveData()
;------------------
; All files are stored in "/Sykrim/Data/SKSE/Plugins/FISS/"
; (or if you use ModOrganizer in "ModOrganizer/overwrite/SKSE/Plugins/FISS")

    string s = "yourModName.esp"          ; CONST: change this value to your desired esp filename !!

    fiss.beginSave("DeathCounter.xml", s) ; >> SAVE
    fiss.saveInt("DC", iCounter)
    s = fiss.endSave()                    ; << end

IF (s == "")
ELSE
    Debug.Trace("DCPlayer: Save() - errorMsg = " +s)
ENDIF
ENDFUNCTION

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...