sm.challenge

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

Functions:

  • getCompletionTime
  • getSaveData
  • hasStarted
  • isMasterMechanicTrial
  • levelCompleted
  • resolveContentPath
  • start
  • stop
  • takePicture
  • takePicturesForMenu

  • sm.challenge.getCompletionTime(level)

    Server only

    Retrieve challenge completion time.

    Parameters:

    TypeNameDescription
    UuidlevelThe level's uuid.

    Returns:

    TypeDescription
    numberThe completion time.

    sm.challenge.getSaveData(level)

    Server only

    Retrieve challenge level save data.

    Parameters:

    TypeNameDescription
    UuidlevelThe level's uuid.

    Returns:

    TypeDescription
    tableThe save data.

    sm.challenge.hasStarted()

    Server only

    Check if a challenge has started

    Returns:

    TypeDescription
    booleanReturn true if the challenge has started.

    sm.challenge.isMasterMechanicTrial()

    Client only

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

    Returns:

    TypeDescription
    booleanThe content pack status.

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

    Server only

    Completes a challenge level and saves progression.

    Parameters:

    TypeNameDescription
    UuidlevelThe level's uuid.
    numbertimeThe completion time.
    tablesaveA table containing save data.

    sm.challenge.resolveContentPath(path)

    Server only

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

    Parameters:

    TypeNameDescription
    stringpathThe path containing $CONTENT_DATA.

    Returns:

    TypeDescription
    stringThe resolved path.

    sm.challenge.start()

    Server only

    Starts challenge.


    sm.challenge.stop()

    Server only

    Stops challenge.


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

    Server only

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

    Parameters:

    TypeNameDescription
    integerwidthPreview width.
    integerheightPreview height.
    integerrotationRotation step.

    sm.challenge.takePicturesForMenu(rotation)

    Server only

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

    Parameters:

    TypeNameDescription
    integerrotationRotation step.