sm.challenge
The Challenge api contains functions related to the Challenge game mode.
Functions:
sm.challenge.getCompletionTime(level)
Server only
Retrieve challenge completion time.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | level | The level's uuid. |
Returns:
Type | Description |
---|---|
number | The completion time. |
sm.challenge.getSaveData(level)
Server only
Retrieve challenge level save data.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | level | The level's uuid. |
Returns:
Type | Description |
---|---|
table | The save data. |
sm.challenge.hasStarted()
Server only
Check if a challenge has started
Returns:
Type | Description |
---|---|
boolean | Return true if the challenge has started. |
sm.challenge.isMasterMechanicTrial()
Client only
Returns true if the current content is the master mechanic trial pack.
Returns:
Type | Description |
---|---|
boolean | The content pack status. |
sm.challenge.levelCompleted(level, time, save)
Server only
Completes a challenge level and saves progression.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | level | The level's uuid. |
number | time | The completion time. |
table | save | A 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:
Type | Name | Description |
---|---|---|
string | path | The path containing $CONTENT_DATA. |
Returns:
Type | Description |
---|---|
string | The 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:
Type | Name | Description |
---|---|---|
integer | width | Preview width. |
integer | height | Preview height. |
integer | rotation | Rotation step. |
sm.challenge.takePicturesForMenu(rotation)
Server only
Takes pictures of the challenge level to use as icon and preview.
Parameters:
Type | Name | Description |
---|---|---|
integer | rotation | Rotation step. |