User Tools

Site Tools


hpl2:amnesia:script_language_reference_and_guide:quick_start

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
hpl2:amnesia:script_language_reference_and_guide:quick_start [2013/08/08 21:21]
killer339494 Checkbox Change
hpl2:amnesia:script_language_reference_and_guide:quick_start [2013/08/08 21:21] (current)
killer339494 Checkbox Change
Line 18: Line 18:
  
 It is not required for the script file to exist, but if you create one, it must not remain empty – otherwise, the game engine will not accept it. The file should contain at least one line of valid code. When the level is loaded, the game will look into the script, and it will call the OnStart() and OnEnter() functions, if they are defined in the file. OnStart() is called once, when the level is first loaded, while OnEnter() is called every time the Player enters the level.\\ It is not required for the script file to exist, but if you create one, it must not remain empty – otherwise, the game engine will not accept it. The file should contain at least one line of valid code. When the level is loaded, the game will look into the script, and it will call the OnStart() and OnEnter() functions, if they are defined in the file. OnStart() is called once, when the level is first loaded, while OnEnter() is called every time the Player enters the level.\\
-So, we can start by defining the OnEnter() function. Type in this code in sandboxMap.hps (<​todo ​#>​sandboxMap coming soon</​todo>​),​ or in a script file for your own map:+So, we can start by defining the OnEnter() function. Type in this code in sandboxMap.hps (<​todo>​sandboxMap coming soon</​todo>​),​ or in a script file for your own map:
 <​code=c++>​void OnEnter() <​code=c++>​void OnEnter()
 { {
hpl2/amnesia/script_language_reference_and_guide/quick_start.1375996867.txt.gz · Last modified: 2013/08/08 21:21 by killer339494