User Tools

Site Tools



This is an old revision of the document!

Script Language Reference and Guide

This section will explain the features of AngelScript, the script language used by Amnesia (like the syntax, data types, variables, functions, control flow statements, OOP support, etc.), and provide a guide on how to use these features in the context of the HPL2 engine. This is the fundamental knowledge that will help you understand how map scripting for Amnesia works. This guide is intended to teach you scripting (programming), and to be used as a reference to the features and the rules of the script language itself. It is not meant to teach you how to accomplish specific tasks in your custom stories and full conversions for Amnesia (although you might end up learning a few things about that as well).

This section is work in progress. Information is currently missing. You are welcome to contribute.

The following subsections are available:

  • Execution Flow - explains how program flow is transfered from the game to the script engine, and vice versa,
  • Quick Start - a quick introduction to map scripting,
  • Variables - explains what variables are and how to use them.
  • Types - discusses various types supported by the script language.
  • Constants and Enumerations - explains how to define constant values.
  • Functions - Part 1: The Basics - explains the basics of functions, and how to create them and use them.
  • Control Flow - Part 1: Conditional Statements - explains if, if-else, and switch statements, which are used to make decisions.
  • Control Flow - Part 2: Loops - discusses while, do-while and for loops.
  • Functions - Part 2: Overload - explains const-parameters, function overloading and function wrapping.
  • Functions - Part 3: Digging Deeper - explains passing by reference, using callbacks and using funcdefs.
  • Arrays - array types in detail.
  • etc…
  • Sandbox Map(s?) - a simple map (or maps, haven't decided yet…) to help you learn.
hpl2/amnesia/script_language_reference_and_guide/script_language_reference_and_guide.1358132056.txt.gz · Last modified: 2013/01/14 02:54 by thegreatcthulhu