User Tools

Site Tools


hpl2:amnesia:script_language_reference_and_guide:execution_flow

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
hpl2:amnesia:script_language_reference_and_guide:execution_flow [2012/12/20 19:50]
thegreatcthulhu
hpl2:amnesia:script_language_reference_and_guide:execution_flow [2012/12/21 21:50]
thegreatcthulhu
Line 1: Line 1:
-====== Execution ​flow ======+====== Execution ​Flow ======
  
  
 This section describes at which points in time the game engine transfers execution to and from the user-supplied script functions. This section describes at which points in time the game engine transfers execution to and from the user-supplied script functions.
  
-The game itself is executed by the system running the game engine code, that is, the binary game code written by the developers, and embedded inside the game's executable files. Amnesia supports scripting by allowing you to associate each level with a corresponding script file (mapname.hps).+The game itself is executed by the system running the game engine code, that is, the binary game code written by the developers, and embedded inside the game's executable files. Amnesia supports scripting by allowing you to associate each level with a corresponding script file (//mapname//.hps).
 On a conceptual level, as the game runs, at certain points the control is transferred to the script engine, which executes the user-supplied script, making level-specific things happen, before returning the control back to the game (which takes care of all the rest). On a conceptual level, as the game runs, at certain points the control is transferred to the script engine, which executes the user-supplied script, making level-specific things happen, before returning the control back to the game (which takes care of all the rest).
  
 By default, there are only 3 events where this happens. These are listed below: By default, there are only 3 events where this happens. These are listed below:
-  * level start – this happens when the level is first loaded,+  * level start – this happens ​once, when the level is first loaded,
   * level enter – this occurs whenever the player (re)enters the level (the player might be allowed to backtrack),   * level enter – this occurs whenever the player (re)enters the level (the player might be allowed to backtrack),
   * level leave – this occurs on level transition, when the player leaves one level to enter another.   * level leave – this occurs on level transition, when the player leaves one level to enter another.
hpl2/amnesia/script_language_reference_and_guide/execution_flow.txt · Last modified: 2012/12/21 21:51 by thegreatcthulhu