Launching Game-STKs – ShiVa Engine

Launching Game-STKs

You do not need to use the cache.add API to load remote game STKs. Loading and executing is done with the system API, system.install in particular.
If you rely on system.install, you can query the current download progress can using system.getInstallationStatus. As soon as it returns 1, the pack is ready. Finally, launch the new game from the STK using system.launch. Note how the pack string is a generic variable that could either be a local or a remote resource.
You should note that the Install System is not available when running your game inside the editor, which makes it impossible to test it without a proper export first. For more a more in-depth code example, you should go through the st_loading sample inside ShiVa.

local sFileToLoadURI = "http://....."
local nProgress = system.getInstallationStatus ( sFileToLoadURI )
if ( nProgress < 0 )
       system.install ( sFileToLoadURI )
-- [...]
-- [...]
elseif ( nProgress == 1 )
      system.launch ( sFileToLoadURI, "" )

Need more answers?

  • slackBanner