Difference between revisions of "FindNextFile"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Describing output)
imported>Low Post
m (Shortened example Script a bit.)
 
Line 14: Line 14:


Begin GameMode
Begin GameMode
    SetString -2000 "*.bsa"
SetString -2000 "*.bsa"
    If ( FindFirstFile -2050 -2000 1 ) == 0
FindFirstFile -2050 -2000 1
        StopQuest TestFF
While ( ( StringLen -2050 ) > 0 )
        Return
StringMsg -2050 1
    EndIf
FindNextFile -2050
   
Loop
    SaveIP
StopQuest TestFF
   
    StringMsg -2050 1
    If ( FindNextFile -2050 ) == 0
        StopQuest TestFF
        Return
    EndIf
   
    RestoreIP
End</pre>
End</pre>



Latest revision as of 05:23, 1 May 2009

A command for Pluggy.

Syntax:

(FoundFile:bool) FindNextFile (FileFound)StringID:long Global:bool

Sets the content of (FileFound)StringID to the Filename of the next matching File and returns 1 if a file was found; 0 if not. FindFirstFile must be called first; this function uses the FileMask, RootID & Directories passed to FindFirstFile. This function should only be used within a Label/Goto loop

Notes:[edit | edit source]

  • If you want to modify a string from another mod, you will need to set the Global flag to 1. If Global is 0 or unset the function will fail. If the string is protected the function will fail.

Example[edit | edit source]

Quest script that display in the console the list of *.bsa files in Oblivion/Data folder:

scn testffs

Begin GameMode
	SetString -2000 "*.bsa"
	FindFirstFile -2050 -2000 1
	While ( ( StringLen -2050 ) > 0 )
		StringMsg -2050 1
		FindNextFile -2050
	Loop
	StopQuest TestFF
End

See also[edit | edit source]