LuaLibrarySpeedShoppa.wiki
author Wuzzy
Fri, 31 May 2019 12:12:04 +0100
changeset 1911 96efcb3f08bd
parent 1377 fecee71744b3
child 1935 e007757c3e65
permissions -rw-r--r--
ProtocolNumbers: Edited via web interface

#summary Lua library documentation of !SpeedShoppa; for creating simple Shoppa-style missions.
#labels !LuaLibrary
= Lua library: `SpeedShoppa` =
Starting with 0.9.22, this Lua library provides a function to create a simple Shoppa-style mission.

In `SpeedShoppa` missions, the player starts with infinite ropes and has to collect all crates as fast as possible and compete for the fastest time.

== `SpeedShoppaMission(params)` ==
This function sets up the *entire* mission and needs one argument: `params`.
The argument “`params`” is a table containing fields which describe the training mission.

Mandatory fields:

|| *Field name* || *Description* ||
|| `map` || The name of the map to be used ||
|| `theme` || The name of the theme (does not need to be a standalone theme) ||
|| `time` || The time limit in milliseconds ||
|| `crates` || The coordinates of where the crates will be spawned. It is a table containing tables containing coordinates of format `{ x=value, y=value }`. There must be at least 1 crate. ||

Optional fields:

|| *Field name* || *Description* ||
|| `missionTitle` || The name of the mission (optional but highly recommended) (default: `"Speed Shoppa"`) ||
|| `hogHat` || Hat of the hedgehog (default: `"NoHat"`) ||
|| `hogName` || Name of the hedgehog (default: `"Roper"`) ||
|| `teamName` || Name of the hedgehog’s team (default: `"Shoppers"`) ||
|| `teamGrave` || Name of the hedgehog’s grave (default: `"Statue"`) ||
|| `teamFlag` || Name of the team’s flag (default: `"cm_shoppa"`) ||
|| `clanColor` || Color of the (only) clan (default: `0xFF0204`, which is a red tone) ||
|| `goalText` || A short string explaining the goal of the mission (default: `"Use your rope to collect all crates as fast as possible."`) ||
|| `faceLeft` || If `true`, the hog faces to the left initially, if false, it faces to the right. (default: `false` (=right)) ||
|| `crateType` || Specify the type of crate (this has no gameplay effect), pick one of `"ammo"`, `"utility"`, `"health"`. Default: `"ammo"` ||
|| `extra_onGameStart` || A function which is called at the end of this script's `onGameStart`. It takes no parameters. You could use this to spawn additional gears like girders or mines ||
|| `extra_onGameInit` || A function which is called at the end of this script's `onGameInit` ||