OpenTTD Source: src/script/script_info.hpp File Reference

OpenTTD Source 15.0-RC2

Data Structures | Functions | Variables
script_info.hpp File Reference

ScriptInfo keeps track of all information of a script, like Author, Description, ... More...

`#include <squirrel.h>`
`#include "script_object.hpp"`
`#include "script_config.hpp"`

Go to the source code of this file.

## Data Structures
class | ScriptInfo
| All static information from an Script like name, version, etc. More...

## Functions
void | Script_CreateDummyInfo (HSQUIRRELVM vm, std::string_view type, std::string_view dir)
| Run the dummy info.nut.
void | Script_CreateDummy (HSQUIRRELVM vm, StringID string, std::string_view type)
| Run the dummy AI and let it generate an error message.

## Variables
static const int | MAX_SL_OPS = 100000
| The maximum number of operations for saving or loading the data of a script.
static const int | MAX_CONSTRUCTOR_OPS = 100000
| The maximum number of operations for initial start of a script.
static const int | MAX_CREATEINSTANCE_OPS = 100000
| Number of operations to create an instance of a script.
static const int | MAX_GET_OPS = 1000
| Number of operations to get the author and similar information.
static const int | MAX_GET_SETTING_OPS = 100000
| Maximum number of operations allowed for getting a particular setting.

## Detailed Description

ScriptInfo keeps track of all information of a script, like Author, Description, ...

Definition in file script_info.hpp.

## Function Documentation

## ◆ Script_CreateDummy()

void Script_CreateDummy | ( | HSQUIRRELVM | vm,
|  | StringID | string,
|  | std::string_view | type
| ) |  |

Run the dummy AI and let it generate an error message.

Definition at line 81 of file script_info_dummy.cpp.

References EscapeQuotesAndSlashesAndSplitOnNewLines(), and GetString().

Referenced by AIInstance::LoadDummyScript().

## ◆ Script_CreateDummyInfo()

void Script_CreateDummyInfo | ( | HSQUIRRELVM | vm,
|  | std::string_view | type,
|  | std::string_view | dir
| ) |  |

Run the dummy info.nut.

Definition at line 29 of file script_info_dummy.cpp.

## Variable Documentation

## ◆ MAX_CONSTRUCTOR_OPS

const int MAX_CONSTRUCTOR_OPS = 100000
| static

The maximum number of operations for initial start of a script.

Definition at line 21 of file script_info.hpp.

Referenced by ScriptInstance::GameLoop().

## ◆ MAX_CREATEINSTANCE_OPS

const int MAX_CREATEINSTANCE_OPS = 100000
| static

Number of operations to create an instance of a script.

Definition at line 23 of file script_info.hpp.

Referenced by ScriptInfo::Constructor().

## ◆ MAX_GET_OPS

const int MAX_GET_OPS = 1000
| static

Number of operations to get the author and similar information.

Definition at line 25 of file script_info.hpp.

Referenced by AIInfo::Constructor(), AILibrary::Constructor(), GameInfo::Constructor(), GameLibrary::Constructor(), and ScriptInfo::Constructor().

## ◆ MAX_GET_SETTING_OPS

const int MAX_GET_SETTING_OPS = 100000
| static

Maximum number of operations allowed for getting a particular setting.

Definition at line 27 of file script_info.hpp.

Referenced by ScriptInfo::GetSettings().

## ◆ MAX_SL_OPS

const int MAX_SL_OPS = 100000
| static

The maximum number of operations for saving or loading the data of a script.

Definition at line 19 of file script_info.hpp.

Referenced by ScriptInstance::CallLoad(), and ScriptInstance::Save().