sys
The sys namespace controls import configuration and provides platform detection.
WARNING
The sys namespace is not fully functioning as intended at the moment.
sys.cacheRemoteFiles — boolean (read/write)
Controls whether remotely imported files are cached between runs. Default is true. Set to false during development to force a re-download on each run start. This setting persists between runs.
// Toggle remote caching with the Up key
?key = upBegin
sys.cacheRemoteFiles = !sys.cacheRemoteFiles
?sys.cacheRemoteFiles
>Remote caching ENABLED
:
>Remote caching DISABLEDsys.fileUrl — string (read-only)
The current base URL used when resolving import and new paths. Defaults to local on PC and https://StonestoryRPG.com/stonescript/ on mobile.
>`0,1,fileUrl = @sys.fileUrl@sys.SetFileUrl(str)
Returns: nothing
Changes the base URL for subsequent import / new commands. Can only be called from the Mind Stone itself (not from an imported script).
Special values:
"local"— use the local save-file folder"remote"— use the official Stone Story RPG repositorynull— reset to the device default
sys.SetFileUrl("https://MyCoolDomain.com/scripts/")
import MyCombatScriptsys.MindConnect()
Returns: nothing
(Experimental) Enables an external connection interface. Must be the only line in the Mind Stone. Once connected, external programs can run Stonescript commands and read game state. See SSRPGInterface for details.
sys.isMobile — bool
Returns true if the player is on Android or iOS.
sys.isPC — bool
Returns true if the player is on Windows, Mac, or Linux.
sys.os — string
Returns the operating system name: "Android", "iOS", "Linux", "OSX", or "Windows".
?sys.isMobile
>Playing on @sys.os@
:
>Playing on PC (@sys.os@)