GetFileSize

Revision as of 09:20, 26 April 2009 by imported>Low Post (New page: A command for Pluggy. '''Syntax:''' (Size:long) GetFileSize (FileName)StringID:long ''RootID:short'' GetFileSize returns the file size in Bytes of Filename. ==Not...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A command for Pluggy.

Syntax:

(Size:long) GetFileSize (FileName)StringID:long RootID:short

GetFileSize returns the file size in Bytes of Filename.

Notes:

  • If the file cannot be found, it returns -1.
  • If the file size is bigger than 2GB, it returns -2.
  • RootID specifies in which folder the search should be proceeded. Default is 0.
    • 0: "My Documents\My Games\Oblivion\Pluggy\User Files\"
    • 1: Oblivion Data folder.
    • 2: Oblivion main folder.
  • 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:

Quest Script which returns if the player uses a german copy of Oblivion. Only works with a fully patched (v1.2.0416) Oblivion.

scn LanguageCheckScript

Begin Gamemode
	SetString -2000 "Oblivion.esm" 0
	set IsGerman to ( ( ( GetFileSize -2000 1 ) == 247876643 ) || ( ( GetFileSize -2000 1 ) == 278038032 ) )
	if ( IsGerman )
		Message "Du verwendest eine deutsche Version von Oblivion."
	else
		Message "You use a non-German (probably English) copy of Oblivion."
	endif
	StopQuest LanguageCheck
End


See also