Event Scripts: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
'''Description:'''
'''Event scripts''' are [[Script (Handle)|scripts]] which are fired by the game engine upon specific events. These scripts can be written in [[SQS syntax]] or [[SQF syntax]] ([[Armed Assault]] only, recommended).


There are some scripts in the game which are launched when some event occurs.<br>
The file extensions of the script depend on the used syntax. If you are using [[SQS syntax]], the file extension is '''.sqs''', else '''.sqf'''.
Some of them have names given by mission designer - scripted waypoint, particle scripts (since version 1.50) and user action scripts.


Names of others are given by the program.
; init
: Launched when mission is started (before briefing screen).


<b>init.sqs</b> - Launched when mission is started (before briefing screen).<br>
; initIntro (since version 1.50)
- No arguments
: Launched when intro is started .


<b>initIntro.sqs</b> - Launched when intro is started (since version 1.50).<br>
; exit (since version 1.50)
- No arguments
: Launched when mission is finished (before debriefing screen).
:
: One [[argument]] of type [[Number]] is passed to the script: The number of game end.


<b>exit.sqs</b> - Launched when mission is finished (before debriefing screen, since version 1.50).<br>
; onFlare (since version 1.45)
- Argument: end # - number of game end.
: Launched when illuminating shell is lit.
 
:
<b>onFlare.sqs</b> - Launched when illuminating shell is lit (since version 1.45).<br>
: An array is passed to the script: [[r, g, b], gunner]
- Arguments: [[r, g, b], [[gunner]]] - r, g, b is light color.
:: r, g, b: [[Number]] - the light color
 
:: gunner: [[Object]] - the unit who fired the flare shell
<b>onPlayerKilled.sqs</b> - Launched when the player is killed.
 
This script replaces the default death sequence.<br>
Make sure you place the command [[enableEndDialog]] somewhere in your script, as this will then cause the dialog that allows you to load, retry, or quit to appear.


; onPlayerKilled
: Launched when the player is killed.
:
: This script replaces the default death sequence. Make sure you place the command [[enableEndDialog]] somewhere in your script, as this will then cause the dialog that allows you to load, retry, or quit to appear.


[[Category: Scripting_Topics ]]
[[Category: Scripting_Topics ]]

Revision as of 03:03, 22 December 2006

Event scripts are scripts which are fired by the game engine upon specific events. These scripts can be written in SQS syntax or SQF syntax (Armed Assault only, recommended).

The file extensions of the script depend on the used syntax. If you are using SQS syntax, the file extension is .sqs, else .sqf.

init
Launched when mission is started (before briefing screen).
initIntro (since version 1.50)
Launched when intro is started .
exit (since version 1.50)
Launched when mission is finished (before debriefing screen).
One argument of type Number is passed to the script: The number of game end.
onFlare (since version 1.45)
Launched when illuminating shell is lit.
An array is passed to the script: [[r, g, b], gunner]
r, g, b: Number - the light color
gunner: Object - the unit who fired the flare shell
onPlayerKilled
Launched when the player is killed.
This script replaces the default death sequence. Make sure you place the command enableEndDialog somewhere in your script, as this will then cause the dialog that allows you to load, retry, or quit to appear.