sm.challenge

The Challenge api contains functions related to the Challenge game mode.

Server-only

getCompletionTime

sm.challenge.getCompletionTime( level )

Retrieve challenge completion time.

Parameters:

Name Type Description
level Uuid The level's uuid.

Returns:

Type Description
number The completion time.

getSaveData

sm.challenge.getSaveData( level )

Retrieve challenge level save data.

Parameters:

Name Type Description
level Uuid The level's uuid.

Returns:

Type Description
table The save data.

hasStarted

sm.challenge.hasStarted(  )

Check if a challenge has started

Returns:

Type Description
boolean Return true if the challenge has started.

levelCompleted

sm.challenge.levelCompleted( level, time, save )

Completes a challenge level and saves progression.

Parameters:

Name Type Description
level Uuid The level's uuid.
time number The completion time.
save table A table containing save data.

resolveContentPath

sm.challenge.resolveContentPath( path )

Resolves a path containing $CONTENT_DATA to path that can be accessed in the main scripting environment.

Parameters:

Name Type Description
path string The path containing $CONTENT_DATA.

Returns:

Type Description
string The resolved path.

start

sm.challenge.start(  )

Starts challenge.

stop

sm.challenge.stop(  )

Stops challenge.

takePicture

sm.challenge.takePicture( width, height, rotation )

Takes a picture of the challenge level with a custom resolution.

Parameters:

Name Type Description
width integer Preview width.
height integer Preview height.
rotation integer Rotation step.

takePicturesForMenu

sm.challenge.takePicturesForMenu( rotation )

Takes pictures of the challenge level to use as icon and preview.

Parameters:

Name Type Description
rotation integer Rotation step.

Client-only

isMasterMechanicTrial

sm.challenge.isMasterMechanicTrial(  )

Returns true if the current content is the master mechanic trial pack.

Returns:

Type Description
boolean The content pack status.