2018-03-17 19:37:46 +01:00
|
|
|
/*****************************************************************************
|
2024-01-01 12:52:28 +01:00
|
|
|
* Copyright (c) 2014-2024 OpenRCT2 developers
|
2018-03-17 19:37:46 +01:00
|
|
|
*
|
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
// OpenRCT2 Scripting API definition file
|
|
|
|
|
2018-03-18 02:55:12 +01:00
|
|
|
// To enable IntelliSense for your scripts in Visual Studio or Visual Studio Code,
|
|
|
|
// add the following line to the top of your script and change the path appropriately.
|
|
|
|
//
|
|
|
|
// /// <reference path="/path/to/openrct2.d.ts" />
|
|
|
|
//
|
|
|
|
|
2022-02-20 01:23:15 +01:00
|
|
|
export type PluginType = "local" | "remote" | "intransient";
|
2020-02-07 00:15:20 +01:00
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
declare global {
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Global context for accessing all other APIs.
|
|
|
|
*/
|
2020-05-10 18:02:10 +02:00
|
|
|
/** APIs for cheats. */
|
|
|
|
var cheats: Cheats;
|
2020-03-07 14:11:08 +01:00
|
|
|
/** APIs for interacting with the stdout console. */
|
|
|
|
var console: Console;
|
|
|
|
/** Core APIs for plugins. */
|
|
|
|
var context: Context;
|
|
|
|
/** APIs for getting or setting the in-game date. */
|
|
|
|
var date: GameDate;
|
|
|
|
/** APIs for manipulating the map. */
|
|
|
|
var map: GameMap;
|
|
|
|
/** APIs for managing the server or interacting with the server or clients. */
|
|
|
|
var network: Network;
|
|
|
|
/** APIs for the park and management of it. */
|
|
|
|
var park: Park;
|
2020-09-08 02:08:21 +02:00
|
|
|
/** APIs for the current scenario. */
|
|
|
|
var scenario: Scenario;
|
2021-05-17 02:06:36 +02:00
|
|
|
/** APIs for the climate and weather. */
|
|
|
|
var climate: Climate;
|
2022-01-18 19:21:20 +01:00
|
|
|
/** APIs for performance profiling. */
|
|
|
|
var profiler: Profiler;
|
2023-04-29 18:39:35 +02:00
|
|
|
/**
|
|
|
|
* APIs for getting, loading, and unloading objects.
|
|
|
|
*/
|
|
|
|
var objectManager: ObjectManager;
|
2021-01-24 17:46:16 +01:00
|
|
|
/**
|
|
|
|
* APIs for creating and editing title sequences.
|
|
|
|
* These will only be available to clients that are not running headless mode.
|
2021-02-27 03:20:47 +01:00
|
|
|
*/
|
2021-01-24 17:46:16 +01:00
|
|
|
var titleSequenceManager: TitleSequenceManager;
|
2020-05-11 04:26:10 +02:00
|
|
|
/**
|
2020-03-07 14:11:08 +01:00
|
|
|
* APIs for controlling the user interface.
|
|
|
|
* These will only be available to servers and clients that are not running headless mode.
|
|
|
|
* Plugin writers should check if ui is available using `typeof ui !== 'undefined'`.
|
2021-02-27 03:20:47 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
var ui: Ui;
|
|
|
|
|
|
|
|
/**
|
2021-01-10 19:23:35 +01:00
|
|
|
* Registers the plugin. This may only be called once.
|
2020-03-07 14:11:08 +01:00
|
|
|
* @param metadata Information about the plugin and the entry point.
|
|
|
|
*/
|
|
|
|
function registerPlugin(metadata: PluginMetadata): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a JavaScript object that can or should be disposed when no longer needed.
|
|
|
|
*/
|
|
|
|
interface IDisposable {
|
|
|
|
dispose(): void;
|
|
|
|
}
|
|
|
|
|
2020-05-02 12:42:43 +02:00
|
|
|
/**
|
|
|
|
* A coordinate within the game's client screen in pixels.
|
|
|
|
*/
|
|
|
|
interface ScreenCoordsXY {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
2021-02-03 00:48:46 +01:00
|
|
|
/**
|
|
|
|
* Represents the width and height in pixels.
|
|
|
|
*/
|
|
|
|
interface ScreenSize {
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* A coordinate within the game.
|
|
|
|
* Each in-game tile is a size of 32x32.
|
|
|
|
*/
|
2020-05-02 12:42:43 +02:00
|
|
|
interface CoordsXY {
|
2020-03-07 14:11:08 +01:00
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A coordinate within the game.
|
|
|
|
* Each in-game tile is a size of 32x32.
|
|
|
|
* The z-coordinate raises 16 per land increment. A full-height wall is 32 in height.
|
|
|
|
*/
|
2020-05-02 12:42:43 +02:00
|
|
|
interface CoordsXYZ extends CoordsXY {
|
2020-03-07 14:11:08 +01:00
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
2020-05-11 01:00:15 +02:00
|
|
|
/**
|
|
|
|
* A coordinate within the game.
|
|
|
|
* Each in-game tile is a size of 32x32.
|
|
|
|
* The z-coordinate raises 16 per land increment. A full-height wall is 32 in height.
|
|
|
|
* The direction is between 0 and 3.
|
|
|
|
*/
|
|
|
|
interface CoordsXYZD extends CoordsXYZ {
|
2022-08-14 19:52:22 +02:00
|
|
|
direction: Direction;
|
2020-05-11 01:00:15 +02:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:04:37 +02:00
|
|
|
/**
|
|
|
|
* A rectangular area specified using two coordinates.
|
|
|
|
*/
|
|
|
|
interface MapRange {
|
2020-05-02 12:42:43 +02:00
|
|
|
leftTop: CoordsXY;
|
|
|
|
rightBottom: CoordsXY;
|
2020-05-01 18:04:37 +02:00
|
|
|
}
|
|
|
|
|
2021-03-06 23:25:26 +01:00
|
|
|
/**
|
|
|
|
* Represents lateral and vertical g-forces.
|
|
|
|
*/
|
|
|
|
interface GForces {
|
|
|
|
lateralG: number;
|
|
|
|
verticalG: number;
|
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Represents information about the plugin such as type, name, author and version.
|
|
|
|
* It also includes the entry point.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
interface PluginMetadata {
|
|
|
|
name: string;
|
|
|
|
version: string;
|
|
|
|
authors: string | string[];
|
|
|
|
type: PluginType;
|
2020-06-19 16:14:33 +02:00
|
|
|
licence: string;
|
2020-02-19 02:00:02 +01:00
|
|
|
minApiVersion?: number;
|
2022-12-20 16:34:38 +01:00
|
|
|
/**
|
|
|
|
* The Plug-in API version the current plug-in is designed for. This is used for backwards compatibility.
|
|
|
|
* E.g.: 66
|
|
|
|
*/
|
|
|
|
targetApiVersion: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
main: () => void;
|
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Console APIs
|
|
|
|
* Currently interact with stdout.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
interface Console {
|
|
|
|
clear(): void;
|
|
|
|
log(message?: any, ...optionalParams: any[]): void;
|
2020-04-27 23:02:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Executes a command using the legacy console REPL. This should not be used
|
|
|
|
* by plugins, and exists only for servers to continue using old commands until
|
|
|
|
* all functionality can be accomplished with this scripting API.
|
2020-05-11 04:26:10 +02:00
|
|
|
*
|
2020-04-27 23:02:38 +02:00
|
|
|
* @deprecated
|
|
|
|
* @param command The command and arguments to execute.
|
|
|
|
*/
|
|
|
|
executeLegacy(command: string): void;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Core APIs for storage and subscriptions.
|
|
|
|
*/
|
|
|
|
interface Context {
|
2021-04-28 02:08:56 +02:00
|
|
|
/**
|
|
|
|
* Gets the current version of the plugin api. This is an integer that increments
|
|
|
|
* by 1 every time a change to the plugin api is made.
|
|
|
|
*/
|
|
|
|
readonly apiVersion: number;
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* The user's current configuration.
|
|
|
|
*/
|
2022-02-20 19:25:54 +01:00
|
|
|
readonly configuration: Configuration;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
|
|
|
/**
|
2021-01-10 19:23:35 +01:00
|
|
|
* Shared generic storage for all plugins. Data is persistent across instances
|
2020-03-07 14:11:08 +01:00
|
|
|
* of OpenRCT2 and is stored externally as a single JSON file in the OpenRCT2
|
|
|
|
* user directory. Internally it is a JavaScript object. Objects and arrays
|
|
|
|
* are only copied by reference. The external file is only written when using
|
|
|
|
* the `set` method, do not rely on the file being saved by modifying your own
|
|
|
|
* objects. Functions and other internal structures will not be persisted.
|
|
|
|
*/
|
2022-02-20 19:25:54 +01:00
|
|
|
readonly sharedStorage: Configuration;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
2022-02-19 17:32:08 +01:00
|
|
|
/**
|
2022-02-23 22:52:38 +01:00
|
|
|
* Gets the storage for the current plugin if no name is specified.
|
|
|
|
* If a plugin name is specified, the storage for the plugin with that name will be returned.
|
|
|
|
* Data is persisted for the current loaded park, and is stored inside the .park file.
|
|
|
|
* Any references to objects, or arrays are copied by reference. If these arrays, objects,
|
|
|
|
* or any other arrays, or objects that they reference change without a subsequent call to
|
2022-02-19 17:32:08 +01:00
|
|
|
* the `set` method, their new state will still be serialised.
|
|
|
|
* Keep in mind that all data here will be serialised every time the park is
|
|
|
|
* saved, including when the park is periodically saved automatically.
|
2022-02-23 22:52:38 +01:00
|
|
|
* @param pluginName The name of the plugin to get a store for. If undefined, the
|
|
|
|
* current plugin's name will be used. Plugin names are case sensitive.
|
2022-02-19 17:32:08 +01:00
|
|
|
*/
|
2022-02-23 22:52:38 +01:00
|
|
|
getParkStorage(pluginName?: string): Configuration;
|
2022-02-19 17:32:08 +01:00
|
|
|
|
2022-02-20 19:25:54 +01:00
|
|
|
/**
|
|
|
|
* The current mode / screen the game is in. Can be used for example to check
|
|
|
|
* whether the game is currently on the title screen or in the scenario editor.
|
|
|
|
*/
|
|
|
|
readonly mode: GameMode;
|
|
|
|
|
2020-05-09 13:55:24 +02:00
|
|
|
/**
|
|
|
|
* Render the current state of the map and save to disc.
|
|
|
|
* Useful for server administration and timelapse creation.
|
|
|
|
* @param options Options that control the capture and output file.
|
|
|
|
*/
|
|
|
|
captureImage(options: CaptureOptions): void;
|
|
|
|
|
2020-03-07 15:41:29 +01:00
|
|
|
/**
|
2023-04-29 18:39:35 +02:00
|
|
|
* @deprecated Use {@link ObjectManager.getObject} instead.
|
2020-03-07 15:41:29 +01:00
|
|
|
*/
|
2023-04-13 21:09:15 +02:00
|
|
|
getObject(type: ObjectType, index: number): LoadedImageObject;
|
2023-04-30 17:28:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getObject} instead.
|
|
|
|
*/
|
2020-03-07 15:41:29 +01:00
|
|
|
getObject(type: "ride", index: number): RideObject;
|
2023-04-30 17:28:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getObject} instead.
|
|
|
|
*/
|
2020-04-27 18:41:49 +02:00
|
|
|
getObject(type: "small_scenery", index: number): SmallSceneryObject;
|
2020-03-07 15:41:29 +01:00
|
|
|
|
2023-04-30 17:28:41 +02:00
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getObject} instead.
|
|
|
|
*/
|
2023-04-22 09:52:21 +02:00
|
|
|
getObject(type: "music", index: number): LoadedObject;
|
2020-03-07 15:41:29 +01:00
|
|
|
|
2023-04-29 18:39:35 +02:00
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
|
|
|
|
*/
|
2023-04-13 21:09:15 +02:00
|
|
|
getAllObjects(type: ObjectType): LoadedImageObject[];
|
2023-04-30 17:28:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
|
|
|
|
*/
|
2020-03-07 15:41:29 +01:00
|
|
|
getAllObjects(type: "ride"): RideObject[];
|
|
|
|
|
2023-04-30 17:28:41 +02:00
|
|
|
/**
|
|
|
|
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
|
|
|
|
*/
|
2023-04-22 09:52:21 +02:00
|
|
|
getAllObjects(type: "music"): LoadedObject[];
|
2020-03-07 15:41:29 +01:00
|
|
|
|
2022-03-13 04:02:55 +01:00
|
|
|
/**
|
|
|
|
* Gets the {@link TrackSegment} for the given type.
|
|
|
|
* @param type The track segment type.
|
|
|
|
*/
|
2022-05-17 20:33:04 +02:00
|
|
|
getTrackSegment(type: number): TrackSegment | null;
|
2022-03-12 16:47:59 +01:00
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
getAllTrackSegments(): TrackSegment[];
|
|
|
|
|
2022-12-13 00:03:16 +01:00
|
|
|
/**
|
|
|
|
* Gets the image number for the given icon.
|
|
|
|
* @param iconName The name of the icon.
|
|
|
|
*/
|
|
|
|
getIcon(iconName: IconName): number;
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Gets a random integer within the specified range using the game's pseudo-
|
|
|
|
* random number generator. This is part of the game state and shared across
|
|
|
|
* all clients, you therefore must be in a context that can mutate the game
|
|
|
|
* state. Use this to generate random numbers instead of Math.Random during
|
|
|
|
* game logic routines such as hooks and game actions.
|
|
|
|
* @param min The minimum value inclusive.
|
|
|
|
* @param max The maximum value exclusive.
|
|
|
|
*/
|
|
|
|
getRandom(min: number, max: number): number;
|
|
|
|
|
2020-11-23 00:17:40 +01:00
|
|
|
/**
|
|
|
|
* Formats a new string using the given format string and the arguments.
|
|
|
|
* @param fmt The format string, e.g. "Guests: {COMMA16}"
|
|
|
|
* @param args The arguments to insert into the string.
|
|
|
|
*/
|
|
|
|
formatString(fmt: string, ...args: any[]): string;
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Registers a new game action that allows clients to interact with the game.
|
|
|
|
* @param action The unique name of the action.
|
|
|
|
* @param query Logic for validating and returning a price for an action.
|
|
|
|
* @param execute Logic for validating and executing the action.
|
|
|
|
* @throws An error if the action has already been registered by this or another plugin.
|
|
|
|
*/
|
2023-01-15 21:52:23 +01:00
|
|
|
registerAction<T = object>(
|
2020-03-07 14:11:08 +01:00
|
|
|
action: string,
|
2023-01-15 21:52:23 +01:00
|
|
|
query: (args: GameActionEventArgs<T>) => GameActionResult,
|
|
|
|
execute: (args: GameActionEventArgs<T>) => GameActionResult): void;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Query the result of running a game action. This allows you to check the outcome and validity of
|
|
|
|
* an action without actually executing it.
|
|
|
|
* @param action The name of the action.
|
|
|
|
* @param args The action parameters.
|
|
|
|
* @param callback The function to be called with the result of the action.
|
|
|
|
*/
|
2022-01-31 19:49:02 +01:00
|
|
|
queryAction(action: string, args: object, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: ActionType, args: object, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "balloonpress", args: BalloonPressArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "bannerplace", args: BannerPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "bannerremove", args: BannerRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "bannersetcolour", args: BannerSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "bannersetname", args: BannerSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "bannersetstyle", args: BannerSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 14:19:46 +01:00
|
|
|
queryAction(action: "cheatset", args: CheatSetArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "clearscenery", args: ClearSceneryArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "climateset", args: ClimateSetArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "footpathadditionplace", args: FootpathAdditionPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "footpathadditionremove", args: FootpathAdditionRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "footpathplace", args: FootpathPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "footpathlayoutplace", args: FootpathLayoutPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "footpathremove", args: FootpathRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
2023-10-04 17:13:40 +02:00
|
|
|
queryAction(action: "gamesetspeed", args: GameSetSpeedArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "guestsetflags", args: GuestSetFlagsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "guestsetname", args: GuestSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landbuyrights", args: LandBuyRightsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landlower", args: LandLowerArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landraise", args: LandRaiseArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landsetheight", args: LandSetHeightArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landsetrights", args: LandSetRightsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "landsmooth", args: LandSmoothArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "largesceneryplace", args: LargeSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "largesceneryremove", args: LargeSceneryRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "largescenerysetcolour", args: LargeScenerySetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "loadorquit", args: LoadOrQuitArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 13:52:38 +01:00
|
|
|
queryAction(action: "mapchangesize", args: MapChangeSizeArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "mazeplacetrack", args: MazePlaceTrackArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "mazesettrack", args: MazeSetTrackArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "networkmodifygroup", args: NetworkModifyGroupArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parkentranceplace", args: ParkEntrancePlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parkentranceremove", args: ParkEntranceRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parkmarketing", args: ParkMarketingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parksetdate", args: ParkSetDateArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 14:42:28 +01:00
|
|
|
queryAction(action: "parksetentrancefee", args: ParkSetEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "parksetloan", args: ParkSetLoanArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parksetname", args: ParkSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parksetparameter", args: ParkSetParameterArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "parksetresearchfunding", args: ParkSetResearchFundingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "pausetoggle", args: PauseToggleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "peeppickup", args: PeepPickupArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "peepspawnplace", args: PeepSpawnPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "playerkick", args: PlayerKickArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "playersetgroup", args: PlayerSetGroupArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-12 22:14:52 +01:00
|
|
|
queryAction(action: "ridecreate", args: RideCreateArgs, callback?: (result: RideCreateActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "ridedemolish", args: RideDemolishArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "rideentranceexitplace", args: RideEntranceExitPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "rideentranceexitremove", args: RideEntranceExitRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridefreezerating", args: RideFreezeRatingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetappearance", args: RideSetAppearanceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetcolourscheme", args: RideSetColourSchemeArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetname", args: RideSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetprice", args: RideSetPriceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetsetting", args: RideSetSettingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetstatus", args: RideSetStatusArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "ridesetvehicle", args: RideSetVehicleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "scenariosetsetting", args: ScenarioSetSettingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "signsetname", args: SignSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "signsetstyle", args: SignSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "smallsceneryplace", args: SmallSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "smallsceneryremove", args: SmallSceneryRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "smallscenerysetcolour", args: SmallScenerySetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "stafffire", args: StaffFireArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-12 22:14:52 +01:00
|
|
|
queryAction(action: "staffhire", args: StaffHireArgs, callback?: (result: StaffHireNewActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
queryAction(action: "staffsetcolour", args: StaffSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "staffsetcostume", args: StaffSetCostumeArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "staffsetname", args: StaffSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "staffsetorders", args: StaffSetOrdersArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "staffsetpatrolarea", args: StaffSetPatrolAreaArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "surfacesetstyle", args: SurfaceSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "tilemodify", args: TileModifyArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "trackdesign", args: TrackDesignArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "trackplace", args: TrackPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "trackremove", args: TrackRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "tracksetbrakespeed", args: TrackSetBrakeSpeedArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "wallplace", args: WallPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "wallremove", args: WallRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "wallsetcolour", args: WallSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "waterlower", args: WaterLowerArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "waterraise", args: WaterRaiseArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
queryAction(action: "watersetheight", args: WaterSetHeightArgs, callback?: (result: GameActionResult) => void): void;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Executes a game action. In a network game, this will send a request to the server and wait
|
|
|
|
* for the server to reply.
|
|
|
|
* @param action The name of the action.
|
|
|
|
* @param args The action parameters.
|
|
|
|
* @param callback The function to be called with the result of the action.
|
|
|
|
*/
|
2022-01-31 19:49:02 +01:00
|
|
|
executeAction(action: string, args: object, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: ActionType, args: object, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "balloonpress", args: BalloonPressArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "bannerplace", args: BannerPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "bannerremove", args: BannerRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "bannersetcolour", args: BannerSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "bannersetname", args: BannerSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "bannersetstyle", args: BannerSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 14:19:46 +01:00
|
|
|
executeAction(action: "cheatset", args: CheatSetArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "clearscenery", args: ClearSceneryArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "climateset", args: ClimateSetArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "footpathadditionplace", args: FootpathAdditionPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "footpathadditionremove", args: FootpathAdditionRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "footpathplace", args: FootpathPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "footpathlayoutplace", args: FootpathLayoutPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "footpathremove", args: FootpathRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
2023-10-04 17:13:40 +02:00
|
|
|
executeAction(action: "gamesetspeed", args: GameSetSpeedArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "guestsetflags", args: GuestSetFlagsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "guestsetname", args: GuestSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landbuyrights", args: LandBuyRightsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landlower", args: LandLowerArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landraise", args: LandRaiseArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landsetheight", args: LandSetHeightArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landsetrights", args: LandSetRightsArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "landsmooth", args: LandSmoothArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "largesceneryplace", args: LargeSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "largesceneryremove", args: LargeSceneryRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "largescenerysetcolour", args: LargeScenerySetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "loadorquit", args: LoadOrQuitArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 14:19:46 +01:00
|
|
|
executeAction(action: "mapchangesize", args: MapChangeSizeArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "mazeplacetrack", args: MazePlaceTrackArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "mazesettrack", args: MazeSetTrackArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "networkmodifygroup", args: NetworkModifyGroupArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parkentranceplace", args: ParkEntrancePlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parkentranceremove", args: ParkEntranceRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parkmarketing", args: ParkMarketingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parksetdate", args: ParkSetDateArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-02 14:42:28 +01:00
|
|
|
executeAction(action: "parksetentrancefee", args: ParkSetEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "parksetloan", args: ParkSetLoanArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parksetname", args: ParkSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parksetparameter", args: ParkSetParameterArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "parksetresearchfunding", args: ParkSetResearchFundingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "pausetoggle", args: PauseToggleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "peeppickup", args: PeepPickupArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "peepspawnplace", args: PeepSpawnPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "playerkick", args: PlayerKickArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "playersetgroup", args: PlayerSetGroupArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-12 22:14:52 +01:00
|
|
|
executeAction(action: "ridecreate", args: RideCreateArgs, callback?: (result: RideCreateActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "ridedemolish", args: RideDemolishArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "rideentranceexitplace", args: RideEntranceExitPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "rideentranceexitremove", args: RideEntranceExitRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridefreezerating", args: RideFreezeRatingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetappearance", args: RideSetAppearanceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetcolourscheme", args: RideSetColourSchemeArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetname", args: RideSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetprice", args: RideSetPriceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetsetting", args: RideSetSettingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetstatus", args: RideSetStatusArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "ridesetvehicle", args: RideSetVehicleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "scenariosetsetting", args: ScenarioSetSettingArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "signsetname", args: SignSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "signsetstyle", args: SignSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "smallsceneryplace", args: SmallSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "smallsceneryremove", args: SmallSceneryRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "smallscenerysetcolour", args: SmallScenerySetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "stafffire", args: StaffFireArgs, callback?: (result: GameActionResult) => void): void;
|
2023-01-12 22:14:52 +01:00
|
|
|
executeAction(action: "staffhire", args: StaffHireArgs, callback?: (result: StaffHireNewActionResult) => void): void;
|
2022-12-16 22:38:45 +01:00
|
|
|
executeAction(action: "staffsetcolour", args: StaffSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "staffsetcostume", args: StaffSetCostumeArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "staffsetname", args: StaffSetNameArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "staffsetorders", args: StaffSetOrdersArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "staffsetpatrolarea", args: StaffSetPatrolAreaArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "surfacesetstyle", args: SurfaceSetStyleArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "tilemodify", args: TileModifyArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "trackdesign", args: TrackDesignArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "trackplace", args: TrackPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "trackremove", args: TrackRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "tracksetbrakespeed", args: TrackSetBrakeSpeedArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "wallplace", args: WallPlaceArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "wallremove", args: WallRemoveArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "wallsetcolour", args: WallSetColourArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "waterlower", args: WaterLowerArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "waterraise", args: WaterRaiseArgs, callback?: (result: GameActionResult) => void): void;
|
|
|
|
executeAction(action: "watersetheight", args: WaterSetHeightArgs, callback?: (result: GameActionResult) => void): void;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Subscribes to the given hook.
|
|
|
|
*/
|
|
|
|
subscribe(hook: HookType, callback: Function): IDisposable;
|
|
|
|
|
|
|
|
subscribe(hook: "action.query", callback: (e: GameActionEventArgs) => void): IDisposable;
|
|
|
|
subscribe(hook: "action.execute", callback: (e: GameActionEventArgs) => void): IDisposable;
|
|
|
|
subscribe(hook: "interval.tick", callback: () => void): IDisposable;
|
|
|
|
subscribe(hook: "interval.day", callback: () => void): IDisposable;
|
|
|
|
subscribe(hook: "network.chat", callback: (e: NetworkChatEventArgs) => void): IDisposable;
|
2020-04-28 20:33:30 +02:00
|
|
|
subscribe(hook: "network.authenticate", callback: (e: NetworkAuthenticateEventArgs) => void): IDisposable;
|
2020-03-07 14:11:08 +01:00
|
|
|
subscribe(hook: "network.join", callback: (e: NetworkEventArgs) => void): IDisposable;
|
|
|
|
subscribe(hook: "network.leave", callback: (e: NetworkEventArgs) => void): IDisposable;
|
2020-05-11 04:26:10 +02:00
|
|
|
subscribe(hook: "ride.ratings.calculate", callback: (e: RideRatingsCalculateArgs) => void): IDisposable;
|
2020-06-16 21:57:11 +02:00
|
|
|
subscribe(hook: "action.location", callback: (e: ActionLocationArgs) => void): IDisposable;
|
2022-01-17 15:09:21 +01:00
|
|
|
subscribe(hook: "guest.generation", callback: (e: GuestGenerationArgs) => void): IDisposable;
|
2021-07-30 14:03:15 +02:00
|
|
|
subscribe(hook: "vehicle.crash", callback: (e: VehicleCrashArgs) => void): IDisposable;
|
2022-03-07 21:40:48 +01:00
|
|
|
subscribe(hook: "map.save", callback: () => void): IDisposable;
|
2022-03-21 23:56:21 +01:00
|
|
|
subscribe(hook: "map.change", callback: () => void): IDisposable;
|
2021-01-03 16:08:35 +01:00
|
|
|
|
2022-02-20 03:05:24 +01:00
|
|
|
/**
|
|
|
|
* Can only be used in intransient plugins.
|
|
|
|
*/
|
|
|
|
subscribe(hook: "map.changed", callback: () => void): IDisposable;
|
|
|
|
|
2021-01-03 16:08:35 +01:00
|
|
|
/**
|
|
|
|
* Registers a function to be called every so often in realtime, specified by the given delay.
|
|
|
|
* @param callback The function to call every time the delay has elapsed.
|
|
|
|
* @param delay The number of milliseconds to wait between each call to the given function.
|
|
|
|
*/
|
|
|
|
setInterval(callback: Function, delay: number): number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Like `setInterval`, except the callback will only execute once after the given delay.
|
|
|
|
* @param callback The function to call after the given delay has elapsed.
|
|
|
|
* @param delay The number of milliseconds to wait for before calling the given function.
|
|
|
|
*/
|
|
|
|
setTimeout(callback: Function, delay: number): number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the registered interval specified by the numeric handle. The handles
|
|
|
|
* are shared with `setTimeout`.
|
2021-02-27 03:20:47 +01:00
|
|
|
* @param handle
|
2021-01-03 16:08:35 +01:00
|
|
|
*/
|
|
|
|
clearInterval(handle: number): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the registered timeout specified by the numeric handle. The handles
|
|
|
|
* are shared with `setInterval`.
|
|
|
|
* @param handle The numerical handle of the registered timeout to remove.
|
|
|
|
*/
|
|
|
|
clearTimeout(handle: number): void;
|
2020-03-07 14:11:08 +01:00
|
|
|
}
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface Configuration {
|
2022-02-23 22:52:38 +01:00
|
|
|
getAll(namespace?: string): { [name: string]: any };
|
2020-02-18 23:31:43 +01:00
|
|
|
get<T>(key: string): T | undefined;
|
|
|
|
get<T>(key: string, defaultValue: T): T;
|
|
|
|
set<T>(key: string, value: T): void;
|
|
|
|
has(key: string): boolean;
|
|
|
|
}
|
|
|
|
|
2020-05-09 13:55:24 +02:00
|
|
|
interface CaptureOptions {
|
|
|
|
/**
|
|
|
|
* A relative filename from the screenshot directory to save the capture as.
|
|
|
|
* By default, the filename will be automatically generated using the system date and time.
|
|
|
|
*/
|
|
|
|
filename?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Width of the capture in pixels.
|
|
|
|
* Do not set if you would like a giant screenshot.
|
|
|
|
*/
|
|
|
|
width?: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Height of the capture in pixels.
|
|
|
|
* Do not set if you would like a giant screenshot.
|
|
|
|
*/
|
|
|
|
height?: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Map position to centre the view on in map units.
|
|
|
|
* Do not set if you would like a giant screenshot.
|
|
|
|
*/
|
|
|
|
position?: CoordsXY;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The zoom level, 0 is 1:1, 1 is 2:1, 2 is 4:1 etc.
|
|
|
|
*/
|
|
|
|
zoom: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rotation of the camera from 0 to 3.
|
|
|
|
*/
|
|
|
|
rotation: number;
|
2021-02-22 22:48:51 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to enable transparency in the screenshot.
|
|
|
|
*/
|
|
|
|
transparent?: boolean;
|
2020-05-09 13:55:24 +02:00
|
|
|
}
|
|
|
|
|
2022-02-20 19:25:54 +01:00
|
|
|
type GameMode =
|
|
|
|
"normal" |
|
|
|
|
"title" |
|
|
|
|
"scenario_editor" |
|
|
|
|
"track_designer" |
|
|
|
|
"track_manager";
|
|
|
|
|
2020-03-07 15:41:29 +01:00
|
|
|
type ObjectType =
|
|
|
|
"ride" |
|
|
|
|
"small_scenery" |
|
|
|
|
"large_scenery" |
|
|
|
|
"wall" |
|
|
|
|
"banner" |
|
|
|
|
"footpath" |
|
|
|
|
"footpath_addition" |
|
|
|
|
"scenery_group" |
|
|
|
|
"park_entrance" |
|
|
|
|
"water" |
|
|
|
|
"terrain_surface" |
|
|
|
|
"terrain_edge" |
|
|
|
|
"station" |
|
2021-10-27 14:21:14 +02:00
|
|
|
"music" |
|
|
|
|
"footpath_surface" |
|
|
|
|
"footpath_railings";
|
2020-03-07 15:41:29 +01:00
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
type HookType =
|
|
|
|
"interval.tick" | "interval.day" |
|
2020-05-11 04:26:10 +02:00
|
|
|
"network.chat" | "network.action" | "network.join" | "network.leave" |
|
2022-03-07 21:40:48 +01:00
|
|
|
"ride.ratings.calculate" | "action.location" | "vehicle.crash" |
|
2022-03-21 23:56:21 +01:00
|
|
|
"map.change" | "map.changed" | "map.save";
|
2020-02-18 23:31:43 +01:00
|
|
|
|
|
|
|
type ExpenditureType =
|
|
|
|
"ride_construction" |
|
|
|
|
"ride_runningcosts" |
|
|
|
|
"land_purchase" |
|
|
|
|
"landscaping" |
|
|
|
|
"park_entrance_tickets" |
|
|
|
|
"park_ride_tickets" |
|
|
|
|
"shop_sales" |
|
|
|
|
"shop_stock" |
|
|
|
|
"food_drink_sales" |
|
|
|
|
"food_drink_stock" |
|
|
|
|
"wages" |
|
|
|
|
"marketing" |
|
|
|
|
"research" |
|
|
|
|
"interest";
|
|
|
|
|
2020-09-10 13:30:56 +02:00
|
|
|
type ActionType =
|
|
|
|
"balloonpress" |
|
|
|
|
"bannerplace" |
|
|
|
|
"bannerremove" |
|
|
|
|
"bannersetcolour" |
|
|
|
|
"bannersetname" |
|
|
|
|
"bannersetstyle" |
|
2023-01-02 14:19:46 +01:00
|
|
|
"cheatset" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"clearscenery" |
|
|
|
|
"climateset" |
|
2020-11-03 09:17:29 +01:00
|
|
|
"footpathadditionplace" |
|
|
|
|
"footpathadditionremove" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"footpathplace" |
|
|
|
|
"footpathlayoutplace" |
|
|
|
|
"footpathremove" |
|
2023-10-04 17:13:40 +02:00
|
|
|
"gamesetspeed" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"guestsetflags" |
|
|
|
|
"guestsetname" |
|
|
|
|
"landbuyrights" |
|
|
|
|
"landlower" |
|
|
|
|
"landraise" |
|
|
|
|
"landsetheight" |
|
|
|
|
"landsetrights" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"landsmooth" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"largesceneryplace" |
|
|
|
|
"largesceneryremove" |
|
|
|
|
"largescenerysetcolour" |
|
|
|
|
"loadorquit" |
|
2023-01-02 14:19:46 +01:00
|
|
|
"mapchangesize" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"mazeplacetrack" |
|
|
|
|
"mazesettrack" |
|
|
|
|
"networkmodifygroup" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"parkentranceplace" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"parkentranceremove" |
|
|
|
|
"parkmarketing" |
|
|
|
|
"parksetdate" |
|
2023-01-02 14:42:28 +01:00
|
|
|
"parksetentrancefee" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"parksetloan" |
|
|
|
|
"parksetname" |
|
|
|
|
"parksetparameter" |
|
|
|
|
"parksetresearchfunding" |
|
|
|
|
"pausetoggle" |
|
|
|
|
"peeppickup" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"peepspawnplace" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"playerkick" |
|
|
|
|
"playersetgroup" |
|
|
|
|
"ridecreate" |
|
|
|
|
"ridedemolish" |
|
|
|
|
"rideentranceexitplace" |
|
|
|
|
"rideentranceexitremove" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"ridefreezerating" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"ridesetappearance" |
|
|
|
|
"ridesetcolourscheme" |
|
|
|
|
"ridesetname" |
|
|
|
|
"ridesetprice" |
|
|
|
|
"ridesetsetting" |
|
|
|
|
"ridesetstatus" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"ridesetvehicle" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"scenariosetsetting" |
|
|
|
|
"signsetname" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"signsetstyle" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"smallsceneryplace" |
|
|
|
|
"smallsceneryremove" |
|
2022-12-16 22:38:45 +01:00
|
|
|
"smallscenerysetcolour" |
|
2020-09-10 13:30:56 +02:00
|
|
|
"stafffire" |
|
|
|
|
"staffhire" |
|
|
|
|
"staffsetcolour" |
|
|
|
|
"staffsetcostume" |
|
|
|
|
"staffsetname" |
|
|
|
|
"staffsetorders" |
|
|
|
|
"staffsetpatrolarea" |
|
|
|
|
"surfacesetstyle" |
|
|
|
|
"tilemodify" |
|
|
|
|
"trackdesign" |
|
|
|
|
"trackplace" |
|
|
|
|
"trackremove" |
|
|
|
|
"tracksetbrakespeed" |
|
|
|
|
"wallplace" |
|
|
|
|
"wallremove" |
|
|
|
|
"wallsetcolour" |
|
|
|
|
"waterlower" |
|
|
|
|
"waterraise" |
|
|
|
|
"watersetheight";
|
|
|
|
|
2022-12-16 22:38:45 +01:00
|
|
|
|
|
|
|
interface GameActionArgs {
|
|
|
|
flags?: number; // see GAME_COMMAND in openrct2/Game.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BalloonPressArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
object: number;
|
|
|
|
primaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerSetColourArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
primaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerSetNameArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerSetStyleArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
type: number; // 0: primary colour, 1: secondary colour: 2: no entry
|
|
|
|
parameter: number; // primary colour | secondary colour | 0: disable, 1: enable
|
|
|
|
}
|
|
|
|
|
2023-01-02 14:19:46 +01:00
|
|
|
interface CheatSetArgs extends GameActionArgs {
|
|
|
|
type: number; // see CheatType in openrct2/Cheats.h
|
|
|
|
param1: number; // see openrct2/actions/CheatSetAction.cpp
|
|
|
|
param2: number; // see openrct2/actions/CheatSetAction.cpp
|
|
|
|
}
|
|
|
|
|
2022-12-16 22:38:45 +01:00
|
|
|
interface ClearSceneryArgs extends GameActionArgs {
|
|
|
|
itemsToClear: number; // Bit mask. 1: small scenery and walls, 2: large scenery, 4: footpaths.
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ClimateSetArgs extends GameActionArgs {
|
|
|
|
climate: number; // 0: cool and wet, 1: warm, 2: hot and dry, 3: cold
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FootpathAdditionPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
object: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FootpathAdditionRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FootpathPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number; // direction or 0xFF
|
|
|
|
object: number; // surface object
|
|
|
|
railingsObject: number;
|
|
|
|
slope: number; // 0: flat, 4,5,6,7: slope direction + 4
|
|
|
|
constructFlags: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
// see openrct2/actions/FootpathPlaceFromTrackAction
|
|
|
|
interface FootpathLayoutPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
edges: number; // bit mask
|
|
|
|
object: number;
|
|
|
|
railingsObject: number;
|
|
|
|
slope: number; // 0: flat, 4,5,6,7: slope direction + 4
|
|
|
|
constructFlags: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FootpathRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
2023-10-04 17:13:40 +02:00
|
|
|
interface GameSetSpeedArgs extends GameActionArgs {
|
|
|
|
speed: number;
|
|
|
|
}
|
|
|
|
|
2022-12-16 22:38:45 +01:00
|
|
|
// recommendation: use Peep.setFlag instead of the GuestSetFlag action
|
|
|
|
interface GuestSetFlagsArgs extends GameActionArgs {
|
|
|
|
peep: number;
|
|
|
|
guestFlags: number; // see PEEP_FLAGS in openrct2/entity/Peep.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GuestSetNameArgs extends GameActionArgs {
|
|
|
|
peep: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LandBuyRightsArgs extends GameActionArgs {
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
setting: number; // 0: buy land, 1: buy construction rights
|
|
|
|
}
|
|
|
|
|
|
|
|
// x, y specify the centre. Only used for GameActionResult and 3D audio position.
|
|
|
|
// x1, y1, x2, y2 specify a map range
|
|
|
|
interface LandLowerArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
selectionType: number; // see MAP_SELECT_TYPE in openrct2/world/Map.h
|
|
|
|
}
|
|
|
|
|
|
|
|
// x, y specify the centre. Only used for GameActionResult and 3D audio position.
|
|
|
|
// x1, y1, x2, y2 specify a map range
|
|
|
|
interface LandRaiseArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
selectionType: number; // see MAP_SELECT_TYPE in openrct2/world/Map.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LandSetHeightArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
height: number;
|
|
|
|
style: number; // see TILE_ELEMENT_SLOPE in openrct2/world/Surface.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LandSetRightsArgs extends GameActionArgs {
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
setting: number; // 0: unown land, 1: unown construction rights, 2: set for sale, 3: set construction rights for sale, 4: set ownership
|
|
|
|
ownership: number; // only used if setting = 4 (set ownership). See OWNERSHIP in openrct2/world/Surface.h
|
|
|
|
}
|
|
|
|
|
|
|
|
// x, y specify the centre. Only used for GameActionResult and 3D audio position.
|
|
|
|
// x1, y1, x2, y2 specify a map range
|
|
|
|
interface LandSmoothArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
selectionType: number; // see MAP_SELECT_TYPE in openrct2/world/Map.h
|
|
|
|
isLowering: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LargeSceneryPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
object: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LargeSceneryRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
tileIndex: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LargeScenerySetColourArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
tileIndex: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LoadOrQuitArgs extends GameActionArgs {
|
|
|
|
mode: number; // 0: open save prompt, 1: close save prompt
|
|
|
|
savePromptMode: number; // 0: save before load, 1: save before quit. Only used if mode = 0 (open save prompt).
|
|
|
|
}
|
|
|
|
|
2023-01-02 13:52:38 +01:00
|
|
|
interface MapChangeSizeArgs extends GameActionArgs {
|
|
|
|
targetSizeX: number;
|
|
|
|
targetSizeY: number;
|
|
|
|
}
|
|
|
|
|
2022-12-16 22:38:45 +01:00
|
|
|
interface MazePlaceTrackArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
ride: number;
|
|
|
|
mazeEntry: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface MazeSetTrackArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
ride: number;
|
|
|
|
mode: number; // 0: build, 1: move, 2: fill
|
|
|
|
isInitialPlacement: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NetworkModifyGroupArgs extends GameActionArgs {
|
|
|
|
type: number; // 0: add group, 1: remove group, 2: set permissions, 3: set name, 4: set default
|
|
|
|
groupId: number; // ignored if type = 0 (add group)
|
|
|
|
name: string; // only used if type = 3 (set name)
|
|
|
|
permissionIndex: number; // only used if type = 2 (set permissions). See NetworkPermission in openrct2/network/NetworkAction.h
|
|
|
|
permissionState: number; // only used if type = 2 (set permissions). 0: toggle, 1: set all, 2: clear all
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkEntrancePlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
footpathSurfaceObject: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkEntranceRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkMarketingArgs extends GameActionArgs {
|
|
|
|
type: number; // see ADVERTISING_CAMPAIGN in openrct2/management/Marketing.h
|
|
|
|
item: number; // ride id or shop item. See ShopItem in openrct2/ride/ShopItem.h
|
|
|
|
numweeks: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkSetDateArgs extends GameActionArgs {
|
|
|
|
year: number;
|
|
|
|
month: number;
|
|
|
|
day: number;
|
|
|
|
}
|
|
|
|
|
2023-01-02 14:42:28 +01:00
|
|
|
interface ParkSetEntranceFeeArgs extends GameActionArgs {
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
2022-12-16 22:38:45 +01:00
|
|
|
interface ParkSetLoanArgs extends GameActionArgs {
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkSetNameArgs extends GameActionArgs {
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkSetParameterArgs extends GameActionArgs {
|
|
|
|
parameter: number; // 0: close park, 1: open park, 2: set same price in park
|
|
|
|
value: number; // only used if parameter = 2 (set same price in park). Bit mask. See ShopItem in openrct2/ride/ShopItem.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ParkSetResearchFundingArgs extends GameActionArgs {
|
|
|
|
priorities: number; // bit mask. See ResearchCategory in openrct2/management/Research.h
|
|
|
|
fundingAmount: number; // 0: none, 1: minimal, 2: normal, 3: maximum
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PauseToggleArgs extends GameActionArgs {
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PeepPickupArgs extends GameActionArgs {
|
|
|
|
type: number; // 0: pickup, 1: cancel, 2: place
|
|
|
|
id: number;
|
|
|
|
x: number; // unused if type = 0. If type = 1 (cancel), this needs to be the peep's x position BEFORE pickup
|
|
|
|
y: number; // only used if type = 2 (place)
|
|
|
|
z: number; // only used if type = 2 (place)
|
|
|
|
playerId: number; // 0 in single player
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PeepSpawnPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PlayerKickArgs extends GameActionArgs {
|
|
|
|
playerId: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PlayerSetGroupArgs extends GameActionArgs {
|
|
|
|
playerId: number;
|
|
|
|
groupId: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideCreateArgs extends GameActionArgs {
|
|
|
|
rideType: number;
|
|
|
|
rideObject: number;
|
|
|
|
entranceObject: number;
|
|
|
|
colour1: number;
|
|
|
|
colour2: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideDemolishArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
modifyType: number; // 0: demolish, 1: renew
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideEntranceExitPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
direction: number;
|
|
|
|
ride: number;
|
|
|
|
station: number;
|
|
|
|
isExit: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideEntranceExitRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
ride: number;
|
|
|
|
station: number;
|
|
|
|
isExit: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideFreezeRatingArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
type: number; // 0: excitement, 1: intensity, 2: nausea
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetAppearanceArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
type: number; // see RideSetAppearanceType in openrct2/actions/RideSetAppearanceAction.h
|
|
|
|
// value:
|
|
|
|
// - if type is one of the track or vehicle colours: colour
|
|
|
|
// - if type is VehicleColourScheme: 0: all same, 1: per train, 2: per car
|
|
|
|
// - if type is EntranceStyle: entrance style
|
|
|
|
// - if type is SellingItemColourIsRandom: 0: disabled, 1: enabled
|
|
|
|
value: number;
|
|
|
|
index: number; // colour scheme index, only used if type is one of the track or vehicle colours
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetColourSchemeArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
trackType: number;
|
|
|
|
colourScheme: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetNameArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetPriceArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
price: number;
|
|
|
|
isPrimaryPrice: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetSettingArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
setting: number; // see RideSetSetting in openrct2/actions/RideSetSettingAction.h
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetStatusArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
status: number; // 0: closed, 1: open, 2: testing, 3: simulating
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RideSetVehicleArgs extends GameActionArgs {
|
|
|
|
ride: number;
|
|
|
|
type: number; // 0: number of trains, 1: number of cars per train, 2: ride entry
|
|
|
|
value: number; // number value or sub type
|
|
|
|
colour: number; // only used if type is ride entry
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ScenarioSetSettingArgs extends GameActionArgs {
|
|
|
|
setting: number; // see ScenarioSetSetting in openrct2/actions/ScenarioSetSettingAction.h
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SignSetNameArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SignSetStyleArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
mainColour: number;
|
|
|
|
textColour: number;
|
|
|
|
isLarge: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SmallSceneryPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
object: number;
|
|
|
|
quadrant: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
2024-01-06 17:28:00 +01:00
|
|
|
tertiaryColour: number;
|
2022-12-16 22:38:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface SmallSceneryRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
object: number;
|
|
|
|
quadrant: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SmallScenerySetColourArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
quadrant: number;
|
|
|
|
sceneryType: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffFireArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffHireArgs extends GameActionArgs {
|
|
|
|
autoPosition: boolean;
|
|
|
|
staffType: number; // 0: handyman, 1: mechanic, 2: security, 3: entertainer
|
|
|
|
entertainerType: number; // see EntertainerCostume in openrct2/entity/Staff.h
|
|
|
|
staffOrders: number; // bit mask. See STAFF_ORDERS in openrct2/entity/Staff.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffSetColourArgs extends GameActionArgs {
|
|
|
|
staffType: number; // 0: handyman, 1: mechanic, 2: security, 3: entertainer
|
|
|
|
colour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffSetCostumeArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
costume: number; // see EntertainerCostume in openrct2/entity/Staff.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffSetNameArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffSetOrdersArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
staffOrders: number; // bit mask. See STAFF_ORDERS in openrct2/entity/Staff.h
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffSetPatrolAreaArgs extends GameActionArgs {
|
|
|
|
id: number;
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
mode: number; // 0: set, 1: unset, 2: clear all
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SurfaceSetStyleArgs extends GameActionArgs {
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
surfaceStyle: number;
|
|
|
|
edgeStyle: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
// does not support TileModifyType::AnyPaste
|
|
|
|
interface TileModifyArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
setting: number; // see TileModifyType in openrct2/actions/TileModifyAction.h
|
|
|
|
value1: number;
|
|
|
|
value2: number; // see openrct2/actions/TileModifyAction.cpp
|
|
|
|
}
|
|
|
|
|
|
|
|
// currently unsupported
|
|
|
|
interface TrackDesignArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface TrackPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
ride: number;
|
|
|
|
trackType: number;
|
|
|
|
rideType: number;
|
|
|
|
brakeSpeed: number;
|
|
|
|
colour: number;
|
|
|
|
seatRotation: number;
|
|
|
|
trackPlaceFlags: number;
|
|
|
|
isFromTrackDesign: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface TrackRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
trackType: number;
|
|
|
|
sequence: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface TrackSetBrakeSpeedArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
trackType: number;
|
|
|
|
brakeSpeed: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WallPlaceArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
object: number;
|
|
|
|
edge: number; // = direction
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WallRemoveArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WallSetColourArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
direction: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WaterLowerArgs extends GameActionArgs {
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WaterRaiseArgs extends GameActionArgs {
|
|
|
|
x1: number;
|
|
|
|
y1: number;
|
|
|
|
x2: number;
|
|
|
|
y2: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WaterSetHeightArgs extends GameActionArgs {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
height: number;
|
|
|
|
}
|
|
|
|
|
2023-01-15 21:52:23 +01:00
|
|
|
interface GameActionEventArgs<T = object> {
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly player: number;
|
2020-09-10 13:30:56 +02:00
|
|
|
readonly type: number;
|
|
|
|
readonly action: string;
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly isClientOnly: boolean;
|
2023-01-15 21:52:23 +01:00
|
|
|
readonly args: T;
|
2020-03-07 14:11:08 +01:00
|
|
|
result: GameActionResult;
|
|
|
|
}
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface GameActionResult {
|
2020-05-02 12:45:05 +02:00
|
|
|
error?: number;
|
2020-03-01 16:52:18 +01:00
|
|
|
errorTitle?: string;
|
|
|
|
errorMessage?: string;
|
2020-05-02 12:42:43 +02:00
|
|
|
position?: CoordsXYZ;
|
2020-03-04 21:03:13 +01:00
|
|
|
cost?: number;
|
|
|
|
expenditureType?: ExpenditureType;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2023-01-12 22:14:52 +01:00
|
|
|
interface RideCreateActionResult extends GameActionResult {
|
|
|
|
readonly ride?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaffHireNewActionResult extends GameActionResult {
|
|
|
|
readonly peep?: number;
|
2020-03-06 01:04:29 +01:00
|
|
|
}
|
|
|
|
|
2020-03-04 21:03:13 +01:00
|
|
|
interface NetworkEventArgs {
|
|
|
|
readonly player: number;
|
|
|
|
}
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface NetworkChatEventArgs extends NetworkEventArgs {
|
|
|
|
message: string;
|
|
|
|
}
|
|
|
|
|
2020-04-28 20:33:30 +02:00
|
|
|
interface NetworkAuthenticateEventArgs {
|
|
|
|
readonly name: number;
|
|
|
|
readonly ipAddress: string;
|
|
|
|
readonly publicKeyHash: string;
|
|
|
|
cancel: boolean;
|
|
|
|
}
|
|
|
|
|
2020-05-11 04:26:10 +02:00
|
|
|
interface RideRatingsCalculateArgs {
|
|
|
|
readonly rideId: number;
|
|
|
|
excitement: number;
|
|
|
|
intensity: number;
|
|
|
|
nausea: number;
|
|
|
|
}
|
|
|
|
|
2020-06-16 21:57:11 +02:00
|
|
|
interface ActionLocationArgs {
|
|
|
|
readonly x: number;
|
|
|
|
readonly y: number;
|
|
|
|
readonly player: number;
|
|
|
|
readonly type: number;
|
|
|
|
readonly isClientOnly: boolean;
|
|
|
|
result: boolean;
|
|
|
|
}
|
2021-08-11 13:54:00 +02:00
|
|
|
|
2022-01-17 15:09:21 +01:00
|
|
|
interface GuestGenerationArgs {
|
|
|
|
readonly id: number;
|
|
|
|
}
|
|
|
|
|
2021-08-04 16:53:46 +02:00
|
|
|
type VehicleCrashIntoType = "another_vehicle" | "land" | "water";
|
2021-08-11 13:54:00 +02:00
|
|
|
|
2021-08-04 16:53:46 +02:00
|
|
|
interface VehicleCrashArgs {
|
|
|
|
readonly id: number;
|
|
|
|
readonly crashIntoType: VehicleCrashIntoType;
|
|
|
|
}
|
2020-06-16 21:57:11 +02:00
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* APIs for the in-game date.
|
|
|
|
*/
|
|
|
|
interface GameDate {
|
2020-02-18 23:31:43 +01:00
|
|
|
/**
|
2020-03-07 14:11:08 +01:00
|
|
|
* The total number of ticks that have elapsed since the beginning of the game / scenario. This
|
|
|
|
* should never reset.
|
2020-02-18 23:31:43 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly ticksElapsed: number;
|
2020-03-01 16:52:18 +01:00
|
|
|
/**
|
2020-08-26 11:55:10 +02:00
|
|
|
* The total number of months that have elapsed. This will equate to 0 in March, Year 1 and
|
|
|
|
* increase by 1 every month, i.e. by 8 every year.
|
2020-03-07 14:11:08 +01:00
|
|
|
* Note: this represents the current date and may be reset by cheats or scripts.
|
2020-03-01 16:52:18 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
monthsElapsed: number;
|
2020-03-01 16:52:18 +01:00
|
|
|
/**
|
2020-03-07 14:11:08 +01:00
|
|
|
* The total number of years that have elapsed. This always equates to (monthsElapsed / 8).
|
2020-03-01 16:52:18 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly yearsElapsed: number;
|
2020-03-01 16:52:18 +01:00
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
/**
|
2020-03-07 14:11:08 +01:00
|
|
|
* How far through the month we are between 0 and 65536. This is incremented by 4 each tick, so
|
|
|
|
* every month takes ~6.8 minutes to complete making a year take just under an hour.
|
2020-02-18 23:31:43 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
monthProgress: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/** The day of the month from 1 to 31. */
|
|
|
|
readonly day: number;
|
|
|
|
/** The current month of the year from 0 to 7, where 0 is March and 7 is October. */
|
|
|
|
readonly month: number;
|
|
|
|
/** The current year starting from 1. */
|
|
|
|
readonly year: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* APIs for the map.
|
|
|
|
*/
|
|
|
|
interface GameMap {
|
2020-05-02 12:42:43 +02:00
|
|
|
readonly size: CoordsXY;
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly numRides: number;
|
2020-04-21 20:32:08 +02:00
|
|
|
readonly numEntities: number;
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly rides: Ride[];
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
getRide(id: number): Ride;
|
|
|
|
getTile(x: number, y: number): Tile;
|
2020-04-21 20:32:08 +02:00
|
|
|
getEntity(id: number): Entity;
|
2020-05-10 23:20:11 +02:00
|
|
|
getAllEntities(type: EntityType): Entity[];
|
2021-08-04 16:53:46 +02:00
|
|
|
/**
|
|
|
|
* @deprecated since version 34, use guest or staff instead.
|
|
|
|
*/
|
2020-05-10 23:20:11 +02:00
|
|
|
getAllEntities(type: "peep"): Peep[];
|
2021-08-04 16:53:46 +02:00
|
|
|
getAllEntities(type: "guest"): Guest[];
|
|
|
|
getAllEntities(type: "staff"): Staff[];
|
2021-08-11 13:54:00 +02:00
|
|
|
getAllEntities(type: "car"): Car[];
|
|
|
|
getAllEntities(type: "litter"): Litter[];
|
2022-03-20 15:20:08 +01:00
|
|
|
getAllEntitiesOnTile(type: EntityType, tilePos: CoordsXY): Entity[];
|
|
|
|
getAllEntitiesOnTile(type: "guest", tilePos: CoordsXY): Guest[];
|
|
|
|
getAllEntitiesOnTile(type: "staff", tilePos: CoordsXY): Staff[];
|
|
|
|
getAllEntitiesOnTile(type: "car", tilePos: CoordsXY): Car[];
|
|
|
|
getAllEntitiesOnTile(type: "litter", tilePos: CoordsXY): Litter[];
|
2021-08-02 02:34:55 +02:00
|
|
|
createEntity(type: EntityType, initializer: object): Entity;
|
2022-03-13 04:02:55 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a {@link TrackIterator} for the given track element. This can be used to
|
|
|
|
* iterate through a ride's circuit, segment by segment.
|
|
|
|
* @param location The tile coordinates.
|
|
|
|
* @param elementIndex The index of the track element on the tile.
|
|
|
|
*/
|
2022-05-17 20:33:04 +02:00
|
|
|
getTrackIterator(location: CoordsXY, elementIndex: number): TrackIterator | null;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type TileElementType =
|
2021-12-16 21:41:02 +01:00
|
|
|
"surface" | "footpath" | "track" | "small_scenery" | "wall" | "entrance" | "large_scenery" | "banner";
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-08-01 05:46:59 +02:00
|
|
|
type Direction = 0 | 1 | 2 | 3;
|
2022-03-13 14:47:57 +01:00
|
|
|
type Direction8 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
2020-08-01 05:46:59 +02:00
|
|
|
|
2021-03-07 13:45:36 +01:00
|
|
|
type TileElement =
|
|
|
|
SurfaceElement | FootpathElement | TrackElement | SmallSceneryElement | WallElement | EntranceElement
|
2021-12-16 21:41:02 +01:00
|
|
|
| LargeSceneryElement | BannerElement;
|
2021-03-07 13:45:36 +01:00
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface BaseTileElement {
|
|
|
|
type: TileElementType;
|
2020-04-23 00:20:54 +02:00
|
|
|
baseHeight: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
baseZ: number;
|
2020-04-23 00:20:54 +02:00
|
|
|
clearanceHeight: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
clearanceZ: number;
|
2020-09-13 15:55:54 +02:00
|
|
|
occupiedQuadrants: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
isGhost: boolean;
|
2020-05-05 00:05:55 +02:00
|
|
|
isHidden: boolean; /** Take caution when changing this field, it may invalidate TileElements you have stored in your script. */
|
2023-10-08 01:30:43 +02:00
|
|
|
owner: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface SurfaceElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "surface";
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
slope: number;
|
2020-02-29 22:44:40 +01:00
|
|
|
surfaceStyle: number;
|
|
|
|
edgeStyle: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
waterHeight: number;
|
|
|
|
grassLength: number;
|
|
|
|
ownership: number;
|
|
|
|
parkFences: number;
|
2020-02-29 22:44:40 +01:00
|
|
|
|
|
|
|
readonly hasOwnership: boolean;
|
|
|
|
readonly hasConstructionRights: boolean;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface FootpathElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "footpath";
|
|
|
|
|
2021-12-16 21:41:02 +01:00
|
|
|
object: number | null; /** Legacy footpaths, still in use. */
|
|
|
|
surfaceObject: number | null; /** NSF footpaths */
|
|
|
|
railingsObject: number | null; /** NSF footpaths */
|
2021-01-03 18:42:21 +01:00
|
|
|
|
|
|
|
edges: number;
|
|
|
|
corners: number;
|
2020-03-08 12:30:57 +01:00
|
|
|
slopeDirection: number | null;
|
|
|
|
isBlockedByVehicle: boolean;
|
|
|
|
isWide: boolean;
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
isQueue: boolean;
|
2020-03-08 12:30:57 +01:00
|
|
|
queueBannerDirection: number | null;
|
2021-01-03 18:42:21 +01:00
|
|
|
ride: number | null;
|
|
|
|
station: number | null;
|
2020-03-08 12:30:57 +01:00
|
|
|
|
|
|
|
addition: number | null;
|
2021-01-03 18:42:21 +01:00
|
|
|
additionStatus: number | null;
|
|
|
|
isAdditionBroken: boolean | null;
|
|
|
|
isAdditionGhost: boolean | null;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface TrackElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "track";
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
direction: Direction;
|
2020-02-29 22:44:40 +01:00
|
|
|
trackType: number;
|
2021-12-01 14:39:03 +01:00
|
|
|
rideType: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
sequence: number | null;
|
|
|
|
mazeEntry: number | null;
|
|
|
|
|
|
|
|
colourScheme: number | null;
|
|
|
|
seatRotation: number | null;
|
|
|
|
|
2020-02-29 22:44:40 +01:00
|
|
|
ride: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
station: number | null;
|
|
|
|
|
|
|
|
brakeBoosterSpeed: number | null;
|
2020-02-29 22:44:40 +01:00
|
|
|
hasChainLift: boolean;
|
2021-01-03 18:42:21 +01:00
|
|
|
isInverted: boolean;
|
|
|
|
hasCableLift: boolean;
|
2022-03-13 04:02:55 +01:00
|
|
|
isHighlighted: boolean;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface SmallSceneryElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "small_scenery";
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
direction: Direction;
|
2020-02-29 23:08:09 +01:00
|
|
|
object: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
2024-01-15 12:42:40 +01:00
|
|
|
tertiaryColour: number;
|
2020-09-13 15:55:54 +02:00
|
|
|
quadrant: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
age: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
interface WallElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "wall";
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
direction: Direction;
|
2020-02-29 23:08:09 +01:00
|
|
|
object: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
|
|
|
tertiaryColour: number;
|
|
|
|
bannerIndex: number | null;
|
|
|
|
slope: Direction;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
interface EntranceElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "entrance";
|
|
|
|
|
2020-08-01 05:46:59 +02:00
|
|
|
direction: Direction;
|
2021-01-03 18:42:21 +01:00
|
|
|
object: number;
|
|
|
|
ride: number;
|
|
|
|
station: number;
|
|
|
|
sequence: number;
|
2021-12-16 21:41:02 +01:00
|
|
|
footpathObject: number | null;
|
|
|
|
footpathSurfaceObject: number | null;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface LargeSceneryElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "large_scenery";
|
|
|
|
|
2021-01-03 18:42:21 +01:00
|
|
|
direction: Direction;
|
2020-02-29 23:08:09 +01:00
|
|
|
object: number;
|
|
|
|
primaryColour: number;
|
|
|
|
secondaryColour: number;
|
2022-06-09 21:03:32 +02:00
|
|
|
tertiaryColour: number;
|
2021-01-03 18:42:21 +01:00
|
|
|
bannerIndex: number | null;
|
|
|
|
sequence: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface BannerElement extends BaseTileElement {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "banner";
|
2021-01-03 18:42:21 +01:00
|
|
|
direction: Direction;
|
|
|
|
bannerIndex: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-02-28 21:56:04 +01:00
|
|
|
/**
|
|
|
|
* Represents a tile containing tile elements on the map. This is a fixed handle
|
|
|
|
* for a given tile position. It can be re-used safely between game ticks.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
interface Tile {
|
2020-02-28 21:56:04 +01:00
|
|
|
/** The x position in tiles. */
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly x: number;
|
2020-02-28 21:56:04 +01:00
|
|
|
/** The y position in tiles. */
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly y: number;
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Gets an array of all the tile elements on this tile. */
|
2021-03-07 13:45:36 +01:00
|
|
|
readonly elements: TileElement[];
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Gets the number of tile elements on this tile. */
|
|
|
|
readonly numElements: number;
|
|
|
|
/**
|
|
|
|
* Gets or sets the raw data for this tile.
|
|
|
|
* This can provide more control and efficiency for tile manipulation but requires
|
|
|
|
* knowledge of tile element structures and may change between versions of OpenRCT2.
|
|
|
|
*/
|
|
|
|
data: Uint8Array;
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Gets the tile element at the given index on this tile. */
|
2021-03-07 13:45:36 +01:00
|
|
|
getElement(index: number): TileElement;
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Gets the tile element at the given index on this tile. */
|
2021-03-07 13:45:36 +01:00
|
|
|
getElement<T extends TileElement>(index: number): T;
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Inserts a new tile element at the given index on this tile. */
|
2021-03-07 13:45:36 +01:00
|
|
|
insertElement(index: number): TileElement;
|
2020-02-28 21:56:04 +01:00
|
|
|
/** Removes the tile element at the given index from this tile. */
|
|
|
|
removeElement(index: number): void;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2022-04-11 02:34:27 +02:00
|
|
|
type ObjectSourceGame =
|
|
|
|
"rct1" |
|
|
|
|
"added_attractions" |
|
|
|
|
"loopy_landscapes" |
|
|
|
|
"rct2" |
|
|
|
|
"wacky_worlds" |
|
|
|
|
"time_twister" |
|
|
|
|
"custom" |
|
|
|
|
"openrct2_official";
|
|
|
|
|
|
|
|
type ObjectGeneration = "dat" | "json";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents an installed OpenRCT2 object which may or may not be currently loaded into the park.
|
|
|
|
*/
|
|
|
|
interface InstalledObject {
|
|
|
|
/**
|
|
|
|
* The full path of the object file.
|
|
|
|
*/
|
|
|
|
readonly path: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the object is an original .DAT file, or a .parkobj / .json file.
|
|
|
|
*/
|
|
|
|
readonly generation: ObjectGeneration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The object type.
|
|
|
|
*/
|
|
|
|
readonly type: ObjectType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The original game or expansion pack this object first appeared in.
|
|
|
|
*/
|
2022-04-12 00:18:44 +02:00
|
|
|
readonly sourceGames: ObjectSourceGame[];
|
2022-04-11 02:34:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The unique identifier of the object, e.g. "rct2.burgb".
|
2023-04-30 17:28:41 +02:00
|
|
|
* For legacy DAT objects, the identifier will be in a format similar to "09F55405|DirtGras|B9B19A7F".
|
2022-04-11 02:34:27 +02:00
|
|
|
*/
|
|
|
|
readonly identifier: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The original unique identifier of the object, e.g. "BURGB ".
|
|
|
|
* This may have trailing spaces if the name is shorter than 8 characters.
|
|
|
|
* Only .DAT objects or JSON objects based on .DAT objects will have legacy identifiers.
|
|
|
|
*/
|
2023-04-30 18:18:09 +02:00
|
|
|
readonly legacyIdentifier: string | null;
|
2022-04-11 02:34:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The object version, e.g. "1.5.2-pre".
|
|
|
|
*/
|
|
|
|
readonly version: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the list of authors for the object.
|
|
|
|
*/
|
|
|
|
readonly authors: string[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name in the user's current language.
|
|
|
|
*/
|
|
|
|
readonly name: string;
|
|
|
|
}
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2023-04-13 21:09:15 +02:00
|
|
|
* Represents the definition of a loaded object (.DAT or .json) such as ride type or scenery item.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2021-04-21 15:32:55 +02:00
|
|
|
interface LoadedObject {
|
2022-04-11 02:34:27 +02:00
|
|
|
/**
|
|
|
|
* Gets a reference to the installed object.
|
|
|
|
*/
|
|
|
|
readonly installedObject: InstalledObject;
|
|
|
|
|
2020-03-07 15:41:29 +01:00
|
|
|
/**
|
|
|
|
* The object type.
|
|
|
|
*/
|
|
|
|
readonly type: ObjectType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The index of the loaded object for the object type.
|
|
|
|
*/
|
|
|
|
readonly index: number;
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-05-07 20:35:30 +02:00
|
|
|
* The unique identifier of the object, e.g. "rct2.burgb".
|
2023-04-30 17:28:41 +02:00
|
|
|
* For legacy DAT objects, the identifier will be in a format similar to "09F55405|DirtGras|B9B19A7F".
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly identifier: string;
|
2020-05-07 20:35:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The original unique identifier of the object, e.g. "BURGB ".
|
|
|
|
* This may have trailing spaces if the name is shorter than 8 characters.
|
|
|
|
* Only .DAT objects or JSON objects based on .DAT objects will have legacy identifiers.
|
|
|
|
*/
|
|
|
|
readonly legacyIdentifier: string;
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The name in the user's current language.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly name: string;
|
|
|
|
}
|
|
|
|
|
2023-04-13 21:09:15 +02:00
|
|
|
/**
|
|
|
|
* Represents the definition of a loaded object that has one or more associated images.
|
|
|
|
*/
|
|
|
|
interface LoadedImageObject extends LoadedObject {
|
|
|
|
/**
|
|
|
|
* Id of the objects base image. This is also known as the preview image.
|
|
|
|
*/
|
|
|
|
readonly baseImageId: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of images for this object.
|
|
|
|
* Use this in conjunction with the baseImageId to iterate over an objects images.
|
|
|
|
*/
|
|
|
|
readonly numImages: number;
|
|
|
|
}
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* Represents the object definition of a ride or stall.
|
|
|
|
*/
|
2023-04-13 21:09:15 +02:00
|
|
|
interface RideObject extends LoadedImageObject {
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The description of the ride / stall in the player's current language.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly description: string;
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* A text description describing the capacity of the ride in the player's current language.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly capacity: string;
|
2020-05-07 21:53:48 +02:00
|
|
|
|
|
|
|
readonly flags: number;
|
|
|
|
readonly rideType: number[];
|
|
|
|
readonly minCarsInTrain: number;
|
|
|
|
readonly maxCarsInTrain: number;
|
|
|
|
readonly carsPerFlatRide: number;
|
|
|
|
readonly zeroCars: number;
|
|
|
|
readonly tabVehicle: number;
|
|
|
|
readonly defaultVehicle: number;
|
|
|
|
readonly frontVehicle: number;
|
|
|
|
readonly secondVehicle: number;
|
|
|
|
readonly rearVehicle: number;
|
|
|
|
readonly thirdVehicle: number;
|
|
|
|
readonly vehicles: RideObjectVehicle[];
|
|
|
|
readonly excitementMultiplier: number;
|
|
|
|
readonly intensityMultiplier: number;
|
|
|
|
readonly nauseaMultiplier: number;
|
|
|
|
readonly maxHeight: number;
|
|
|
|
readonly shopItem: number;
|
|
|
|
readonly shopItemSecondary: number;
|
|
|
|
}
|
|
|
|
|
2022-06-04 00:03:02 +02:00
|
|
|
/**
|
|
|
|
* Represents a VehicleSpriteGroup
|
|
|
|
*/
|
|
|
|
interface SpriteGroup {
|
|
|
|
readonly imageId: number;
|
|
|
|
readonly spriteNumImages: number;
|
|
|
|
}
|
2022-08-19 22:10:46 +02:00
|
|
|
|
2022-06-04 00:03:02 +02:00
|
|
|
/**
|
|
|
|
* Represents the sprite groups of a vehicle
|
|
|
|
*/
|
|
|
|
interface SpriteGroups {
|
|
|
|
readonly slopeFlat?: SpriteGroup;
|
|
|
|
readonly slopes12?: SpriteGroup;
|
|
|
|
readonly slopes25?: SpriteGroup;
|
|
|
|
readonly slopes42?: SpriteGroup;
|
|
|
|
readonly slopes60?: SpriteGroup;
|
|
|
|
readonly slopes75?: SpriteGroup;
|
|
|
|
readonly slopes90?: SpriteGroup;
|
|
|
|
readonly slopesLoop?: SpriteGroup;
|
|
|
|
readonly slopeInverted?: SpriteGroup;
|
|
|
|
readonly slopes8?: SpriteGroup;
|
|
|
|
readonly slopes16?: SpriteGroup;
|
|
|
|
readonly slopes50?: SpriteGroup;
|
|
|
|
readonly flatBanked22?: SpriteGroup;
|
|
|
|
readonly flatBanked45?: SpriteGroup;
|
|
|
|
readonly flatBanked67?: SpriteGroup;
|
|
|
|
readonly flatBanked90?: SpriteGroup;
|
|
|
|
readonly inlineTwists?: SpriteGroup;
|
|
|
|
readonly slopes12Banked22?: SpriteGroup;
|
|
|
|
readonly slopes8Banked22?: SpriteGroup;
|
|
|
|
readonly slopes25Banked22?: SpriteGroup;
|
2023-04-27 16:11:22 +02:00
|
|
|
readonly slopes8Banked45?: SpriteGroup;
|
|
|
|
readonly slopes16Banked22?: SpriteGroup;
|
|
|
|
readonly slopes16Banked45?: SpriteGroup;
|
2022-06-04 00:03:02 +02:00
|
|
|
readonly slopes25Banked45?: SpriteGroup;
|
|
|
|
readonly slopes12Banked45?: SpriteGroup;
|
2023-04-27 16:11:22 +02:00
|
|
|
readonly slopes25Banked67?: SpriteGroup;
|
|
|
|
readonly slopes25InlineTwists?: SpriteGroup;
|
|
|
|
readonly slopes42Banked22?: SpriteGroup;
|
|
|
|
readonly slopes42Banked45?: SpriteGroup;
|
|
|
|
readonly slopes42Banked90?: SpriteGroup;
|
|
|
|
readonly slopes60Banked22?: SpriteGroup;
|
2022-06-04 00:03:02 +02:00
|
|
|
readonly corkscrews?: SpriteGroup;
|
|
|
|
readonly restraintAnimation?: SpriteGroup;
|
2023-04-27 16:11:22 +02:00
|
|
|
readonly curvedLiftHillUp?: SpriteGroup;
|
|
|
|
readonly curvedLiftHillDown?: SpriteGroup;
|
2022-06-04 00:03:02 +02:00
|
|
|
}
|
2022-08-19 22:10:46 +02:00
|
|
|
|
2020-05-07 21:53:48 +02:00
|
|
|
/**
|
|
|
|
* Represents a defined vehicle within a Ride object definition.
|
|
|
|
*/
|
|
|
|
interface RideObjectVehicle {
|
|
|
|
readonly rotationFrameMask: number;
|
|
|
|
readonly spacing: number;
|
|
|
|
readonly carMass: number;
|
|
|
|
readonly tabHeight: number;
|
|
|
|
readonly numSeats: number;
|
|
|
|
readonly spriteFlags: number;
|
|
|
|
readonly spriteWidth: number;
|
|
|
|
readonly spriteHeightNegative: number;
|
|
|
|
readonly spriteHeightPositive: number;
|
|
|
|
readonly animation: number;
|
|
|
|
readonly flags: number;
|
|
|
|
readonly baseNumFrames: number;
|
|
|
|
readonly baseImageId: number;
|
2022-06-04 00:03:02 +02:00
|
|
|
readonly spriteGroups: SpriteGroups;
|
2020-05-07 21:53:48 +02:00
|
|
|
readonly noVehicleImages: number;
|
|
|
|
readonly noSeatingRows: number;
|
|
|
|
readonly spinningInertia: number;
|
|
|
|
readonly spinningFriction: number;
|
|
|
|
readonly frictionSoundId: number;
|
|
|
|
readonly logFlumeReverserVehicleType: number;
|
|
|
|
readonly soundRange: number;
|
|
|
|
readonly doubleSoundFrequency: number;
|
|
|
|
readonly poweredAcceleration: number;
|
|
|
|
readonly poweredMaxSpeed: number;
|
|
|
|
readonly carVisual: number;
|
|
|
|
readonly effectVisual: number;
|
|
|
|
readonly drawOrder: number;
|
|
|
|
readonly numVerticalFramesOverride: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2023-04-18 00:46:15 +02:00
|
|
|
interface SceneryObject extends LoadedImageObject {
|
|
|
|
/**
|
|
|
|
* A list of scenery groups this object belongs to. This may not contain any
|
|
|
|
* scenery groups that contain this object by default. This is typically
|
|
|
|
* used for custom objects to be part of existing scenery groups.
|
|
|
|
*/
|
2023-04-22 09:52:21 +02:00
|
|
|
readonly sceneryGroups: string[];
|
2020-04-27 18:41:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the object definition of a small scenery item such a tree.
|
|
|
|
*/
|
2023-04-18 00:46:15 +02:00
|
|
|
interface SmallSceneryObject extends SceneryObject {
|
2020-04-27 18:41:49 +02:00
|
|
|
/**
|
|
|
|
* Raw bit flags that describe characteristics of the scenery item.
|
|
|
|
*/
|
|
|
|
readonly flags: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The default clearance height of the scenery item.
|
|
|
|
*/
|
|
|
|
readonly height: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How much the scenery item costs to build.
|
|
|
|
*/
|
|
|
|
readonly price: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How much the scenery item costs to remove.
|
|
|
|
*/
|
|
|
|
readonly removalPrice: number;
|
|
|
|
}
|
|
|
|
|
2023-04-18 00:46:15 +02:00
|
|
|
interface LargeSceneryObject extends SceneryObject {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-04-18 22:55:50 +02:00
|
|
|
interface WallObject extends SceneryObject {
|
2023-04-17 23:35:09 +02:00
|
|
|
|
2023-04-18 00:46:15 +02:00
|
|
|
}
|
|
|
|
|
2023-04-18 22:55:50 +02:00
|
|
|
interface FootpathAdditionObject extends SceneryObject {
|
2023-04-18 00:46:15 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-04-18 22:55:50 +02:00
|
|
|
interface BannerObject extends SceneryObject {
|
2023-04-18 00:46:15 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the object definition of a scenery group.
|
|
|
|
*/
|
|
|
|
interface SceneryGroupObject extends LoadedImageObject {
|
2023-04-17 23:35:09 +02:00
|
|
|
/**
|
2023-04-18 00:46:15 +02:00
|
|
|
* The scenery items that belong to this scenery group.
|
2023-04-17 23:35:09 +02:00
|
|
|
*/
|
2023-04-22 09:52:21 +02:00
|
|
|
readonly items: string[];
|
2023-04-17 23:35:09 +02:00
|
|
|
}
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* Represents a ride or stall within the park.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
interface Ride {
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The object metadata for this ride.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly object: RideObject;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The unique ID / index of the ride.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
readonly id: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The type of the ride represented as the internal built-in ride type ID.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
type: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the ride is a ride, shop or facility.
|
|
|
|
*/
|
|
|
|
readonly classification: RideClassification;
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The generated or custom name of the ride.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
name: string;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the ride is open, closed or testing.
|
|
|
|
*/
|
|
|
|
readonly status: RideStatus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Various flags related to the operation of the ride.
|
|
|
|
*/
|
|
|
|
lifecycleFlags: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The operation mode.
|
|
|
|
*/
|
|
|
|
mode: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flags related to how trains depart.
|
|
|
|
*/
|
|
|
|
departFlags: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum time a train will wait at the station before departing.
|
|
|
|
*/
|
|
|
|
minimumWaitingTime: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum time a train will wait at the station before departing.
|
|
|
|
*/
|
|
|
|
maximumWaitingTime: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The head vehicle IDs associated with the ride, one for each train.
|
|
|
|
*/
|
|
|
|
readonly vehicles: number[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The colour for each vehicle when the ride opens. Modifying this directly will not
|
|
|
|
* change the colour of any currently running trains nor will it reflect them if they
|
|
|
|
* have been modified.
|
|
|
|
*/
|
|
|
|
vehicleColours: VehicleColour[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track colour schemes for the ride.
|
|
|
|
*/
|
|
|
|
colourSchemes: TrackColour[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The style used for the station, entrance, and exit building.
|
|
|
|
*/
|
|
|
|
stationStyle: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The music track to play at each station.
|
|
|
|
*/
|
|
|
|
music: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Information about each station.
|
|
|
|
*/
|
|
|
|
readonly stations: RideStation[];
|
|
|
|
|
|
|
|
/**
|
2020-05-12 21:35:49 +02:00
|
|
|
* The admission price for the ride and the price of the on-ride photo, or the cost of each item of the stall.
|
2020-05-11 01:00:15 +02:00
|
|
|
*/
|
2020-05-12 21:35:49 +02:00
|
|
|
price: number[];
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The excitement metric of the ride represented as a 2 decimal point fixed integer.
|
|
|
|
* For example, `652` equates to `6.52`.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
excitement: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The intensity metric of the ride represented as a 2 decimal point fixed integer.
|
|
|
|
* For example, `652` equates to `6.52`.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
intensity: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The nausea metric of the ride represented as a 2 decimal point fixed integer.
|
|
|
|
* For example, `652` equates to `6.52`.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
nausea: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* The total number of customers the ride has served since it was built.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
totalCustomers: number;
|
2020-05-12 20:11:29 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The date in months when the ride was built.
|
2020-05-16 18:18:27 +02:00
|
|
|
* Subtract this from `date.monthsElapsed` to get the age.
|
2020-05-12 20:11:29 +02:00
|
|
|
*/
|
|
|
|
buildDate: number;
|
2020-05-16 18:18:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* How old the ride is in months.
|
|
|
|
*/
|
|
|
|
readonly age: number;
|
2020-05-12 21:54:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The running cost of the ride billed every fortnight. Multiply this by 16 to get the cost per hour (~ 1 year).
|
|
|
|
*/
|
|
|
|
runningCost: number;
|
|
|
|
|
2020-08-28 23:52:54 +02:00
|
|
|
/**
|
|
|
|
* The total profit of the ride over the course of its lifetime.
|
|
|
|
*/
|
|
|
|
totalProfit: number;
|
|
|
|
|
2020-05-12 21:54:12 +02:00
|
|
|
/**
|
|
|
|
* How often the ride should be inspected by a mechanic.
|
|
|
|
*/
|
|
|
|
inspectionInterval: number;
|
2020-05-15 01:41:37 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The value of the ride.
|
|
|
|
*/
|
|
|
|
value: number;
|
2021-08-11 13:54:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The percentage of downtime for this ride from 0 to 100.
|
|
|
|
*/
|
|
|
|
readonly downtime: number;
|
2022-03-20 16:20:28 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The currently set chain lift speed in miles per hour.
|
|
|
|
*/
|
|
|
|
liftHillSpeed: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The max chain lift speed for this ride in miles per hour.
|
|
|
|
*/
|
|
|
|
readonly maxLiftHillSpeed: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The min chain lift speed for this ride in miles per hour.
|
|
|
|
*/
|
|
|
|
readonly minLiftHillSpeed: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-05-11 01:00:15 +02:00
|
|
|
type RideClassification = "ride" | "stall" | "facility";
|
|
|
|
|
|
|
|
type RideStatus = "closed" | "open" | "testing" | "simulating";
|
|
|
|
|
|
|
|
interface TrackColour {
|
|
|
|
main: number;
|
|
|
|
additional: number;
|
|
|
|
supports: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface VehicleColour {
|
|
|
|
body: number;
|
|
|
|
trim: number;
|
2022-03-21 22:42:10 +01:00
|
|
|
tertiary: number;
|
2020-05-11 01:00:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface RideStation {
|
|
|
|
start: CoordsXYZ;
|
|
|
|
length: number;
|
|
|
|
entrance: CoordsXYZD;
|
|
|
|
exit: CoordsXYZD;
|
|
|
|
}
|
|
|
|
|
2022-03-12 16:47:59 +01:00
|
|
|
interface TrackSegment {
|
|
|
|
/**
|
|
|
|
* The track segment type.
|
|
|
|
*/
|
|
|
|
readonly type: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the localised description of the track segment.
|
|
|
|
*/
|
|
|
|
readonly description: string;
|
|
|
|
|
2022-03-13 14:47:57 +01:00
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The relative starting Z position from the base of the first track sequence block.
|
2022-03-13 14:47:57 +01:00
|
|
|
*/
|
|
|
|
readonly beginZ: number;
|
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
/**
|
|
|
|
* The relative ending Z position from the base of the first track sequence block.
|
|
|
|
*/
|
|
|
|
readonly endZ: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The relative ending X position. BeginX is always 0.
|
|
|
|
*/
|
|
|
|
readonly endX: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The relative ending Y position. BeginY is always 0.
|
|
|
|
*/
|
|
|
|
readonly endY: number;
|
|
|
|
|
2022-04-30 17:09:01 +02:00
|
|
|
/**
|
|
|
|
* The relative starting direction. Usually 0, but will be 4
|
|
|
|
* for diagonal segments.
|
|
|
|
*/
|
2022-03-13 14:47:57 +01:00
|
|
|
readonly beginDirection: Direction8;
|
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
/**
|
|
|
|
* The relative ending direction.
|
|
|
|
*/
|
|
|
|
readonly endDirection: Direction8;
|
|
|
|
|
2022-04-30 17:09:01 +02:00
|
|
|
/**
|
|
|
|
* The slope angle the segment starts with.
|
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly beginSlope: TrackSlope;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The slope angle the segment ends with.
|
|
|
|
*/
|
|
|
|
readonly endSlope: TrackSlope;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The kind of banking the segment starts with.
|
|
|
|
*/
|
|
|
|
readonly beginBank: TrackBanking;
|
|
|
|
|
2022-03-13 14:47:57 +01:00
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The kind of banking the segment ends with.
|
2022-03-13 14:47:57 +01:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly endBank: TrackBanking;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
2022-03-13 14:47:57 +01:00
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The rough length of the segment.
|
2022-03-13 14:47:57 +01:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly length: number;
|
2022-03-13 14:47:57 +01:00
|
|
|
|
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* Gets a list of the elements that make up the track segment.
|
2022-03-13 14:47:57 +01:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly elements: TrackSegmentElement[];
|
2022-03-13 14:47:57 +01:00
|
|
|
|
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The curve direction of the suggested following piece, or track segment if it is specified.
|
2022-03-13 14:47:57 +01:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly nextSuggestedSegment: TrackCurveType | number;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
/**
|
|
|
|
* The curve direction of the suggested preceding piece, or track segment if it is specified.
|
|
|
|
*/
|
|
|
|
readonly previousSuggestedSegment: TrackCurveType | number;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The base price of the track segment.
|
2022-04-30 17:09:01 +02:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly priceModifier: number;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* Track segment representing the mirror image of the track segment.
|
2022-04-30 17:09:01 +02:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly mirrorSegment: number | null;
|
2022-04-30 17:09:01 +02:00
|
|
|
|
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* Track segment representing the covered/flume variant of the track segment.
|
2022-04-30 17:09:01 +02:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly alternateTypeSegment: number | null;
|
2022-03-13 14:47:57 +01:00
|
|
|
|
2022-03-12 16:47:59 +01:00
|
|
|
/**
|
2023-01-25 23:05:18 +01:00
|
|
|
* The group the track element belongs to. Ride types allow or disallow track groups to limit the
|
|
|
|
* buildable track segments.
|
2022-03-12 16:47:59 +01:00
|
|
|
*/
|
2023-01-25 23:05:18 +01:00
|
|
|
readonly trackGroup: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Which direction the track curves towards.
|
|
|
|
*/
|
|
|
|
readonly turnDirection: TrackCurveType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Which direction the track slopes towards.
|
|
|
|
*/
|
|
|
|
readonly slopeDirection: TrackSlopeType;
|
|
|
|
|
|
|
|
readonly onlyAllowedUnderwater: boolean;
|
|
|
|
readonly onlyAllowedAboveGround: boolean;
|
|
|
|
readonly allowsChainLift: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment counts as banked for vehicles with "no banked track" behaviour.
|
|
|
|
*/
|
|
|
|
readonly isBanked: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment counts as an inversion for vehicles with "no inversions" behaviour.
|
|
|
|
*/
|
|
|
|
readonly isInversion: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pevents steep forward chainlifts but allows steep reverse chainlifts for reverse incline
|
|
|
|
* shuttle mode for ride types which do not normally allow steep chainlifts.
|
|
|
|
*/
|
|
|
|
readonly isSteepUp: boolean;
|
2022-08-19 22:10:46 +02:00
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
/**
|
|
|
|
* The track segment begins one height unit above normal track height units.
|
|
|
|
*/
|
|
|
|
readonly startsHalfHeightUp: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment adds to golf hole counter.
|
|
|
|
*/
|
|
|
|
readonly countsAsGolfHole: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment adds to banked turn counter.
|
|
|
|
*/
|
|
|
|
readonly isBankedTurn: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment adds to sloped turn counter.
|
|
|
|
*/
|
|
|
|
readonly isSlopedTurn: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment adds to helix counter.
|
|
|
|
*/
|
|
|
|
readonly isHelix: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The track segment adds to inversion counter. Usually applied to the first half of inversions.
|
|
|
|
*/
|
|
|
|
readonly countsAsInversion: boolean;
|
2023-04-14 22:57:38 +02:00
|
|
|
|
2022-08-21 22:08:22 +02:00
|
|
|
/**
|
2022-08-14 19:52:22 +02:00
|
|
|
* Gets a length of the subpositions list for this track segment.
|
|
|
|
*/
|
|
|
|
getSubpositionLength(subpositionType: number, direction: Direction): number;
|
2022-08-19 22:10:46 +02:00
|
|
|
|
2022-08-21 22:08:22 +02:00
|
|
|
/**
|
2022-08-19 22:10:46 +02:00
|
|
|
* Gets all of the subpositions for this track segment. These subpositions are used for the
|
|
|
|
* pathing of vehicles when moving along the track.
|
|
|
|
*/
|
|
|
|
getSubpositions(subpositionType: number, direction: Direction): TrackSubposition[];
|
2022-03-12 16:47:59 +01:00
|
|
|
}
|
|
|
|
|
2022-05-10 22:54:28 +02:00
|
|
|
enum TrackSlope {
|
|
|
|
None = 0,
|
|
|
|
Up25 = 2,
|
|
|
|
Up60 = 4,
|
|
|
|
Down25 = 6,
|
|
|
|
Down60 = 8,
|
|
|
|
Up90 = 10,
|
|
|
|
Down90 = 18
|
|
|
|
}
|
|
|
|
|
2022-04-30 17:09:01 +02:00
|
|
|
enum TrackBanking {
|
|
|
|
None = 0,
|
|
|
|
Left = 2,
|
|
|
|
Right = 4,
|
|
|
|
UpsideDown = 15
|
|
|
|
}
|
|
|
|
|
2023-01-25 23:05:18 +01:00
|
|
|
type TrackCurveType = "straight" | "left" | "right";
|
|
|
|
type TrackSlopeType = "flat" | "up" | "down";
|
|
|
|
|
2022-08-19 22:10:46 +02:00
|
|
|
interface TrackSegmentElement extends Readonly<CoordsXYZ> {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A single subposition on a track piece. These subpositions are used for the pathing of vehicles
|
|
|
|
* when moving along the track.
|
|
|
|
*/
|
2022-08-21 22:08:22 +02:00
|
|
|
interface TrackSubposition extends Readonly<CoordsXYZ> {
|
|
|
|
readonly yaw: number;
|
|
|
|
readonly pitch: TrackSlope;
|
|
|
|
readonly roll: TrackBanking;
|
2022-03-13 04:02:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface TrackIterator {
|
|
|
|
/**
|
2022-03-13 14:17:56 +01:00
|
|
|
* The position and direction of the current track segment. Usually this is the position of the
|
2022-05-14 17:02:04 +02:00
|
|
|
* first element of the segment, however for some segments, it may be offset.
|
2022-03-13 04:02:55 +01:00
|
|
|
*/
|
2022-04-30 17:09:01 +02:00
|
|
|
readonly position: CoordsXYZD;
|
2022-03-13 04:02:55 +01:00
|
|
|
|
|
|
|
/**
|
2022-03-13 14:17:56 +01:00
|
|
|
* The current track segment.
|
2022-03-13 04:02:55 +01:00
|
|
|
*/
|
2022-05-17 20:33:04 +02:00
|
|
|
readonly segment: TrackSegment | null;
|
2022-03-13 04:02:55 +01:00
|
|
|
|
2022-03-13 14:17:56 +01:00
|
|
|
/**
|
|
|
|
* Gets the position of where the previous track element should start.
|
|
|
|
*/
|
2022-05-17 20:33:04 +02:00
|
|
|
readonly previousPosition: CoordsXYZD | null;
|
2022-03-13 14:17:56 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the position of where the next track element should start.
|
|
|
|
*/
|
2022-05-17 20:33:04 +02:00
|
|
|
readonly nextPosition: CoordsXYZD | null;
|
2022-03-13 14:17:56 +01:00
|
|
|
|
2022-03-13 04:02:55 +01:00
|
|
|
/**
|
|
|
|
* Moves the iterator to the previous track segment.
|
|
|
|
* @returns true if there is a previous segment, otherwise false.
|
|
|
|
*/
|
|
|
|
previous(): boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the iterator to the next track segment.
|
|
|
|
* @returns true if there is a next segment, otherwise false.
|
|
|
|
*/
|
|
|
|
next(): boolean;
|
2022-03-12 16:47:59 +01:00
|
|
|
}
|
|
|
|
|
2020-04-21 20:32:08 +02:00
|
|
|
type EntityType =
|
2021-01-28 20:55:04 +01:00
|
|
|
"balloon" |
|
|
|
|
"car" |
|
|
|
|
"crash_splash" |
|
|
|
|
"crashed_vehicle_particle" |
|
|
|
|
"duck" |
|
|
|
|
"explosion_cloud" |
|
|
|
|
"explosion_flare" |
|
|
|
|
"jumping_fountain_snow" |
|
|
|
|
"jumping_fountain_water" |
|
|
|
|
"litter" |
|
|
|
|
"money_effect" |
|
2021-08-07 19:14:06 +02:00
|
|
|
"guest" |
|
|
|
|
"staff" |
|
|
|
|
"steam_particle" |
|
2021-08-04 16:53:46 +02:00
|
|
|
/**
|
|
|
|
* @deprecated since version 34, use guest or staff instead.
|
|
|
|
*/
|
2021-08-07 19:14:06 +02:00
|
|
|
"peep";
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-04-21 20:32:08 +02:00
|
|
|
* Represents an object "entity" on the map that can typically moves and has a sub-tile coordinate.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-04-21 20:32:08 +02:00
|
|
|
interface Entity {
|
2020-05-08 13:39:47 +02:00
|
|
|
/**
|
2022-02-16 18:53:03 +01:00
|
|
|
* The entity index within the entity list. Returns null for invalid entities.
|
2020-05-08 13:39:47 +02:00
|
|
|
*/
|
2022-02-16 18:53:03 +01:00
|
|
|
readonly id: number | null;
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2021-08-04 16:53:46 +02:00
|
|
|
* The type of entity, e.g. guest, vehicle, etc.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-04-21 20:32:08 +02:00
|
|
|
readonly type: EntityType;
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-04-21 20:32:08 +02:00
|
|
|
* The x-coordinate of the entity in game units.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
x: number;
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-04-21 20:32:08 +02:00
|
|
|
* The y-coordinate of the entity in game units.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
y: number;
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-04-21 20:32:08 +02:00
|
|
|
* The z-coordinate of the entity in game units.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
z: number;
|
2020-05-10 19:07:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the entity from the map.
|
|
|
|
* Note: removing vehicles and peeps that are on rides is currently unsupported.
|
|
|
|
*/
|
|
|
|
remove(): void;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-05-31 02:08:25 +02:00
|
|
|
/**
|
|
|
|
* Represents a single car on a ride. A train is made up of multiple cars, but
|
|
|
|
* something like boat hire will be one car per boat.
|
|
|
|
*/
|
|
|
|
interface Car extends Entity {
|
|
|
|
/**
|
|
|
|
* The ride this car belongs to.
|
|
|
|
*/
|
|
|
|
ride: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ride object for this car, e.g. the ladybird trains object.
|
|
|
|
*/
|
|
|
|
rideObject: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The vehicle type for the ride object used. This is a local index
|
|
|
|
* into the ride object list of vehicle types.
|
|
|
|
*/
|
|
|
|
vehicleObject: number;
|
|
|
|
|
|
|
|
spriteType: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How many seats the car has, i.e. the capacity.
|
|
|
|
*/
|
|
|
|
numSeats: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The next car on the same train. If this is the last or only car on the train,
|
|
|
|
* this will return null.
|
|
|
|
*/
|
|
|
|
nextCarOnTrain: number | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The previous car on the ride. This may be the on the same train or the previous
|
2022-02-16 18:41:59 +01:00
|
|
|
* train. This will return null if there is no previous car.
|
2020-05-31 02:08:25 +02:00
|
|
|
*/
|
2022-02-16 18:41:59 +01:00
|
|
|
previousCarOnRide: number | null;
|
2020-05-31 02:08:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The next car on the ride. This may be the on the same train or the next
|
2022-02-16 18:41:59 +01:00
|
|
|
* train. This will return null if there is no next car.
|
2020-05-31 02:08:25 +02:00
|
|
|
*/
|
2022-02-16 18:41:59 +01:00
|
|
|
nextCarOnRide: number | null;
|
2020-05-31 02:08:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current station the train is in or departing.
|
|
|
|
*/
|
|
|
|
currentStation: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How heavy the car is. This is the sum of the mass of the empty car and the
|
|
|
|
* mass of each guest that is riding it.
|
|
|
|
*/
|
|
|
|
mass: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How much the car's velocity changes per tick.
|
|
|
|
*/
|
|
|
|
acceleration: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How fast the car is moving.
|
|
|
|
*/
|
|
|
|
velocity: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current tilt of the car in the X/Y axis.
|
|
|
|
*/
|
|
|
|
bankRotation: number;
|
2023-04-22 09:52:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the car sprite is reversed or not.
|
|
|
|
*/
|
|
|
|
isReversed: boolean;
|
2020-05-31 02:08:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The colour of the car.
|
|
|
|
*/
|
|
|
|
colours: VehicleColour;
|
|
|
|
|
2020-06-04 21:47:58 +02:00
|
|
|
/**
|
|
|
|
* The acceleration for vehicles with constant power, e.g.
|
|
|
|
* transport rides and boats.
|
|
|
|
*/
|
2020-05-31 02:08:25 +02:00
|
|
|
poweredAcceleration: number;
|
|
|
|
|
2020-06-04 21:47:58 +02:00
|
|
|
/**
|
|
|
|
* The maximum speed for vehicles with constant power, e.g.
|
|
|
|
* transport rides and boats.
|
|
|
|
*/
|
|
|
|
poweredMaxSpeed: number;
|
|
|
|
|
2020-05-31 02:08:25 +02:00
|
|
|
/**
|
|
|
|
* Current status of the car or train.
|
|
|
|
*/
|
|
|
|
status: VehicleStatus;
|
2020-12-21 00:02:37 +01:00
|
|
|
|
2021-02-27 03:44:00 +01:00
|
|
|
/**
|
|
|
|
* The location and direction of where the car is on the track.
|
|
|
|
*/
|
|
|
|
trackLocation: CoordsXYZD;
|
|
|
|
|
2021-03-06 23:25:26 +01:00
|
|
|
/**
|
|
|
|
* The current g-forces of this car.
|
|
|
|
*/
|
2021-03-06 23:41:43 +01:00
|
|
|
readonly gForces: GForces;
|
2021-03-06 23:25:26 +01:00
|
|
|
|
2020-12-15 20:39:49 +01:00
|
|
|
/**
|
|
|
|
* The progress on the current track piece, in steps.
|
|
|
|
*/
|
2020-12-20 23:58:59 +01:00
|
|
|
readonly trackProgress: number;
|
2020-12-21 00:02:37 +01:00
|
|
|
|
2020-12-20 23:58:59 +01:00
|
|
|
/**
|
|
|
|
* The currently projected remaining distance the car will travel.
|
|
|
|
*/
|
|
|
|
readonly remainingDistance: number;
|
2020-05-31 02:08:25 +02:00
|
|
|
|
2022-08-14 19:52:22 +02:00
|
|
|
/**
|
2022-08-19 22:10:46 +02:00
|
|
|
* The type of subposition coordinates that this vehicle is using to find its
|
2022-08-21 22:08:22 +02:00
|
|
|
* position on the track.
|
2022-08-14 19:52:22 +02:00
|
|
|
*/
|
|
|
|
readonly subposition: number;
|
|
|
|
|
2020-05-31 02:08:25 +02:00
|
|
|
/**
|
2021-08-04 16:53:46 +02:00
|
|
|
* List of guest IDs ordered by seat.
|
2021-08-05 16:16:02 +02:00
|
|
|
* @deprecated since version 34, use guests instead.
|
2020-05-31 02:08:25 +02:00
|
|
|
*/
|
2021-02-27 03:20:47 +01:00
|
|
|
peeps: Array<number | null>;
|
2020-12-21 00:02:37 +01:00
|
|
|
|
2021-08-05 16:16:02 +02:00
|
|
|
/**
|
|
|
|
* List of guest IDs ordered by seat.
|
|
|
|
*/
|
|
|
|
guests: Array<number | null>;
|
|
|
|
|
2020-12-20 23:58:59 +01:00
|
|
|
/**
|
2021-02-27 03:20:47 +01:00
|
|
|
* Moves the vehicle forward or backwards along the track, relative to its current
|
|
|
|
* position. A single visible step is about 8.000 to 14.000 in distance depending
|
2020-12-21 00:02:37 +01:00
|
|
|
* on the direction its moving in.
|
2020-12-20 23:58:59 +01:00
|
|
|
*/
|
2020-12-28 21:46:12 +01:00
|
|
|
travelBy(distance: number): void;
|
2020-05-31 02:08:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type VehicleStatus =
|
|
|
|
"arriving" |
|
|
|
|
"crashed" |
|
|
|
|
"crashing" |
|
|
|
|
"crooked_house_operating" |
|
|
|
|
"departing" |
|
|
|
|
"doing_circus_show" |
|
|
|
|
"ferris_wheel_rotating" |
|
|
|
|
"haunted_house_operating" |
|
|
|
|
"moving_to_end_of_station" |
|
|
|
|
"operating_1a" |
|
|
|
|
"rotating" |
|
|
|
|
"showing_film" |
|
|
|
|
"simulator_operating" |
|
|
|
|
"space_rings_operating" |
|
|
|
|
"starting" |
|
|
|
|
"stopped_by_block_brake" |
|
|
|
|
"stopping_1b" |
|
|
|
|
"stopping" |
|
|
|
|
"swinging" |
|
|
|
|
"top_spin_operating" |
|
|
|
|
"travelling_boat" |
|
|
|
|
"travelling_cable_lift" |
|
|
|
|
"travelling_dodgems" |
|
|
|
|
"travelling" |
|
|
|
|
"unloading_passengers_1c" |
|
|
|
|
"unloading_passengers" |
|
|
|
|
"waiting_for_cable_lift" |
|
|
|
|
"waiting_for_passengers_17" |
|
|
|
|
"waiting_for_passengers" |
|
|
|
|
"waiting_to_depart" |
|
|
|
|
"waiting_to_start";
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
|
|
|
* Represents a guest or staff member.
|
2021-08-04 16:53:46 +02:00
|
|
|
* @deprecated since version 34, use guest or staff instead.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-04-21 20:32:08 +02:00
|
|
|
interface Peep extends Entity {
|
2020-05-08 13:39:47 +02:00
|
|
|
/**
|
2020-05-14 02:21:54 +02:00
|
|
|
* Whether the peep is a guest or staff member.
|
2020-05-08 13:39:47 +02:00
|
|
|
*/
|
2020-05-14 02:21:54 +02:00
|
|
|
peepType: PeepType;
|
2020-05-08 13:39:47 +02:00
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-05-08 13:39:47 +02:00
|
|
|
* Name of the peep.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-05-08 13:39:47 +02:00
|
|
|
name: string;
|
|
|
|
|
2020-03-01 13:44:36 +01:00
|
|
|
/**
|
2020-05-14 02:21:54 +02:00
|
|
|
* The peep's direct destination.
|
2020-03-01 13:44:36 +01:00
|
|
|
*/
|
2020-05-14 02:21:54 +02:00
|
|
|
destination: CoordsXY;
|
2020-05-08 13:39:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* How tired the guest is between 32 and 128 where lower is more tired.
|
|
|
|
*/
|
|
|
|
energy: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The target energy value. Energy will increase / decrease slowly towards this value.
|
|
|
|
*/
|
|
|
|
energyTarget: number;
|
|
|
|
|
2020-05-15 01:24:24 +02:00
|
|
|
/**
|
|
|
|
* Gets whether a given flag is set or not.
|
|
|
|
* @param key The flag to test.
|
|
|
|
*/
|
|
|
|
getFlag(key: PeepFlags): boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the given flag to the given value.
|
|
|
|
* @param key The flag to set.
|
|
|
|
* @param value Whether to set or clear the flag.
|
|
|
|
*/
|
|
|
|
setFlag(key: PeepFlags, value: boolean): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
type PeepFlags =
|
|
|
|
"leavingPark" |
|
|
|
|
"slowWalk" |
|
|
|
|
"tracking" |
|
|
|
|
"waving" |
|
|
|
|
"hasPaidForParkEntry" |
|
|
|
|
"photo" |
|
|
|
|
"painting" |
|
|
|
|
"wow" |
|
|
|
|
"litter" |
|
|
|
|
"lost" |
|
|
|
|
"hunger" |
|
|
|
|
"toilet" |
|
|
|
|
"crowded" |
|
|
|
|
"happiness" |
|
|
|
|
"nausea" |
|
|
|
|
"purple" |
|
|
|
|
"pizza" |
|
|
|
|
"explode" |
|
|
|
|
"rideShouldBeMarkedAsFavourite" |
|
|
|
|
"parkEntranceChosen" |
|
|
|
|
"contagious" |
|
|
|
|
"joy" |
|
|
|
|
"angry" |
|
|
|
|
"iceCream" |
|
|
|
|
"hereWeAre";
|
2020-05-14 02:21:54 +02:00
|
|
|
|
2021-08-04 16:53:46 +02:00
|
|
|
/**
|
|
|
|
* @deprecated since version 34, use EntityType instead.
|
|
|
|
*/
|
2020-05-14 02:21:54 +02:00
|
|
|
type PeepType = "guest" | "staff";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a guest.
|
|
|
|
*/
|
|
|
|
interface Guest extends Peep {
|
|
|
|
/**
|
|
|
|
* Colour of the guest's t-shirt.
|
|
|
|
*/
|
|
|
|
tshirtColour: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Colour of the guest's trousers.
|
|
|
|
*/
|
|
|
|
trousersColour: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Colour of the guest's balloon.
|
|
|
|
*/
|
|
|
|
balloonColour: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Colour of the guest's hat.
|
|
|
|
*/
|
|
|
|
hatColour: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Colour of the guest's umbrella.
|
|
|
|
*/
|
|
|
|
umbrellaColour: number;
|
2020-05-08 13:39:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* How happy the guest is between 0 and 255.
|
|
|
|
*/
|
|
|
|
happiness: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The target happiness value. Happiness will increase / decrease slowly towards this value.
|
|
|
|
*/
|
|
|
|
happinessTarget: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How nauseated the guest is between 0 and 255.
|
|
|
|
*/
|
|
|
|
nausea: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The target nausea value. Nausea will increase / decrease slowly towards this value.
|
|
|
|
*/
|
|
|
|
nauseaTarget: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How hungry the guest is between 0 and 255. Lower is more hungry.
|
|
|
|
*/
|
|
|
|
hunger: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How thirsty the guest is between 0 and 255. Lower is more thirsty.
|
|
|
|
*/
|
|
|
|
thirst: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How much the guest requires the need to go to the toilet between 0 and 255.
|
|
|
|
*/
|
|
|
|
toilet: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The mass of the guest. Affects vehicle mass.
|
|
|
|
*/
|
|
|
|
mass: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The guest's minimum preferred intensity between 0 and 15.
|
|
|
|
*/
|
|
|
|
minIntensity: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The guest's maximum preferred intensity between 0 and 15.
|
|
|
|
*/
|
|
|
|
maxIntensity: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The guest's tolerance to nauseating rides between 0 and 3.
|
|
|
|
*/
|
|
|
|
nauseaTolerance: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Amount of cash in the guest's pocket.
|
|
|
|
*/
|
|
|
|
cash: number;
|
2021-08-11 13:54:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the guest is within the boundaries of the park.
|
|
|
|
*/
|
|
|
|
readonly isInPark: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the guest is lost or not. The guest is lost when the countdown is below 90.
|
|
|
|
*/
|
|
|
|
readonly isLost: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Countdown between 0 and 255 that keeps track of how long the guest has been looking for its current destination.
|
|
|
|
*/
|
|
|
|
lostCountdown: number;
|
2022-12-29 16:56:11 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The list of thoughts this guest has.
|
|
|
|
*/
|
|
|
|
readonly thoughts: Thought[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a guest's thought. This is a copy of a thought at a given time
|
|
|
|
* and its values will not update.
|
|
|
|
*/
|
2022-12-30 20:20:02 +01:00
|
|
|
interface Thought {
|
2022-12-29 16:56:11 +01:00
|
|
|
/**
|
|
|
|
* The type of thought.
|
|
|
|
*/
|
|
|
|
readonly type: ThoughtType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The thought argument.
|
|
|
|
*/
|
|
|
|
readonly item: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The freshness of the thought - the larger the number, the less fresh
|
|
|
|
* the thought.
|
|
|
|
*/
|
|
|
|
readonly freshness: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The freshness timeout.
|
|
|
|
*/
|
|
|
|
readonly freshTimeout: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the string for this thought.
|
|
|
|
* The result contains Unicode quotes on either end, e.g. “I feel sick”
|
|
|
|
*/
|
|
|
|
toString(): string;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2022-12-29 16:56:11 +01:00
|
|
|
type ThoughtType =
|
|
|
|
"cant_afford_ride" |
|
|
|
|
"spent_money" |
|
|
|
|
"sick" |
|
|
|
|
"very_sick" |
|
|
|
|
"more_thrilling" |
|
|
|
|
"intense" |
|
|
|
|
"havent_finished" |
|
|
|
|
"sickening" |
|
|
|
|
"bad_value" |
|
|
|
|
"go_home" |
|
|
|
|
"good_value" |
|
|
|
|
"already_got" |
|
|
|
|
"cant_afford_item" |
|
|
|
|
"not_hungry" |
|
|
|
|
"not_thirsty" |
|
|
|
|
"drowning" |
|
|
|
|
"lost" |
|
|
|
|
"was_great" |
|
|
|
|
"queuing_ages" |
|
|
|
|
"tired" |
|
|
|
|
"hungry" |
|
|
|
|
"thirsty" |
|
|
|
|
"toilet" |
|
|
|
|
"cant_find" |
|
|
|
|
"not_paying" |
|
|
|
|
"not_while_raining" |
|
|
|
|
"bad_litter" |
|
|
|
|
"cant_find_exit" |
|
|
|
|
"get_off" |
|
|
|
|
"get_out" |
|
|
|
|
"not_safe" |
|
|
|
|
"path_disgusting" |
|
|
|
|
"crowded" |
|
|
|
|
"vandalism" |
|
|
|
|
"scenery" |
|
|
|
|
"very_clean" |
|
|
|
|
"fountains" |
|
|
|
|
"music" |
|
|
|
|
"balloon" |
|
|
|
|
"toy" |
|
|
|
|
"map" |
|
|
|
|
"photo" |
|
|
|
|
"umbrella" |
|
|
|
|
"drink" |
|
|
|
|
"burger" |
|
|
|
|
"chips" |
|
|
|
|
"ice_cream" |
|
|
|
|
"candyfloss" |
|
|
|
|
"pizza" |
|
|
|
|
"popcorn" |
|
|
|
|
"hot_dog" |
|
|
|
|
"tentacle" |
|
|
|
|
"hat" |
|
|
|
|
"toffee_apple" |
|
|
|
|
"tshirt" |
|
|
|
|
"doughnut" |
|
|
|
|
"coffee" |
|
|
|
|
"chicken" |
|
|
|
|
"lemonade" |
|
|
|
|
"wow" |
|
|
|
|
"wow2" |
|
|
|
|
"watched" |
|
|
|
|
"balloon_much" |
|
|
|
|
"toy_much" |
|
|
|
|
"map_much" |
|
|
|
|
"photo_much" |
|
|
|
|
"umbrella_much" |
|
|
|
|
"drink_much" |
|
|
|
|
"burger_much" |
|
|
|
|
"chips_much" |
|
|
|
|
"ice_cream_much" |
|
|
|
|
"candyfloss_much" |
|
|
|
|
"pizza_much" |
|
|
|
|
"popcorn_much" |
|
|
|
|
"hot_dog_much" |
|
|
|
|
"tentacle_much" |
|
|
|
|
"hat_much" |
|
|
|
|
"toffee_apple_much" |
|
|
|
|
"tshirt_much" |
|
|
|
|
"doughnut_much" |
|
|
|
|
"coffee_much" |
|
|
|
|
"chicken_much" |
|
|
|
|
"lemonade_much" |
|
|
|
|
"photo2" |
|
|
|
|
"photo3" |
|
|
|
|
"photo4" |
|
|
|
|
"pretzel" |
|
|
|
|
"hot_chocolate" |
|
|
|
|
"iced_tea" |
|
|
|
|
"funnel_cake" |
|
|
|
|
"sunglasses" |
|
|
|
|
"beef_noodles" |
|
|
|
|
"fried_rice_noodles" |
|
|
|
|
"wonton_soup" |
|
|
|
|
"meatball_soup" |
|
|
|
|
"fruit_juice" |
|
|
|
|
"soybean_milk" |
|
|
|
|
"sujongkwa" |
|
|
|
|
"sub_sandwich" |
|
|
|
|
"cookie" |
|
|
|
|
"roast_sausage" |
|
|
|
|
"photo2_much" |
|
|
|
|
"photo3_much" |
|
|
|
|
"photo4_much" |
|
|
|
|
"pretzel_much" |
|
|
|
|
"hot_chocolate_much" |
|
|
|
|
"iced_tea_much" |
|
|
|
|
"funnel_cake_much" |
|
|
|
|
"sunglasses_much" |
|
|
|
|
"beef_noodles_much" |
|
|
|
|
"fried_rice_noodles_much" |
|
|
|
|
"wonton_soup_much" |
|
|
|
|
"meatball_soup_much" |
|
|
|
|
"fruit_juice_much" |
|
|
|
|
"soybean_milk_much" |
|
|
|
|
"sujongkwa_much" |
|
|
|
|
"sub_sandwich_much" |
|
|
|
|
"cookie_much" |
|
|
|
|
"roast_sausage_much" |
|
|
|
|
"help" |
|
|
|
|
"running_out" |
|
|
|
|
"new_ride" |
|
|
|
|
"nice_ride_deprecated" |
|
|
|
|
"excited_deprecated" |
|
|
|
|
"here_we_are";
|
|
|
|
|
2020-05-14 02:21:54 +02:00
|
|
|
/**
|
|
|
|
* Represents a staff member.
|
|
|
|
*/
|
|
|
|
interface Staff extends Peep {
|
|
|
|
/**
|
|
|
|
* The type of staff member, e.g. handyman, mechanic.
|
|
|
|
*/
|
|
|
|
staffType: StaffType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Colour of the staff member. Not applicable for entertainers.
|
|
|
|
*/
|
|
|
|
colour: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The entertainer's costume, only applicable for entertainers.
|
|
|
|
*/
|
|
|
|
costume: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The enabled jobs the staff can do, e.g. sweep litter, water plants, inspect rides etc.
|
|
|
|
*/
|
|
|
|
orders: number;
|
2022-02-27 19:17:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the patrol area for the staff member.
|
|
|
|
*/
|
2022-03-21 22:42:10 +01:00
|
|
|
readonly patrolArea: PatrolArea;
|
2020-05-14 02:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type StaffType = "handyman" | "mechanic" | "security" | "entertainer";
|
|
|
|
|
2022-02-27 19:17:29 +01:00
|
|
|
interface PatrolArea {
|
|
|
|
/**
|
|
|
|
* Gets or sets the map coodinates for all individual tiles in the staff member's patrol area.
|
|
|
|
*
|
|
|
|
* Note: fetching all the staff member's patrol area tiles can degrade performance.
|
|
|
|
*/
|
|
|
|
tiles: CoordsXY[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears all tiles from the staff member's patrol area.
|
|
|
|
*/
|
|
|
|
clear(): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the given array of coordinates or a map range to the staff member's patrol area.
|
|
|
|
* @param coords An array of map coordinates, or a map range.
|
|
|
|
*/
|
|
|
|
add(coords: CoordsXY[] | MapRange): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the given array of coordinates or a map range from the staff member's patrol area.
|
|
|
|
* @param coords An array of map coordinates, or a map range.
|
|
|
|
*/
|
|
|
|
remove(coords: CoordsXY[] | MapRange): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks whether a single coordinate is within the staff member's patrol area.
|
|
|
|
* @param coords An map coordinate.
|
|
|
|
*/
|
|
|
|
contains(coord: CoordsXY): boolean;
|
|
|
|
}
|
|
|
|
|
2021-08-07 21:28:48 +02:00
|
|
|
/**
|
|
|
|
* Represents litter entity.
|
|
|
|
*/
|
|
|
|
interface Litter extends Entity {
|
|
|
|
/**
|
|
|
|
* The type of the litter.
|
|
|
|
*/
|
|
|
|
litterType: LitterType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The tick number this entity was created.
|
|
|
|
*/
|
2021-10-15 21:39:58 +02:00
|
|
|
creationTick: number;
|
2021-08-07 21:28:48 +02:00
|
|
|
}
|
|
|
|
|
2021-08-11 13:54:00 +02:00
|
|
|
type LitterType = "vomit" |
|
|
|
|
"vomit_alt" |
|
|
|
|
"empty_can" |
|
|
|
|
"rubbish" |
|
|
|
|
"burger_box" |
|
|
|
|
"empty_cup" |
|
|
|
|
"empty_box" |
|
|
|
|
"empty_bottle" |
|
|
|
|
"empty_bowl_red" |
|
|
|
|
"empty_drink_carton" |
|
|
|
|
"empty_juice_cup" |
|
2021-08-07 21:28:48 +02:00
|
|
|
"empty_bowl_blue";
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
/**
|
|
|
|
* Network APIs
|
2022-02-18 21:59:44 +01:00
|
|
|
* Use `network.mode` to determine whether the current game is a client, server or in single player mode.
|
2020-03-07 14:11:08 +01:00
|
|
|
*/
|
|
|
|
interface Network {
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* The current network mode. This can be used to determine whether the current
|
|
|
|
* session is single player, a multiplayer server, or a multiplayer client.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly mode: NetworkMode;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of multiplayer groups there are in the server.
|
|
|
|
*/
|
2020-04-27 19:39:42 +02:00
|
|
|
readonly numGroups: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of players there are in the server.
|
|
|
|
*/
|
2020-04-27 19:39:42 +02:00
|
|
|
readonly numPlayers: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets all the multiplayer groups within the server. Groups are used to give individual
|
|
|
|
* players roles and permissions.
|
|
|
|
*/
|
2020-04-27 19:39:42 +02:00
|
|
|
readonly groups: PlayerGroup[];
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets all the players that are currently in the server.
|
|
|
|
*/
|
2020-04-27 19:39:42 +02:00
|
|
|
readonly players: Player[];
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The player this instance of the game is controlling.
|
|
|
|
*/
|
2020-05-03 14:53:36 +02:00
|
|
|
readonly currentPlayer: Player;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets or sets the default group ID that new players joining the server should be assigned to.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
defaultGroup: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Various statistics related to networking.
|
|
|
|
*/
|
2021-02-01 00:23:22 +01:00
|
|
|
readonly stats: NetworkStats;
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* Creates a new multiplayer group for managing player permissions.
|
|
|
|
*/
|
2020-04-27 19:39:42 +02:00
|
|
|
addGroup(): void;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the player group with the specified ID.
|
|
|
|
* @param id The group ID. Prior to API version 77, this is the group index.
|
|
|
|
*/
|
|
|
|
getGroup(id: number): PlayerGroup;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the player group with the specified ID.
|
|
|
|
* @param id The group ID. Prior to API version 77, this is the group index.
|
|
|
|
*/
|
|
|
|
removeGroup(id: number): void;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Gets the player with the specified ID.
|
|
|
|
* @param id The player ID. Prior to API version 77, this is the player index.
|
|
|
|
*/
|
|
|
|
getPlayer(id: number): Player;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Kicks the player with the specified ID from the server.
|
|
|
|
* @param id The player ID. Prior to API version 77, this is the player index.
|
|
|
|
*/
|
|
|
|
kickPlayer(id: number): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a chat message to all players.
|
|
|
|
* @param message The message text.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
sendMessage(message: string): void;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a chat message to only the specified players.
|
|
|
|
* @param message The message text.
|
|
|
|
* @param players A list of player IDs that should receive the chat message.
|
|
|
|
* Note: the message will be internally transmitted to players via
|
|
|
|
* the server, even if the server is not a recipient.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
sendMessage(message: string, players: number[]): void;
|
2020-08-17 04:53:37 +02:00
|
|
|
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* Creates a new listener that can accept TCP connections on a given port.
|
|
|
|
*/
|
2020-08-26 03:17:27 +02:00
|
|
|
createListener(): Listener;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new TCP client that can connect to a server.
|
|
|
|
*/
|
2020-08-17 04:53:37 +02:00
|
|
|
createSocket(): Socket;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
type NetworkMode = "none" | "server" | "client";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a player within a network game.
|
|
|
|
*/
|
|
|
|
interface Player {
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* The unique ID for the player.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly id: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the player.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly name: string;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The group ID the player is a member of.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
group: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The latest measured ping in milliseconds for the player.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly ping: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of actions the player has successfully executed.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly commandsRan: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The total amount of cash spent from actions performed by the player.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly moneySpent: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The player's IP address.
|
|
|
|
*/
|
2020-04-27 20:54:29 +02:00
|
|
|
readonly ipAddress: string;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A hash of the player's public key used to authenticate with the server.
|
|
|
|
*/
|
2020-04-27 20:54:29 +02:00
|
|
|
readonly publicKeyHash: string;
|
2020-03-07 14:11:08 +01:00
|
|
|
}
|
|
|
|
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* Represents a group in a network game for assigning roles and permissions
|
|
|
|
* to one or more players.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
interface PlayerGroup {
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* The unique ID for the group.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
readonly id: number;
|
2023-05-02 16:25:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the group.
|
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
name: string;
|
|
|
|
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* The permissions granted to each player belonging to the group.
|
|
|
|
*/
|
|
|
|
permissions: PermissionType[];
|
2020-03-07 14:11:08 +01:00
|
|
|
}
|
|
|
|
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* Represents various network statistics.
|
|
|
|
*/
|
2021-02-01 00:23:22 +01:00
|
|
|
interface NetworkStats {
|
2023-05-02 16:25:05 +02:00
|
|
|
/**
|
|
|
|
* The number of bytes received for each category.
|
|
|
|
*/
|
|
|
|
readonly bytesReceived: number[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of bytes sent for each category.
|
|
|
|
*/
|
|
|
|
readonly bytesSent: number[];
|
2021-02-01 00:23:22 +01:00
|
|
|
}
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
type PermissionType =
|
|
|
|
"chat" |
|
|
|
|
"terraform" |
|
|
|
|
"set_water_level" |
|
|
|
|
"toggle_pause" |
|
|
|
|
"create_ride" |
|
|
|
|
"remove_ride" |
|
|
|
|
"build_ride" |
|
|
|
|
"ride_properties" |
|
|
|
|
"scenery" |
|
|
|
|
"path" |
|
|
|
|
"clear_landscape" |
|
|
|
|
"guest" |
|
|
|
|
"staff" |
|
|
|
|
"park_properties" |
|
|
|
|
"park_funding" |
|
|
|
|
"kick_player" |
|
|
|
|
"modify_groups" |
|
|
|
|
"set_player_group" |
|
|
|
|
"cheat" |
|
|
|
|
"toggle_scenery_cluster" |
|
|
|
|
"passwordless_login" |
|
|
|
|
"modify_tile" |
|
|
|
|
"edit_scenario_options";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Park APIs
|
|
|
|
*/
|
|
|
|
|
2020-04-27 18:41:49 +02:00
|
|
|
/**
|
|
|
|
* The type of park message, including icon and behaviour.
|
|
|
|
*/
|
|
|
|
type ParkMessageType =
|
2022-11-18 13:26:52 +01:00
|
|
|
"attraction" | "peep_on_attraction" | "peep" | "money" | "blank" | "research" | "guests" | "award" | "chart" | "campaign";
|
2020-02-18 23:31:43 +01:00
|
|
|
|
|
|
|
interface ParkMessage {
|
2020-05-19 03:59:35 +02:00
|
|
|
/**
|
|
|
|
* Whether the message has been shown and archived.
|
|
|
|
*/
|
|
|
|
readonly isArchived: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The date this message was posted in total elapsed months.
|
|
|
|
*/
|
|
|
|
month: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The day of the month this message was posted.
|
|
|
|
*/
|
|
|
|
day: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How old the message is in number of ticks.
|
|
|
|
*/
|
|
|
|
tickCount: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The format of the message such as the icon and whether location is enabled.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
type: ParkMessageType;
|
2020-05-19 03:59:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The actual message content.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
text: string;
|
2020-04-30 19:51:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ride ID for attraction.
|
|
|
|
* Entity ID for peep_on_attraction or peep.
|
|
|
|
* Researched item for research.
|
|
|
|
*/
|
|
|
|
subject?: number;
|
2020-05-19 03:59:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the message.
|
|
|
|
*/
|
|
|
|
remove(): void;
|
|
|
|
}
|
|
|
|
|
2020-06-17 17:33:38 +02:00
|
|
|
interface ParkMessageDesc {
|
2020-05-19 03:59:35 +02:00
|
|
|
type: ParkMessageType;
|
|
|
|
text: string;
|
|
|
|
subject?: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2020-09-08 01:08:07 +02:00
|
|
|
type ParkFlags =
|
|
|
|
"difficultGuestGeneration" |
|
|
|
|
"difficultParkRating" |
|
|
|
|
"forbidHighConstruction" |
|
|
|
|
"forbidLandscapeChanges" |
|
|
|
|
"forbidMarketingCampaigns" |
|
|
|
|
"forbidTreeRemoval" |
|
|
|
|
"freeParkEntry" |
|
|
|
|
"noMoney" |
|
|
|
|
"open" |
|
|
|
|
"preferLessIntenseRides" |
|
|
|
|
"preferMoreIntenseRides" |
|
|
|
|
"scenarioCompleteNameInput" |
|
|
|
|
"unlockAllPrices";
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface Park {
|
|
|
|
cash: number;
|
|
|
|
rating: number;
|
|
|
|
bankLoan: number;
|
|
|
|
maxBankLoan: number;
|
2020-09-03 22:07:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current entrance fee for the park.
|
|
|
|
*/
|
|
|
|
entranceFee: number;
|
|
|
|
|
2020-12-02 00:00:18 +01:00
|
|
|
/**
|
|
|
|
* The number of guests within the park, not including any outside the park but still
|
|
|
|
* on the map.
|
|
|
|
*/
|
|
|
|
readonly guests: number;
|
|
|
|
|
2021-05-11 13:46:15 +02:00
|
|
|
/**
|
|
|
|
* The maximum number of guests that will spawn naturally (soft guest cap).
|
|
|
|
* In scenarios with difficult guest generation, guests will not spawn above
|
|
|
|
* this value without advertisements.
|
|
|
|
*/
|
|
|
|
readonly suggestedGuestMaximum: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The probability out of 65535 that guests will spawn per tick.
|
|
|
|
* The number of guest spawns per second is equal to
|
|
|
|
* guests per second = 40 * (guestGenerationProbability / 65535)
|
|
|
|
*/
|
|
|
|
readonly guestGenerationProbability: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The average amount of cash guests will spawn with.
|
|
|
|
*/
|
|
|
|
readonly guestInitialCash: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The average happiness guests will spawn at out of 255.
|
|
|
|
*/
|
|
|
|
readonly guestInitialHappiness: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The average hunger guests will spawn at out of 255.
|
|
|
|
*/
|
|
|
|
readonly guestInitialHunger: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The average thirst guests will spawn at out of 255.
|
|
|
|
*/
|
|
|
|
readonly guestInitialThirst: number;
|
|
|
|
|
2020-12-02 00:00:18 +01:00
|
|
|
/**
|
|
|
|
* The park value, will be updated every 512 ticks.
|
|
|
|
*/
|
|
|
|
value: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The company value, will be updated every 512 ticks.
|
|
|
|
* Calculation is: `park.value + park.cash - park.bankLoan`
|
|
|
|
*/
|
|
|
|
companyValue: number;
|
|
|
|
|
2021-05-11 13:46:15 +02:00
|
|
|
/**
|
|
|
|
* The sum of ride values, used to determine the most guests will
|
|
|
|
* pay to enter the park and for some awards.
|
|
|
|
* Calculated as the sum of (ride value - ride price) * 2.
|
|
|
|
*/
|
|
|
|
readonly totalRideValueForMoney: number;
|
|
|
|
|
2020-12-02 00:14:43 +01:00
|
|
|
/**
|
|
|
|
* The total number of guests that have entered the park.
|
|
|
|
*/
|
|
|
|
totalAdmissions: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The total amount of income gained from admissions into the park.
|
|
|
|
*/
|
|
|
|
totalIncomeFromAdmissions: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The purchase price of one tile for park ownership.
|
|
|
|
*/
|
|
|
|
landPrice: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The purchase price of one tile for construction rights.
|
|
|
|
*/
|
|
|
|
constructionRightsPrice: number;
|
|
|
|
|
2021-08-11 13:54:00 +02:00
|
|
|
/**
|
|
|
|
* The amount of penalty points currentlty applied to the park rating for
|
|
|
|
* drowned guests and crashed coaster cars.
|
|
|
|
*/
|
|
|
|
casualtyPenalty: number;
|
|
|
|
|
2020-12-02 00:14:43 +01:00
|
|
|
/**
|
|
|
|
* The number of tiles on the map with park ownership or construction rights.
|
|
|
|
* Updated every 4096 ticks.
|
|
|
|
*/
|
|
|
|
readonly parkSize: number;
|
|
|
|
|
2023-04-17 22:25:19 +02:00
|
|
|
/**
|
|
|
|
* The name of the park, shown on the park entrance.
|
|
|
|
* Not the name of the scenario.
|
|
|
|
*/
|
2020-06-17 17:33:38 +02:00
|
|
|
name: string;
|
2023-04-17 22:25:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current research status, and what
|
|
|
|
* has and hasn't yet been researched.
|
|
|
|
*/
|
|
|
|
readonly research: Research;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The park message / notification queue, and historical messages.
|
|
|
|
*/
|
2020-05-19 03:59:35 +02:00
|
|
|
messages: ParkMessage[];
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2020-09-08 01:08:07 +02:00
|
|
|
/**
|
|
|
|
* Gets whether a given flag is set or not.
|
|
|
|
* @param key The flag to test.
|
|
|
|
*/
|
|
|
|
getFlag(flag: ParkFlags): boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the given flag to the given value.
|
|
|
|
* @param key The flag to set.
|
|
|
|
* @param value Whether to set or clear the flag.
|
|
|
|
*/
|
|
|
|
setFlag(flag: ParkFlags, value: boolean): void;
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
postMessage(message: string): void;
|
2020-05-19 03:59:35 +02:00
|
|
|
postMessage(message: ParkMessageDesc): void;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
2018-03-20 20:40:38 +01:00
|
|
|
|
2023-04-14 22:57:38 +02:00
|
|
|
interface Research {
|
|
|
|
/**
|
|
|
|
* The list of rides and scenery sets that have already been researched.
|
|
|
|
*/
|
2023-04-15 13:17:56 +02:00
|
|
|
inventedItems: ResearchItem[];
|
2023-04-14 22:57:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The order of rides and scenery sets to be researched.
|
|
|
|
*/
|
2023-04-15 13:17:56 +02:00
|
|
|
uninventedItems: ResearchItem[];
|
2023-04-14 22:57:38 +02:00
|
|
|
|
2023-04-17 22:25:19 +02:00
|
|
|
/**
|
|
|
|
* The last item that was researched, or null if no
|
|
|
|
* item has been researched yet.
|
|
|
|
*/
|
|
|
|
readonly lastResearchedItem: ResearchItem | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The item currently being researched, or null if
|
|
|
|
* research is complete.
|
|
|
|
*/
|
|
|
|
readonly expectedItem: ResearchItem | null;
|
|
|
|
|
2023-04-14 22:57:38 +02:00
|
|
|
/**
|
|
|
|
* The amount of funding currently spent on research.
|
|
|
|
*/
|
|
|
|
funding: ResearchFundingLevel;
|
|
|
|
|
|
|
|
/**
|
2023-04-18 22:36:45 +02:00
|
|
|
* The categories of research which should be prioritised.
|
2023-04-14 22:57:38 +02:00
|
|
|
*/
|
2023-04-18 22:36:45 +02:00
|
|
|
priorities: ResearchCategory[];
|
2023-04-14 22:57:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current stage for the ride or scenery set being researched.
|
|
|
|
*/
|
|
|
|
stage: ResearchFundingStage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The progress for the current stage between 0 and 65535.
|
|
|
|
* This will increment more quickly the higher the research funding.
|
|
|
|
*/
|
|
|
|
progress: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The expected month the current item being researched will complete.
|
|
|
|
* Value is between 0 and 7, 0 being March and 7 being October.
|
|
|
|
* Value is null if there is not yet an expected month.
|
|
|
|
*/
|
|
|
|
readonly expectedMonth: number | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The expected day of the month the current item being researched will complete.
|
2023-04-17 22:25:19 +02:00
|
|
|
* Value is between 1 and 31.
|
2023-04-14 22:57:38 +02:00
|
|
|
* Value is null if there is not yet an expected month.
|
|
|
|
*/
|
|
|
|
readonly expectedDay: number | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether a particular object has been researched and is available to construct.
|
|
|
|
* @param type The type of object, e.g. ride, scenery group, or small scenery.
|
|
|
|
* @param index The object index.
|
|
|
|
*/
|
|
|
|
isObjectResearched(type: ObjectType, index: number): boolean;
|
|
|
|
}
|
|
|
|
|
2023-04-15 13:17:56 +02:00
|
|
|
type ResearchItem = RideResearchItem | SceneryResearchItem;
|
|
|
|
|
|
|
|
interface RideResearchItem {
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly type: "ride";
|
2023-04-15 13:17:56 +02:00
|
|
|
|
2023-04-14 22:57:38 +02:00
|
|
|
/**
|
|
|
|
* The research category this item belongs in.
|
|
|
|
* E.g. gentle rides, thrill rides, shops etc.
|
2023-04-18 22:36:45 +02:00
|
|
|
* Note: Any updates to this field are ignored by OpenRCT2, the category will be derived from the ride type.
|
2023-04-14 22:57:38 +02:00
|
|
|
*/
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly category?: ResearchCategory;
|
2023-04-14 22:57:38 +02:00
|
|
|
|
|
|
|
/**
|
2023-04-15 13:17:56 +02:00
|
|
|
* The ride type. Each vehicle can have a seperate invention for each ride type.
|
2023-04-14 22:57:38 +02:00
|
|
|
*/
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly rideType: number;
|
2023-04-15 13:17:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The ride (vehicle) object index.
|
|
|
|
*/
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly object: number;
|
2023-04-15 13:17:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface SceneryResearchItem {
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly category?: "scenery_group";
|
|
|
|
readonly type: "scenery";
|
2023-04-14 22:57:38 +02:00
|
|
|
|
|
|
|
/**
|
2023-04-15 13:17:56 +02:00
|
|
|
* The scenery set object index.
|
2023-04-14 22:57:38 +02:00
|
|
|
*/
|
2023-04-18 22:36:45 +02:00
|
|
|
readonly object: number;
|
2023-04-14 22:57:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ResearchItemType = "scenery" | "ride";
|
|
|
|
|
2023-04-18 22:36:45 +02:00
|
|
|
type ResearchCategory =
|
|
|
|
"transport" |
|
|
|
|
"gentle" |
|
|
|
|
"rollercoaster" |
|
|
|
|
"thrill" |
|
|
|
|
"water" |
|
|
|
|
"shop" |
|
|
|
|
"scenery";
|
2023-04-14 22:57:38 +02:00
|
|
|
|
|
|
|
enum ResearchFundingLevel {
|
|
|
|
None,
|
|
|
|
Minimum,
|
|
|
|
Normal,
|
|
|
|
Maximum
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResearchFundingStage =
|
|
|
|
"initial_research" |
|
|
|
|
"designing" |
|
|
|
|
"completing_design" |
|
|
|
|
"unknown" |
|
|
|
|
"finished_all";
|
|
|
|
|
2020-09-08 02:08:21 +02:00
|
|
|
type ScenarioObjectiveType =
|
|
|
|
"none" |
|
|
|
|
"guestsBy" |
|
|
|
|
"parkValueBy" |
|
|
|
|
"haveFun" |
|
|
|
|
"buildTheBest" |
|
|
|
|
"10Rollercoasters" |
|
|
|
|
"guestsAndRating" |
|
|
|
|
"monthlyRideIncome" |
|
|
|
|
"10RollercoastersLength" |
|
|
|
|
"finish5Rollercoasters" |
|
2020-11-19 19:45:40 +01:00
|
|
|
"repayLoanAndParkValue" |
|
2020-09-08 02:08:21 +02:00
|
|
|
"monthlyFoodIncome";
|
|
|
|
|
|
|
|
interface ScenarioObjective {
|
|
|
|
/**
|
|
|
|
* The objective type.
|
|
|
|
*/
|
2023-07-10 23:14:30 +02:00
|
|
|
type: ScenarioObjectiveType;
|
2020-09-08 02:08:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The required number of guests.
|
|
|
|
*/
|
|
|
|
guests: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The year the objective must be completed by the end of.
|
|
|
|
*/
|
|
|
|
year: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum length required for each rollercoaster.
|
|
|
|
*/
|
|
|
|
length: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum excitement rating required for each rollercoaster.
|
|
|
|
*/
|
|
|
|
excitement: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum park value required.
|
|
|
|
*/
|
|
|
|
parkValue: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum monthly income from rides / food.
|
|
|
|
*/
|
|
|
|
monthlyIncome: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
type ScenarioStatus = "inProgress" | "completed" | "failed";
|
|
|
|
|
|
|
|
interface Scenario {
|
|
|
|
/**
|
|
|
|
* The name of the scenario. This is not necessarily the name of the park.
|
|
|
|
*/
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The description of the scenario, shown above the scenario objective.
|
|
|
|
*/
|
|
|
|
details: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The entered player name if the scenario is complete.
|
|
|
|
*/
|
|
|
|
completedBy: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The filename of the scenario that is being played. Used to match the
|
|
|
|
* completion score with the scenario file.
|
|
|
|
*/
|
|
|
|
filename: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The criteria required to complete the scenario.
|
|
|
|
*/
|
|
|
|
objective: ScenarioObjective;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of consecutive days the park rating has been under the threshold for.
|
|
|
|
* This is reset when the park rating rises above the threshold again.
|
|
|
|
* Also used to post warning messages.
|
|
|
|
*/
|
|
|
|
parkRatingWarningDays: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The company value when the scenario was completed.
|
|
|
|
*/
|
|
|
|
completedCompanyValue?: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current status of the scenario.
|
|
|
|
*/
|
|
|
|
status: ScenarioStatus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current highest recorded company value.
|
|
|
|
*/
|
|
|
|
companyValueRecord: number;
|
|
|
|
}
|
|
|
|
|
2021-05-17 02:06:36 +02:00
|
|
|
type ClimateType =
|
|
|
|
"coolAndWet" |
|
|
|
|
"warm" |
|
|
|
|
"hotAndDry" |
|
|
|
|
"cold";
|
|
|
|
|
|
|
|
type WeatherType =
|
|
|
|
"sunny" |
|
|
|
|
"partiallyCloudy" |
|
|
|
|
"cloudy" |
|
|
|
|
"rain" |
|
|
|
|
"heavyRain" |
|
|
|
|
"thunder" |
|
|
|
|
"snow" |
|
|
|
|
"heavySnow" |
|
|
|
|
"blizzard";
|
|
|
|
|
|
|
|
interface ClimateState {
|
|
|
|
readonly weather: WeatherType;
|
|
|
|
readonly temperature: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Climate {
|
|
|
|
/**
|
|
|
|
* The climate of the park.
|
|
|
|
*/
|
|
|
|
readonly type: ClimateType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current weather in the park.
|
|
|
|
*/
|
|
|
|
readonly current: ClimateState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The next weather the park will experience.
|
|
|
|
*/
|
|
|
|
readonly future: ClimateState;
|
|
|
|
}
|
|
|
|
|
2020-05-10 18:02:10 +02:00
|
|
|
interface Cheats {
|
|
|
|
allowArbitraryRideTypeChanges: boolean;
|
|
|
|
allowTrackPlaceInvalidHeights: boolean;
|
|
|
|
buildInPauseMode: boolean;
|
|
|
|
disableAllBreakdowns: boolean;
|
|
|
|
disableBrakesFailure: boolean;
|
|
|
|
disableClearanceChecks: boolean;
|
|
|
|
disableLittering: boolean;
|
|
|
|
disablePlantAging: boolean;
|
|
|
|
disableRideValueAging: boolean;
|
|
|
|
disableSupportLimits: boolean;
|
|
|
|
disableTrainLengthLimit: boolean;
|
|
|
|
disableVandalism: boolean;
|
|
|
|
enableAllDrawableTrackPieces: boolean;
|
|
|
|
enableChainLiftOnAllTrack: boolean;
|
|
|
|
fastLiftHill: boolean;
|
|
|
|
freezeWeather: boolean;
|
|
|
|
ignoreResearchStatus: boolean;
|
|
|
|
ignoreRideIntensity: boolean;
|
|
|
|
neverendingMarketing: boolean;
|
|
|
|
sandboxMode: boolean;
|
|
|
|
showAllOperatingModes: boolean;
|
|
|
|
showVehiclesFromOtherTrackTypes: boolean;
|
2022-12-17 18:07:47 +01:00
|
|
|
allowRegularPathAsQueue: boolean;
|
2020-05-10 18:02:10 +02:00
|
|
|
}
|
|
|
|
|
2020-02-06 14:23:04 +01:00
|
|
|
/**
|
2020-02-18 23:31:43 +01:00
|
|
|
* User Interface APIs
|
|
|
|
* These will only be available to servers and clients that are not running headless mode.
|
|
|
|
* Plugin writers should check if ui is available using `typeof ui !== 'undefined'`.
|
2020-02-06 14:23:04 +01:00
|
|
|
*/
|
2020-03-07 14:11:08 +01:00
|
|
|
interface Ui {
|
|
|
|
readonly width: number;
|
|
|
|
readonly height: number;
|
|
|
|
readonly windows: number;
|
|
|
|
readonly mainViewport: Viewport;
|
2020-05-01 18:04:37 +02:00
|
|
|
readonly tileSelection: TileSelection;
|
2021-01-28 20:55:04 +01:00
|
|
|
readonly tool: Tool | null;
|
2021-12-07 21:55:27 +01:00
|
|
|
readonly imageManager: ImageManager;
|
2020-03-07 14:11:08 +01:00
|
|
|
|
|
|
|
getWindow(id: number): Window;
|
2020-04-24 14:26:55 +02:00
|
|
|
getWindow(classification: string): Window;
|
2020-03-07 14:11:08 +01:00
|
|
|
openWindow(desc: WindowDesc): Window;
|
|
|
|
closeWindows(classification: string, id?: number): void;
|
|
|
|
closeAllWindows(): void;
|
|
|
|
|
2020-05-10 19:06:31 +02:00
|
|
|
/**
|
|
|
|
* Show a red error box.
|
|
|
|
* @param title The title / first line of the box.
|
|
|
|
* @param message The message / second line of the box.
|
|
|
|
*/
|
|
|
|
showError(title: string, message: string): void;
|
|
|
|
|
2020-05-09 15:18:50 +02:00
|
|
|
/**
|
|
|
|
* Shows a text input prompt and calls the given callback when entered.
|
|
|
|
* @param desc The parameters for the text input window.
|
|
|
|
*/
|
|
|
|
showTextInput(desc: TextInputDesc): void;
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
/**
|
|
|
|
* Shows the window for loading or saving a file and calls the given callback when a file
|
|
|
|
* is selected.
|
|
|
|
* @param desc The parameters for the file browse window.
|
|
|
|
*/
|
|
|
|
showFileBrowse(desc: FileBrowseDesc): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the scenario select window and calls the given callback when a scenario is
|
|
|
|
* selected.
|
|
|
|
*/
|
|
|
|
showScenarioSelect(desc: ScenarioSelectDesc): void;
|
|
|
|
|
2020-05-01 18:04:37 +02:00
|
|
|
/**
|
|
|
|
* Begins a new tool session. The cursor will change to the style specified by the
|
|
|
|
* given tool descriptor and cursor events will be provided.
|
|
|
|
* @param tool The properties and event handlers for the tool.
|
|
|
|
*/
|
|
|
|
activateTool(tool: ToolDesc): void;
|
|
|
|
|
2020-03-07 14:11:08 +01:00
|
|
|
registerMenuItem(text: string, callback: () => void): void;
|
2020-12-16 01:15:20 +01:00
|
|
|
|
2022-02-20 20:27:43 +01:00
|
|
|
/**
|
|
|
|
* Registers a new item in the toolbox menu on the title screen.
|
|
|
|
* Only available to intransient plugins.
|
|
|
|
* @param text The menu item text.
|
|
|
|
* @param callback The function to call when the menu item is clicked.
|
|
|
|
*/
|
|
|
|
registerToolboxMenuItem(text: string, callback: () => void): void;
|
|
|
|
|
2020-12-16 01:15:20 +01:00
|
|
|
registerShortcut(desc: ShortcutDesc): void;
|
2020-03-07 14:11:08 +01:00
|
|
|
}
|
2020-02-06 14:23:04 +01:00
|
|
|
|
2020-05-09 15:18:50 +02:00
|
|
|
/**
|
|
|
|
* Parameters for the text input window.
|
|
|
|
*/
|
|
|
|
interface TextInputDesc {
|
|
|
|
/**
|
|
|
|
* The title of the text input window.
|
|
|
|
*/
|
|
|
|
title: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The description to show above the text box.
|
|
|
|
*/
|
|
|
|
description: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current value of the text box.
|
|
|
|
*/
|
|
|
|
initialValue?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum length the value can be.
|
|
|
|
*/
|
|
|
|
maxLength?: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function to call when the user has entered a new value and pressed OK.
|
|
|
|
*/
|
|
|
|
callback: (value: string) => void;
|
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
/**
|
|
|
|
* Parameters for the file browse window.
|
|
|
|
*/
|
|
|
|
interface FileBrowseDesc {
|
|
|
|
/**
|
|
|
|
* Whether to browse a file for loading or saving. Saving will prompt the user
|
|
|
|
* before overwriting a file.
|
|
|
|
*/
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "load";
|
2021-01-28 20:55:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of file to browse for.
|
|
|
|
*/
|
2021-03-07 13:45:36 +01:00
|
|
|
fileType: "game" | "heightmap";
|
2021-01-28 20:55:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The pre-selected file to load by default if the user clicks OK.
|
|
|
|
*/
|
|
|
|
defaultPath?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function to call when the user has selected a file.
|
|
|
|
*/
|
|
|
|
callback: (path: string) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parameters for the scenario select window.
|
|
|
|
*/
|
|
|
|
interface ScenarioSelectDesc {
|
|
|
|
/**
|
|
|
|
* The function to call when the user has selected a scenario.
|
|
|
|
*/
|
|
|
|
callback: (scenario: ScenarioFile) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents an installed scenario's path and metadata.
|
|
|
|
*/
|
|
|
|
interface ScenarioFile {
|
|
|
|
id: number;
|
2022-10-05 22:51:37 +02:00
|
|
|
category: "beginner" | "challenging" | "expert" | "real" | "other" | "dlc" | "build_your_own" | "competitions";
|
2022-09-25 12:59:35 +02:00
|
|
|
sourceGame: "rct1" | "rct1_aa" | "rct1_ll" | "rct2" | "rct2_ww" | "rct2_tt" | "real" | "extras" | "other";
|
2021-01-28 20:55:04 +01:00
|
|
|
path: string;
|
|
|
|
internalName: string;
|
|
|
|
name: string;
|
|
|
|
details: string;
|
|
|
|
highscore: {
|
|
|
|
name: string;
|
|
|
|
companyValue: number;
|
2021-02-27 03:20:47 +01:00
|
|
|
};
|
2021-01-28 20:55:04 +01:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:04:37 +02:00
|
|
|
interface TileSelection {
|
2021-11-25 00:00:32 +01:00
|
|
|
range: MapRange | null;
|
2020-05-02 12:42:43 +02:00
|
|
|
tiles: CoordsXY[];
|
2020-05-01 18:04:37 +02:00
|
|
|
}
|
|
|
|
|
2020-05-01 22:32:41 +02:00
|
|
|
interface Tool {
|
|
|
|
id: string;
|
|
|
|
cursor: CursorType;
|
2020-05-01 18:04:37 +02:00
|
|
|
|
2020-05-01 22:32:41 +02:00
|
|
|
cancel: () => void;
|
|
|
|
}
|
2020-05-01 18:04:37 +02:00
|
|
|
|
|
|
|
interface ToolEventArgs {
|
2020-05-01 22:32:41 +02:00
|
|
|
readonly isDown: boolean;
|
2020-05-02 12:42:43 +02:00
|
|
|
readonly screenCoords: ScreenCoordsXY;
|
|
|
|
readonly mapCoords?: CoordsXYZ;
|
2020-05-01 22:32:41 +02:00
|
|
|
readonly tileElementIndex?: number;
|
|
|
|
readonly entityId?: number;
|
2020-05-01 18:04:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the properties and event handlers for a custom tool.
|
|
|
|
*/
|
|
|
|
interface ToolDesc {
|
2020-05-01 22:32:41 +02:00
|
|
|
id: string;
|
2020-05-02 12:38:33 +02:00
|
|
|
cursor?: CursorType;
|
2020-05-01 18:04:37 +02:00
|
|
|
|
2021-02-10 02:06:18 +01:00
|
|
|
/**
|
|
|
|
* What types of object in the game can be selected with the tool.
|
|
|
|
* E.g. only specify terrain if you only want a tile selection.
|
|
|
|
*/
|
|
|
|
filter?: ToolFilter[];
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
onStart?: () => void;
|
|
|
|
onDown?: (e: ToolEventArgs) => void;
|
|
|
|
onMove?: (e: ToolEventArgs) => void;
|
|
|
|
onUp?: (e: ToolEventArgs) => void;
|
|
|
|
onFinish?: () => void;
|
2020-05-01 18:04:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type CursorType =
|
|
|
|
"arrow" |
|
|
|
|
"bench_down" |
|
|
|
|
"bin_down" |
|
2020-05-02 12:38:33 +02:00
|
|
|
"blank" |
|
|
|
|
"cross_hair" |
|
|
|
|
"diagonal_arrows" |
|
|
|
|
"dig_down" |
|
|
|
|
"entrance_down" |
|
2020-05-01 18:04:37 +02:00
|
|
|
"fence_down" |
|
|
|
|
"flower_down" |
|
2020-05-02 12:38:33 +02:00
|
|
|
"fountain_down" |
|
|
|
|
"hand_closed" |
|
|
|
|
"hand_open" |
|
|
|
|
"hand_point" |
|
2020-05-01 18:04:37 +02:00
|
|
|
"house_down" |
|
2020-05-02 12:38:33 +02:00
|
|
|
"lamppost_down" |
|
|
|
|
"paint_down" |
|
|
|
|
"path_down" |
|
|
|
|
"picker" |
|
|
|
|
"statue_down" |
|
|
|
|
"tree_down" |
|
|
|
|
"up_arrow" |
|
|
|
|
"up_down_arrow" |
|
2020-05-01 18:04:37 +02:00
|
|
|
"volcano_down" |
|
|
|
|
"walk_down" |
|
2020-05-02 12:38:33 +02:00
|
|
|
"water_down" |
|
|
|
|
"zzz";
|
2020-05-01 18:04:37 +02:00
|
|
|
|
2021-02-10 02:06:18 +01:00
|
|
|
type ToolFilter =
|
|
|
|
"terrain" |
|
|
|
|
"entity" |
|
|
|
|
"ride" |
|
|
|
|
"water" |
|
|
|
|
"scenery" |
|
|
|
|
"footpath" |
|
|
|
|
"footpath_item" |
|
|
|
|
"park_entrance" |
|
|
|
|
"wall" |
|
|
|
|
"large_scenery" |
|
|
|
|
"label" |
|
|
|
|
"banner";
|
|
|
|
|
2020-12-16 01:15:20 +01:00
|
|
|
interface ShortcutDesc {
|
|
|
|
/**
|
|
|
|
* The unique identifier for the shortcut.
|
|
|
|
* If the identifier already exists, the shortcut will not be registered.
|
|
|
|
* Use full stops to group shortcuts together, e.g. `yourplugin.somewindow.apply`.
|
|
|
|
*/
|
|
|
|
id: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The display text for the shortcut.
|
|
|
|
*/
|
|
|
|
text: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default bindings for the shortcut.
|
|
|
|
* E.g. `["CTRL+SHIFT+L", "MOUSE 3"]`
|
|
|
|
*/
|
|
|
|
bindings?: string[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to call when the shortcut is invoked.
|
|
|
|
*/
|
|
|
|
callback: () => void;
|
|
|
|
}
|
|
|
|
|
2020-02-06 14:23:04 +01:00
|
|
|
/**
|
2020-02-18 23:31:43 +01:00
|
|
|
* Represents the type of a widget, e.g. button or label.
|
2020-02-06 14:23:04 +01:00
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
type WidgetType =
|
2021-02-01 00:23:22 +01:00
|
|
|
"button" | "checkbox" | "colourpicker" | "custom" | "dropdown" | "groupbox" |
|
2021-01-28 20:55:04 +01:00
|
|
|
"label" | "listview" | "spinner" | "textbox" | "viewport";
|
|
|
|
|
|
|
|
type Widget =
|
2021-02-01 00:23:22 +01:00
|
|
|
ButtonWidget | CheckboxWidget | ColourPickerWidget | CustomWidget | DropdownWidget | GroupBoxWidget |
|
2021-04-27 17:14:23 +02:00
|
|
|
LabelWidget | ListViewWidget | SpinnerWidget | TextBoxWidget | ViewportWidget;
|
2022-12-30 20:20:02 +01:00
|
|
|
|
2022-12-13 00:03:16 +01:00
|
|
|
type IconName = "arrow_down" | "arrow_up" | "chat" | "cheats" | "copy" | "empty" | "eyedropper" |
|
|
|
|
"fast_forward" | "game_speed_indicator" | "game_speed_indicator_double" | "glassy_recolourable" |
|
|
|
|
"hide_full" | "hide_partial" | "hide_scenery" | "hide_supports" | "hide_vegetation" | "hide_vehicles" |
|
|
|
|
"large_scenery" | "legacy_paths" | "link_chain" | "logo" | "logo_text" | "map_east" |
|
|
|
|
"map_east_pressed" | "map_gen_land" | "map_gen_noise" | "map_gen_trees" | "map_north" |
|
|
|
|
"map_north_pressed" | "map_south" | "map_south_pressed" | "map_west" | "map_west_pressed" |
|
|
|
|
"mountain_tool_even" | "mountain_tool_odd" | "multiplayer" | "multiplayer_desync" | "multiplayer_sync" |
|
|
|
|
"multiplayer_toolbar" | "multiplayer_toolbar_pressed" | "mute" | "mute_pressed" | "news_messages" |
|
2023-05-21 18:02:28 +02:00
|
|
|
"normal_selection_6x6" | "palette_invisible" | "palette_invisible_pressed" | "paste" | "path_railings" | "path_surfaces" | "paths" | "placeholder" |
|
2022-12-30 20:20:02 +01:00
|
|
|
"rct1_close_off" | "rct1_close_off_pressed" | "rct1_close_on" | "rct1_close_on_pressed" | "rct1_open_off" |
|
2022-12-13 00:03:16 +01:00
|
|
|
"rct1_open_off_pressed" | "rct1_open_on" | "rct1_open_on_pressed" | "rct1_simulate_off" |
|
|
|
|
"rct1_simulate_off_pressed" | "rct1_simulate_on" | "rct1_simulate_on_pressed" | "rct1_test_off" |
|
|
|
|
"rct1_test_off_pressed" | "rct1_test_on" | "rct1_test_on_pressed" | "reload" | "ride_stations" |
|
|
|
|
"scenery_scatter_high" | "scenery_scatter_low" | "scenery_scatter_medium" | "search" |
|
|
|
|
"selection_edge_ne" | "selection_edge_nw" | "selection_edge_se" | "selection_edge_sw" |
|
|
|
|
"server_password" | "sideways_tab" | "sideways_tab_active" | "simulate" | "small_scenery" | "sort" |
|
|
|
|
"terrain_edges" | "title_play" | "title_restart" | "title_skip" | "title_stop" | "unmute" |
|
|
|
|
"unmute_pressed" | "view" | "zoom_in" | "zoom_in_background" | "zoom_out" | "zoom_out_background";
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface WidgetBase {
|
2022-11-05 10:00:09 +01:00
|
|
|
readonly window: Window;
|
|
|
|
readonly type: WidgetType;
|
2020-02-18 23:31:43 +01:00
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
2022-11-05 10:00:09 +01:00
|
|
|
name: string;
|
|
|
|
tooltip: string;
|
|
|
|
isDisabled: boolean;
|
|
|
|
isVisible: boolean;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface ButtonWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "button";
|
2020-04-30 21:32:39 +02:00
|
|
|
/**
|
|
|
|
* Whether the button has a 3D border.
|
|
|
|
* By default, text buttons have borders and image buttons do not but it can be overridden.
|
|
|
|
*/
|
2022-11-05 10:00:09 +01:00
|
|
|
border: boolean;
|
2022-12-13 00:03:16 +01:00
|
|
|
image: number | IconName;
|
2022-11-05 10:00:09 +01:00
|
|
|
isPressed: boolean;
|
|
|
|
text: string;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface CheckboxWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "checkbox";
|
2022-11-05 10:00:09 +01:00
|
|
|
text: string;
|
|
|
|
isChecked: boolean;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface ColourPickerWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "colourpicker";
|
2022-11-05 10:00:09 +01:00
|
|
|
colour: number;
|
2020-12-02 01:21:33 +01:00
|
|
|
}
|
|
|
|
|
2021-02-01 00:23:22 +01:00
|
|
|
interface CustomWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "custom";
|
2021-02-01 00:23:22 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface DropdownWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "dropdown";
|
2022-11-05 10:00:09 +01:00
|
|
|
items: string[];
|
|
|
|
selectedIndex: number;
|
|
|
|
text: string;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface GroupBoxWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "groupbox";
|
2022-11-05 10:00:09 +01:00
|
|
|
text: string;
|
2021-01-28 20:55:04 +01:00
|
|
|
}
|
|
|
|
|
2022-11-05 10:00:09 +01:00
|
|
|
type TextAlignment = "left" | "centred";
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface LabelWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "label";
|
2022-11-05 10:00:09 +01:00
|
|
|
text: string;
|
|
|
|
textAlign: TextAlignment;
|
2020-02-27 20:44:51 +01:00
|
|
|
}
|
|
|
|
|
2021-01-29 00:51:56 +01:00
|
|
|
|
2020-05-02 21:11:07 +02:00
|
|
|
type SortOrder = "none" | "ascending" | "descending";
|
|
|
|
|
2020-05-09 17:06:21 +02:00
|
|
|
type ScrollbarType = "none" | "horizontal" | "vertical" | "both";
|
2020-05-02 21:11:07 +02:00
|
|
|
|
|
|
|
interface ListViewColumn {
|
2022-11-05 10:00:09 +01:00
|
|
|
canSort: boolean;
|
|
|
|
sortOrder: SortOrder;
|
|
|
|
header: string;
|
|
|
|
headerTooltip: string;
|
|
|
|
width: number;
|
|
|
|
ratioWidth: number;
|
|
|
|
minWidth: number;
|
|
|
|
maxWidth: number;
|
2020-12-04 19:46:34 +01:00
|
|
|
}
|
|
|
|
|
2020-05-06 23:34:56 +02:00
|
|
|
interface RowColumn {
|
|
|
|
row: number;
|
|
|
|
column: number;
|
|
|
|
}
|
|
|
|
|
2023-01-06 16:33:36 +01:00
|
|
|
type ListViewItem = ListViewItemSeperator | string[] | string;
|
|
|
|
|
2021-04-27 17:14:23 +02:00
|
|
|
interface ListViewWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "listview";
|
2022-11-05 10:00:09 +01:00
|
|
|
scrollbars: ScrollbarType;
|
|
|
|
isStriped: boolean;
|
|
|
|
showColumnHeaders: boolean;
|
|
|
|
columns: ListViewColumn[];
|
2023-01-06 16:33:36 +01:00
|
|
|
items: ListViewItem[];
|
|
|
|
selectedCell: RowColumn | null;
|
2022-11-05 10:00:09 +01:00
|
|
|
readonly highlightedCell: RowColumn;
|
|
|
|
canSelect: boolean;
|
2020-05-02 21:11:07 +02:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface SpinnerWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "spinner";
|
2022-11-05 10:00:09 +01:00
|
|
|
text: string;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface TextBoxWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "textbox";
|
2022-11-05 10:00:09 +01:00
|
|
|
text: string;
|
|
|
|
maxLength: number;
|
2021-01-23 15:28:07 +01:00
|
|
|
}
|
|
|
|
|
2021-01-28 20:55:04 +01:00
|
|
|
interface ViewportWidget extends WidgetBase {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "viewport";
|
2022-11-05 10:00:09 +01:00
|
|
|
readonly viewport: Viewport;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Window {
|
2022-09-24 07:06:26 +02:00
|
|
|
readonly classification: number;
|
|
|
|
readonly number: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
x: number;
|
|
|
|
y: number;
|
2022-09-24 07:06:26 +02:00
|
|
|
/**
|
|
|
|
* The window is resizable (by the user) if and only if minWidth !== maxWidth or minHeight !== maxHeight.
|
|
|
|
* In that case, the window displays a small widget in the lower right corner that the user can use to resize the window by clicking and dragging.
|
2022-11-05 10:00:09 +01:00
|
|
|
*
|
2022-09-24 07:06:26 +02:00
|
|
|
* When writing to width (or height), if the window is resizable, the new value will be clamped to fit the corresponding min/max values.
|
|
|
|
* Otherwise, if the window is not resizable, both the width (or height) and the corresponding min/max values are set to the new value.
|
2022-11-05 10:00:09 +01:00
|
|
|
*
|
2022-09-24 07:06:26 +02:00
|
|
|
* For the default min/max values, see {@link WindowDesc}.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
width: number;
|
|
|
|
height: number;
|
2020-04-30 21:32:39 +02:00
|
|
|
minWidth: number;
|
|
|
|
maxWidth: number;
|
|
|
|
minHeight: number;
|
|
|
|
maxHeight: number;
|
2022-09-24 07:06:26 +02:00
|
|
|
readonly isSticky: boolean;
|
2020-02-18 23:31:43 +01:00
|
|
|
colours: number[];
|
|
|
|
title: string;
|
2022-09-24 07:06:26 +02:00
|
|
|
readonly widgets: Widget[];
|
2020-04-30 21:32:39 +02:00
|
|
|
tabIndex: number;
|
2020-02-18 23:31:43 +01:00
|
|
|
|
|
|
|
close(): void;
|
2020-02-20 18:58:15 +01:00
|
|
|
bringToFront(): void;
|
|
|
|
findWidget<T extends Widget>(name: string): T;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
2022-11-05 10:00:09 +01:00
|
|
|
type WidgetDesc =
|
|
|
|
ButtonDesc | CheckboxDesc | ColourPickerDesc | CustomDesc | DropdownDesc | GroupBoxDesc |
|
|
|
|
LabelDesc | ListViewDesc | SpinnerDesc | TextBoxDesc | ViewportDesc;
|
|
|
|
|
|
|
|
interface WidgetBaseDesc {
|
|
|
|
type: WidgetType;
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
name?: string;
|
|
|
|
tooltip?: string;
|
|
|
|
isDisabled?: boolean;
|
|
|
|
isVisible?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ButtonDesc extends WidgetBaseDesc {
|
|
|
|
type: "button";
|
|
|
|
/**
|
|
|
|
* Whether the button has a 3D border.
|
|
|
|
* By default, text buttons have borders and image buttons do not but it can be overridden.
|
|
|
|
*/
|
|
|
|
border?: boolean;
|
2022-12-30 20:20:02 +01:00
|
|
|
image?: number | IconName;
|
2022-11-05 10:00:09 +01:00
|
|
|
isPressed?: boolean;
|
|
|
|
text?: string;
|
|
|
|
onClick?: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CheckboxDesc extends WidgetBaseDesc {
|
|
|
|
type: "checkbox";
|
|
|
|
text?: string;
|
|
|
|
isChecked?: boolean;
|
|
|
|
onChange?: (isChecked: boolean) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ColourPickerDesc extends WidgetBaseDesc {
|
|
|
|
type: "colourpicker";
|
|
|
|
colour?: number;
|
|
|
|
onChange?: (colour: number) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CustomDesc extends WidgetBaseDesc {
|
|
|
|
type: "custom";
|
|
|
|
onDraw?: (this: CustomWidget, g: GraphicsContext) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DropdownDesc extends WidgetBaseDesc {
|
|
|
|
type: "dropdown";
|
|
|
|
items?: string[];
|
|
|
|
selectedIndex?: number;
|
|
|
|
onChange?: (index: number) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GroupBoxDesc extends WidgetBaseDesc {
|
|
|
|
type: "groupbox";
|
|
|
|
text?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LabelDesc extends WidgetBaseDesc {
|
|
|
|
type: "label";
|
|
|
|
text?: string;
|
|
|
|
textAlign?: TextAlignment;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListViewItemSeperator {
|
|
|
|
type: "seperator";
|
|
|
|
text?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RowColumn {
|
|
|
|
row: number;
|
|
|
|
column: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListViewDesc extends WidgetBaseDesc {
|
|
|
|
type: "listview";
|
|
|
|
scrollbars?: ScrollbarType;
|
|
|
|
isStriped?: boolean;
|
|
|
|
showColumnHeaders?: boolean;
|
|
|
|
columns?: Partial<ListViewColumn>[];
|
2023-01-06 16:33:36 +01:00
|
|
|
items?: ListViewItem[];
|
2022-11-05 10:00:09 +01:00
|
|
|
selectedCell?: RowColumn;
|
|
|
|
canSelect?: boolean;
|
|
|
|
onHighlight?: (item: number, column: number) => void;
|
|
|
|
onClick?: (item: number, column: number) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SpinnerDesc extends WidgetBaseDesc {
|
|
|
|
type: "spinner";
|
|
|
|
text?: string;
|
|
|
|
onDecrement?: () => void;
|
|
|
|
onIncrement?: () => void;
|
|
|
|
onClick?: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface TextBoxDesc extends WidgetBaseDesc {
|
|
|
|
type: "textbox";
|
|
|
|
text?: string;
|
|
|
|
maxLength?: number;
|
|
|
|
onChange?: (text: string) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ViewportDesc extends WidgetBaseDesc {
|
|
|
|
type: "viewport";
|
|
|
|
}
|
|
|
|
|
2020-02-18 23:31:43 +01:00
|
|
|
interface WindowDesc {
|
|
|
|
classification: string;
|
|
|
|
x?: number;
|
|
|
|
y?: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
title: string;
|
|
|
|
id?: number;
|
2022-09-24 07:06:26 +02:00
|
|
|
/**
|
|
|
|
* See {@link Window} for information about the behaviour of min/max width/height after window creation.
|
2022-11-05 10:00:09 +01:00
|
|
|
*
|
2022-09-24 07:06:26 +02:00
|
|
|
* Behaviour during window creation:
|
|
|
|
* If at least one of the parameters min/max width/height is present, the window is considered to be resizable.
|
|
|
|
* In that case, the min values default to zero (if unspecified) and the max values default to 0xFFFF (if unspecified).
|
|
|
|
* Otherwise, the min/max width values default to width and the min/max height values default to height.
|
|
|
|
*/
|
2020-02-18 23:31:43 +01:00
|
|
|
minWidth?: number;
|
|
|
|
minHeight?: number;
|
2020-04-30 21:32:39 +02:00
|
|
|
maxWidth?: number;
|
|
|
|
maxHeight?: number;
|
2022-11-05 10:00:09 +01:00
|
|
|
widgets?: WidgetDesc[];
|
2020-02-27 20:59:46 +01:00
|
|
|
colours?: number[];
|
2020-05-01 23:31:37 +02:00
|
|
|
tabs?: WindowTabDesc[];
|
2020-11-06 10:40:15 +01:00
|
|
|
tabIndex?: number;
|
2020-02-20 18:58:15 +01:00
|
|
|
|
|
|
|
onClose?: () => void;
|
2020-04-30 21:32:39 +02:00
|
|
|
onUpdate?: () => void;
|
2020-11-01 23:08:51 +01:00
|
|
|
onTabChange?: () => void;
|
2020-04-30 21:32:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ImageAnimation {
|
|
|
|
frameBase: number;
|
|
|
|
frameCount?: number;
|
|
|
|
frameDuration?: number;
|
2020-05-02 12:42:43 +02:00
|
|
|
offset?: ScreenCoordsXY;
|
2020-04-30 21:32:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface WindowTabDesc {
|
2022-12-13 00:03:16 +01:00
|
|
|
image: number | ImageAnimation | IconName;
|
2022-11-05 10:00:09 +01:00
|
|
|
widgets?: WidgetDesc[];
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Viewport {
|
|
|
|
left: number;
|
|
|
|
top: number;
|
|
|
|
right: number;
|
|
|
|
bottom: number;
|
|
|
|
rotation: number;
|
|
|
|
zoom: number;
|
|
|
|
visibilityFlags: number;
|
|
|
|
|
2020-05-02 12:42:43 +02:00
|
|
|
getCentrePosition(): CoordsXY;
|
|
|
|
moveTo(position: CoordsXY | CoordsXYZ): void;
|
|
|
|
scrollTo(position: CoordsXY | CoordsXYZ): void;
|
2020-02-18 23:31:43 +01:00
|
|
|
}
|
2020-08-17 04:53:37 +02:00
|
|
|
|
2021-02-01 00:23:22 +01:00
|
|
|
/**
|
|
|
|
* API for drawing graphics.
|
|
|
|
*/
|
|
|
|
interface GraphicsContext {
|
2021-02-03 00:48:46 +01:00
|
|
|
colour: number | undefined;
|
|
|
|
secondaryColour: number | undefined;
|
2022-03-21 22:42:10 +01:00
|
|
|
tertiaryColour: number | undefined;
|
2021-02-01 00:23:22 +01:00
|
|
|
stroke: number;
|
|
|
|
fill: number;
|
2021-02-03 00:48:46 +01:00
|
|
|
paletteId: number | undefined;
|
|
|
|
readonly width: number;
|
|
|
|
readonly height: number;
|
|
|
|
|
|
|
|
getImage(id: number): ImageInfo | undefined;
|
|
|
|
measureText(text: string): ScreenSize;
|
2021-02-01 00:23:22 +01:00
|
|
|
|
|
|
|
clear(): void;
|
|
|
|
clip(x: number, y: number, width: number, height: number): void;
|
2021-02-02 19:50:53 +01:00
|
|
|
box(x: number, y: number, width: number, height: number): void;
|
2021-02-03 00:48:46 +01:00
|
|
|
image(id: number, x: number, y: number): void;
|
2021-02-01 00:23:22 +01:00
|
|
|
line(x1: number, y1: number, x2: number, y2: number): void;
|
|
|
|
rect(x: number, y: number, width: number, height: number): void;
|
2021-02-03 00:48:46 +01:00
|
|
|
text(text: string, x: number, y: number): void;
|
2021-02-02 19:50:53 +01:00
|
|
|
well(x: number, y: number, width: number, height: number): void;
|
2021-02-01 00:23:22 +01:00
|
|
|
}
|
|
|
|
|
2021-02-03 00:48:46 +01:00
|
|
|
interface ImageInfo {
|
|
|
|
readonly id: number;
|
|
|
|
readonly offset: ScreenCoordsXY;
|
|
|
|
readonly width: number;
|
|
|
|
readonly height: number;
|
|
|
|
readonly isBMP: boolean;
|
|
|
|
readonly isRLE: boolean;
|
|
|
|
readonly isPalette: boolean;
|
|
|
|
readonly noZoom: boolean;
|
|
|
|
readonly nextZoomId: number | undefined;
|
|
|
|
}
|
|
|
|
|
2020-08-17 04:53:37 +02:00
|
|
|
/**
|
2021-01-10 19:23:35 +01:00
|
|
|
* Listens for incoming connections.
|
2020-08-17 04:53:37 +02:00
|
|
|
* Based on node.js net.Server, see https://nodejs.org/api/net.html for more information.
|
|
|
|
*/
|
2020-08-26 03:17:27 +02:00
|
|
|
interface Listener {
|
2020-08-17 17:54:13 +02:00
|
|
|
readonly listening: boolean;
|
|
|
|
|
2021-02-06 16:47:56 +01:00
|
|
|
listen(port: number, host?: string): Listener;
|
2020-08-26 03:17:27 +02:00
|
|
|
close(): Listener;
|
2020-08-17 04:53:37 +02:00
|
|
|
|
2021-03-07 13:45:36 +01:00
|
|
|
on(event: "connection", callback: (socket: Socket) => void): Listener;
|
2020-08-17 17:54:13 +02:00
|
|
|
|
2021-03-07 13:45:36 +01:00
|
|
|
off(event: "connection", callback: (socket: Socket) => void): Listener;
|
2020-08-17 04:53:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a socket such as a TCP connection.
|
|
|
|
* Based on node.js net.Socket, see https://nodejs.org/api/net.html for more information.
|
|
|
|
*/
|
|
|
|
interface Socket {
|
|
|
|
connect(port: number, host: string, callback: Function): Socket;
|
|
|
|
destroy(error: object): Socket;
|
|
|
|
setNoDelay(noDelay: boolean): Socket;
|
|
|
|
end(data?: string): Socket;
|
|
|
|
write(data: string): boolean;
|
|
|
|
|
2021-03-07 13:45:36 +01:00
|
|
|
on(event: "close", callback: (hadError: boolean) => void): Socket;
|
|
|
|
on(event: "error", callback: (hadError: boolean) => void): Socket;
|
|
|
|
on(event: "data", callback: (data: string) => void): Socket;
|
2020-08-17 17:54:13 +02:00
|
|
|
|
2021-03-07 13:45:36 +01:00
|
|
|
off(event: "close", callback: (hadError: boolean) => void): Socket;
|
|
|
|
off(event: "error", callback: (hadError: boolean) => void): Socket;
|
|
|
|
off(event: "data", callback: (data: string) => void): Socket;
|
2020-08-17 04:53:37 +02:00
|
|
|
}
|
2021-01-24 17:46:16 +01:00
|
|
|
|
|
|
|
interface TitleSequence {
|
|
|
|
/**
|
|
|
|
* The name of the title sequence.
|
|
|
|
*/
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The full path of the title sequence.
|
|
|
|
*/
|
|
|
|
readonly path: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the title sequence is a single file or directory.
|
|
|
|
*/
|
|
|
|
readonly isDirectory: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the title sequence is read-only (e.g. a pre-installed sequence).
|
|
|
|
*/
|
|
|
|
readonly isReadOnly: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The parks stored within this title sequence.
|
|
|
|
*/
|
2021-01-25 01:53:23 +01:00
|
|
|
readonly parks: TitleSequencePark[];
|
2021-01-24 17:46:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The commands that describe how to play the title sequence.
|
|
|
|
*/
|
|
|
|
commands: TitleSequenceCommand[];
|
|
|
|
|
2021-01-28 01:50:30 +01:00
|
|
|
/**
|
|
|
|
* Whether the title sequence is currently playing.
|
|
|
|
*/
|
|
|
|
readonly isPlaying: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current command the title sequence is on if playing.
|
|
|
|
*/
|
|
|
|
readonly position: number | null;
|
|
|
|
|
2021-01-25 01:53:23 +01:00
|
|
|
addPark(path: string, fileName: string): void;
|
|
|
|
|
2021-01-24 17:46:16 +01:00
|
|
|
/**
|
|
|
|
* Creates a new title sequence identical to this one.
|
|
|
|
* @param name The name of the new title sequence.
|
|
|
|
*/
|
|
|
|
clone(name: string): TitleSequence;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deletes this title sequence from disc.
|
|
|
|
*/
|
|
|
|
delete(): void;
|
2021-01-28 01:50:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Play the title sequence.
|
|
|
|
*/
|
|
|
|
play(): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Seek to a specific command in the sequence.
|
|
|
|
* @param position The index of the command to seek to.
|
|
|
|
*/
|
|
|
|
seek(position: number): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stops playing the title sequence.
|
|
|
|
*/
|
|
|
|
stop(): void;
|
2021-01-24 17:46:16 +01:00
|
|
|
}
|
|
|
|
|
2021-01-25 01:53:23 +01:00
|
|
|
interface TitleSequencePark {
|
|
|
|
/**
|
|
|
|
* The file name of the park.
|
|
|
|
*/
|
|
|
|
fileName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deletes this park from the title sequence.
|
|
|
|
*/
|
|
|
|
delete(): void;
|
2021-01-28 00:23:15 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads this park.
|
|
|
|
*/
|
|
|
|
load(): void;
|
2021-01-25 01:53:23 +01:00
|
|
|
}
|
|
|
|
|
2021-01-24 17:46:16 +01:00
|
|
|
type TitleSequenceCommandType =
|
2021-03-07 13:45:36 +01:00
|
|
|
"load" |
|
|
|
|
"loadsc" |
|
|
|
|
"location" |
|
|
|
|
"rotate" |
|
|
|
|
"zoom" |
|
|
|
|
"speed" |
|
|
|
|
"follow" |
|
|
|
|
"wait" |
|
|
|
|
"restart" |
|
|
|
|
"end";
|
2021-01-24 17:46:16 +01:00
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface LoadTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "load";
|
2021-01-26 00:56:25 +01:00
|
|
|
index: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface LocationTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "location";
|
2021-01-24 17:46:16 +01:00
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface RotateTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "rotate";
|
2021-01-26 00:56:25 +01:00
|
|
|
rotations: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface ZoomTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "zoom";
|
2021-01-26 00:56:25 +01:00
|
|
|
zoom: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface FollowTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "follow";
|
2021-01-26 00:56:25 +01:00
|
|
|
id: number | null;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface SpeedTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "speed";
|
2021-01-26 00:56:25 +01:00
|
|
|
speed: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface WaitTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "wait";
|
2021-01-26 00:56:25 +01:00
|
|
|
duration: number;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface LoadScenarioTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "loadsc";
|
2021-01-26 00:56:25 +01:00
|
|
|
scenario: string;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:18:48 +01:00
|
|
|
interface RestartTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "restart";
|
2021-01-27 00:18:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface EndTitleSequenceCommand {
|
2021-03-07 13:45:36 +01:00
|
|
|
type: "end";
|
2021-01-27 00:18:48 +01:00
|
|
|
}
|
|
|
|
|
2021-01-26 21:46:52 +01:00
|
|
|
type TitleSequenceCommand =
|
|
|
|
LoadTitleSequenceCommand |
|
|
|
|
LocationTitleSequenceCommand |
|
|
|
|
RotateTitleSequenceCommand |
|
|
|
|
ZoomTitleSequenceCommand |
|
|
|
|
FollowTitleSequenceCommand |
|
|
|
|
SpeedTitleSequenceCommand |
|
|
|
|
WaitTitleSequenceCommand |
|
2021-01-27 00:18:48 +01:00
|
|
|
LoadScenarioTitleSequenceCommand |
|
|
|
|
RestartTitleSequenceCommand |
|
|
|
|
EndTitleSequenceCommand;
|
2021-01-26 21:46:52 +01:00
|
|
|
|
2021-01-24 17:46:16 +01:00
|
|
|
interface TitleSequenceManager {
|
|
|
|
/**
|
|
|
|
* Gets all the available title sequences.
|
|
|
|
*/
|
|
|
|
readonly titleSequences: TitleSequence[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new blank title sequence.
|
|
|
|
* @param name The name of the title sequence.
|
|
|
|
*/
|
|
|
|
create(name: string): TitleSequence;
|
|
|
|
}
|
2021-12-07 21:55:27 +01:00
|
|
|
|
|
|
|
interface ImageManager {
|
|
|
|
/**
|
|
|
|
* Gets the image index range for a predefined set of images.
|
|
|
|
* @param name The name of the image set.
|
|
|
|
*/
|
2021-12-16 21:41:02 +01:00
|
|
|
getPredefinedRange(name: string): ImageIndexRange | null;
|
2021-12-07 21:55:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the list of available ranges of unallocated images.
|
|
|
|
* Useful for displaying how fragmented the allocated image list is.
|
|
|
|
*/
|
|
|
|
getAvailableAllocationRanges(): ImageIndexRange[];
|
2022-02-23 03:02:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocates one or more contigous image IDs.
|
|
|
|
* @param count The number of image IDs to allocate.
|
|
|
|
* @returns the range of allocated image IDs or null if the range could not be allocated.
|
|
|
|
*/
|
|
|
|
allocate(count: number): ImageIndexRange | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Frees one or more contigous image IDs.
|
|
|
|
* An error will occur if attempting the given range contains an ID not owned by the plugin.
|
|
|
|
* @param range The range of images to free.
|
|
|
|
*/
|
|
|
|
free(range: ImageIndexRange): void;
|
|
|
|
|
2022-02-24 01:42:54 +01:00
|
|
|
/**
|
|
|
|
* Gets the metadata for a given image.
|
|
|
|
*/
|
|
|
|
getImageInfo(id: number): ImageInfo | undefined;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the pixel data for a given image ID.
|
|
|
|
*/
|
|
|
|
getPixelData(id: number): PixelData | undefined;
|
|
|
|
|
2022-02-23 03:02:07 +01:00
|
|
|
/**
|
|
|
|
* Sets the pixel data for a given image ID.
|
|
|
|
*
|
|
|
|
* Will error if given an ID of an image not owned by this plugin.
|
|
|
|
* @param id The id of the image to set the pixels of.
|
|
|
|
* @param data The pixel data.
|
|
|
|
*/
|
|
|
|
setPixelData(id: number, data: PixelData): void;
|
|
|
|
|
|
|
|
/**
|
2022-02-25 21:05:10 +01:00
|
|
|
* Calls the given function with a {@link GraphicsContext} for the given image, allowing the
|
|
|
|
* ability to draw directly to it.
|
|
|
|
*
|
2022-02-23 03:02:07 +01:00
|
|
|
* Allocates or reallocates the image if not previously allocated or if the size is changed.
|
|
|
|
* The pixels of the image will persist between calls, so you can draw over the top of what
|
|
|
|
* is currently there. The default pixel colour will be 0 (transparent).
|
|
|
|
*
|
|
|
|
* Drawing a large number of pixels each frame can be expensive, so caching as many as you
|
|
|
|
* can in images is a good way to improve performance.
|
|
|
|
*
|
|
|
|
* Will error if given an ID of an image not owned by this plugin.
|
2022-02-25 21:05:10 +01:00
|
|
|
* @param id The id of the image to draw to.
|
2022-02-23 03:02:07 +01:00
|
|
|
* @param size The size the image that should be allocated.
|
2022-02-25 21:05:10 +01:00
|
|
|
* @param callback The function that will draw to the image.
|
2022-02-23 03:02:07 +01:00
|
|
|
*/
|
2022-02-25 21:05:10 +01:00
|
|
|
draw(id: number, size: ScreenSize, callback: (g: GraphicsContext) => void): void;
|
2022-02-23 03:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type PixelData = RawPixelData | RlePixelData | PngPixelData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Raw pixel data that is not encoded. A contiguous sequence of bytes
|
|
|
|
* representing the 8bpp pixel values with a optional padding between
|
|
|
|
* each horizontal row.
|
|
|
|
*/
|
|
|
|
interface RawPixelData {
|
|
|
|
type: 'raw';
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The length of each horizontal row in bytes.
|
|
|
|
*/
|
|
|
|
stride?: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data can either by a:
|
|
|
|
* - A base64 string.
|
|
|
|
* - An array of bytes
|
|
|
|
* - A {@link Uint8Array} of bytes
|
|
|
|
*/
|
2022-06-05 21:05:51 +02:00
|
|
|
data: string | number[] | Uint8Array;
|
2022-02-23 03:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pixel data that is encoded as RCT run-length encoded data.
|
|
|
|
*/
|
|
|
|
interface RlePixelData {
|
|
|
|
type: 'rle';
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data can either by a:
|
|
|
|
* - A base64 string.
|
|
|
|
* - An array of bytes
|
|
|
|
* - A {@link Uint8Array} of bytes
|
|
|
|
*/
|
2022-06-05 21:05:51 +02:00
|
|
|
data: string | number[] | Uint8Array;
|
2022-02-23 03:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pixel data that is encoded as a .png file.
|
|
|
|
*/
|
|
|
|
interface PngPixelData {
|
|
|
|
type: 'png';
|
|
|
|
|
|
|
|
/**
|
2022-02-24 21:49:35 +01:00
|
|
|
* How the colours of the .png file are converted to the OpenRCT2 palette.
|
2022-02-23 03:02:07 +01:00
|
|
|
* If keep is specified for palette, the raw 8bpp .png bytes will be loaded. The palette
|
|
|
|
* in the .png will not be read. This will improve load performance.
|
2022-02-24 21:49:35 +01:00
|
|
|
* Closest will find the closest matching colour from the OpenRCT2 palette.
|
|
|
|
* Dither will add noise to reduce colour banding for images rich in colour.
|
|
|
|
* If undefined, only colours that are in OpenRCT2 palette will be imported.
|
2022-02-23 03:02:07 +01:00
|
|
|
*/
|
2022-02-24 21:49:35 +01:00
|
|
|
palette?: 'keep' | 'closest' | 'dither';
|
2022-02-23 03:02:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Data can either by a:
|
|
|
|
* - A base64 string.
|
|
|
|
* - An array of bytes
|
|
|
|
* - A {@link Uint8Array} of bytes
|
|
|
|
*/
|
2022-06-05 21:05:51 +02:00
|
|
|
data: string | number[] | Uint8Array;
|
2021-12-07 21:55:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ImageIndexRange {
|
|
|
|
start: number;
|
|
|
|
count: number;
|
|
|
|
}
|
2022-01-18 19:21:20 +01:00
|
|
|
|
|
|
|
interface Profiler {
|
|
|
|
getData(): ProfiledFunction[];
|
|
|
|
start(): void;
|
|
|
|
stop(): void;
|
|
|
|
reset(): void;
|
2022-01-29 14:29:08 +01:00
|
|
|
readonly enabled: boolean;
|
2022-01-18 19:21:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ProfiledFunction {
|
|
|
|
readonly name: string;
|
|
|
|
readonly callCount: number;
|
|
|
|
readonly minTime: number;
|
|
|
|
readonly maxTime: number;
|
|
|
|
readonly totalTime: number;
|
|
|
|
readonly parents: number[];
|
|
|
|
readonly children: number[];
|
|
|
|
}
|
2022-04-12 00:27:35 +02:00
|
|
|
|
|
|
|
interface ObjectManager {
|
2023-04-29 18:39:35 +02:00
|
|
|
/**
|
|
|
|
* Gets all the objects that are installed and can be loaded into the park.
|
|
|
|
*/
|
2022-04-12 00:27:35 +02:00
|
|
|
readonly installedObjects: InstalledObject[];
|
|
|
|
|
2023-04-29 18:39:35 +02:00
|
|
|
/**
|
|
|
|
* Gets the installed object with the given identifier, or null
|
|
|
|
* if the object was not found.
|
|
|
|
* @param identifier The object identifier.
|
|
|
|
*/
|
|
|
|
getInstalledObject(identifier: string): InstalledObject | null;
|
|
|
|
|
2022-04-12 00:27:35 +02:00
|
|
|
/**
|
|
|
|
* Attempt to load the object into the current park at the given index for the object type.
|
|
|
|
* If an object already exists at the given index, that object will be unloaded and this object
|
|
|
|
* will replace it, providing the object type is the same.
|
|
|
|
* @param identifier The object identifier.
|
|
|
|
* @param index The index to load the object to. If not provided, an empty slot will be used.
|
|
|
|
* @returns The index of the loaded object.
|
|
|
|
*/
|
2023-04-30 15:50:25 +02:00
|
|
|
load(identifier: string, index?: number): LoadedObject | null;
|
2022-04-12 00:27:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempt to load the given objects into the current park, given they are not already loaded.
|
|
|
|
*/
|
2023-04-30 15:50:25 +02:00
|
|
|
load(identifiers: string[]): (LoadedObject | null)[];
|
2022-04-12 00:27:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads the object, if loaded.
|
|
|
|
* @param identifier The object identifier to unload.
|
|
|
|
*/
|
|
|
|
unload(identifier: string): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads the specified objects, if loaded.
|
|
|
|
* @param identifiers The object identifiers to unload.
|
|
|
|
*/
|
|
|
|
unload(identifiers: string[]): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads the specified object, if loaded.
|
|
|
|
* @param type The object type.
|
|
|
|
* @param index The index of the slot to unload for the given type.
|
|
|
|
*/
|
|
|
|
unload(type: ObjectType, index: number): void;
|
2023-04-29 18:39:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the loaded object at the given index.
|
|
|
|
* @param type The object type.
|
|
|
|
* @param index The index.
|
|
|
|
*/
|
2023-04-30 15:50:25 +02:00
|
|
|
getObject(type: ObjectType, index: number): LoadedObject;
|
2023-04-29 18:39:35 +02:00
|
|
|
getObject(type: "ride", index: number): RideObject;
|
|
|
|
getObject(type: "small_scenery", index: number): SmallSceneryObject;
|
|
|
|
getObject(type: "large_scenery", index: number): LargeSceneryObject;
|
|
|
|
getObject(type: "wall", index: number): WallObject;
|
|
|
|
getObject(type: "footpath_addition", index: number): FootpathAdditionObject;
|
|
|
|
getObject(type: "banner", index: number): BannerObject;
|
|
|
|
getObject(type: "scenery_group", index: number): SceneryGroupObject;
|
|
|
|
getObject(type: "music", index: number): LoadedObject;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets all the currently loaded objects for a given object type.
|
|
|
|
* @param type The object type.
|
|
|
|
*/
|
2023-04-30 15:50:25 +02:00
|
|
|
getAllObjects(type: ObjectType): LoadedObject[];
|
2023-04-29 18:39:35 +02:00
|
|
|
getAllObjects(type: "ride"): RideObject[];
|
|
|
|
getAllObjects(type: "small_scenery"): SmallSceneryObject[];
|
|
|
|
getAllObjects(type: "large_scenery"): LargeSceneryObject[];
|
|
|
|
getAllObjects(type: "wall"): WallObject[];
|
|
|
|
getAllObjects(type: "footpath_addition"): FootpathAdditionObject[];
|
|
|
|
getAllObjects(type: "banner"): BannerObject[];
|
|
|
|
getAllObjects(type: "scenery_group"): SceneryGroupObject[];
|
|
|
|
getAllObjects(type: "music"): LoadedObject[];
|
2022-04-12 00:27:35 +02:00
|
|
|
}
|
2018-03-18 02:55:12 +01:00
|
|
|
}
|