Enumerations | Functions | Variables

# script_instance.cpp File Reference

Implementation of ScriptInstance. More...

`#include "../stdafx.h"`
`#include "../debug.h"`
`#include "../saveload/saveload.h"`
`#include "../script/squirrel_class.hpp"`
`#include "script_fatalerror.hpp"`
`#include "script_storage.hpp"`
`#include "script_info.hpp"`
`#include "script_instance.hpp"`
`#include "api/script_controller.hpp"`
`#include "api/script_error.hpp"`
`#include "api/script_event.hpp"`
`#include "api/script_log.hpp"`
`#include "../company_base.h"`
`#include "../company_func.h"`
`#include "../fileio_func.h"`

Go to the source code of this file.

## Enumerations
enum | SQSaveLoadType { SQSL_INT = 0x00, SQSL_STRING = 0x01, SQSL_ARRAY = 0x02, SQSL_TABLE = 0x03, SQSL_BOOL = 0x04, SQSL_NULL = 0x05, SQSL_ARRAY_TABLE_END = 0xFF }
| The type of the data that follows in the savegame. More...
## Functions
static void | PrintFunc (bool error_msg, const SQChar *message)
| Callback called by squirrel when a script uses "print" and for error messages.
## Variables
static byte | _script_sl_byte
| Used as source/target by the script saveload code to store/load a single byte.
static const SaveLoad | _script_byte []
| SaveLoad array that saves/loads exactly one byte.

## Detailed Description

Implementation of ScriptInstance.

Definition in file script_instance.cpp.

## Enumeration Type Documentation

enum SQSaveLoadType

The type of the data that follows in the savegame.

Enumerator:

  SQSL_INT | The following data is an integer.
  SQSL_STRING | The following data is an string.
  SQSL_ARRAY | The following data is an array.
  SQSL_TABLE | The following data is an table.
  SQSL_BOOL | The following data is a boolean.
  SQSL_NULL | A null variable.
  SQSL_ARRAY_TABLE_END | Marks the end of an array or table, no data follows.

Definition at line 312 of file script_instance.cpp.

## Function Documentation

static void PrintFunc | ( | bool | error_msg,
|  | const SQChar * | message |
| ) |  |  | `[static]`

Callback called by squirrel when a script uses "print" and for error messages.

Parameters:

  | error_msg | Is this an error message?
  | message | The actual message text.

Definition at line 44 of file script_instance.cpp.

Referenced by ScriptInstance::ScriptInstance().

## Variable Documentation

const SaveLoad _script_byte[]`[static]`

Initial value:

     {
      SLEG_VAR(_script_sl_byte, SLE_UINT8),

    }

SaveLoad array that saves/loads exactly one byte.

Definition at line 325 of file script_instance.cpp.