EVENT scripts: Difference between revisions
DrinkyBird (talk | contribs) (Created page with "EVENT scripts are scripts that are triggered by various in-game events: script 123 (int type, int arg1, int arg2) EVENT The event that caused the script to be fired is enum...") |
(Updated information about ACS EVENT scripts, including the new GAMEEVENT_CHAT type available in Zandronum 3.1.) |
||
Line 11: | Line 11: | ||
:Player receives a medal. The activator is the player who recieves the medal and <tt>arg1</tt> is the string containing the name of the medal. | :Player receives a medal. The activator is the player who recieves the medal and <tt>arg1</tt> is the string containing the name of the medal. | ||
;GAMEEVENT_CAPTURES 2 | ;GAMEEVENT_CAPTURES 2 | ||
:Player captures the flag/skull. The activator is the capturing player and <tt>arg1</tt> is the player who assisted. If nobody assisted the capture, -1 is supplied instead. | :Player captures the flag/skull. The activator is the capturing player and <tt>arg1</tt> is the player who assisted. If nobody assisted the capture, -1 is supplied instead. In 3.1, <tt>arg2</tt> returns the number of points earned. | ||
;GAMEEVENT_TOUCHES 3 | ;GAMEEVENT_TOUCHES 3 | ||
:Player touches the flag/skull. The activator is the player who touched the team item and <tt>arg1</tt> is the team index of the team whose flag/skull was touched. | :Player touches the flag/skull. The activator is the player who touched the team item and <tt>arg1</tt> is the team index of the team whose flag/skull was touched. | ||
Line 22: | Line 22: | ||
;GAMEEVENT_ROUND_ABORTED 7 | ;GAMEEVENT_ROUND_ABORTED 7 | ||
:If the round is aborted (e.g. in duel where one of the combatants leaves the game). | :If the round is aborted (e.g. in duel where one of the combatants leaves the game). | ||
;GAMEEVENT_CHAT 8 (<font color="darkblue">3.1</font> <font color="red">only</font>) | |||
:When a chat message is sent. The activator is always the world, <tt>arg1</tt> is the number of the player who sent the message (if the server sent the message, -1 is passed instead), and <tt>arg2</tt> is set to 0 if it was a global chat message or 1 if it was a team chat message. | |||
[[Category:Level Development]] | [[Category:Level Development]] | ||
[[Category:ACS Functions]] | [[Category:ACS Functions]] |
Revision as of 14:23, 26 February 2021
EVENT scripts are scripts that are triggered by various in-game events:
script 123 (int type, int arg1, int arg2) EVENT
The event that caused the script to be fired is enumerated into the type argument. arg1 and arg2 may or may not be used (depending on the event type) to provide additional data.
Script types
- GAMEEVENT_PLAYERFRAGS 0
- Player frags another player. The activator is the killing player and arg1 is the number of the player who was fragged.
- GAMEEVENT_MEDALS 1
- Player receives a medal. The activator is the player who recieves the medal and arg1 is the string containing the name of the medal.
- GAMEEVENT_CAPTURES 2
- Player captures the flag/skull. The activator is the capturing player and arg1 is the player who assisted. If nobody assisted the capture, -1 is supplied instead. In 3.1, arg2 returns the number of points earned.
- GAMEEVENT_TOUCHES 3
- Player touches the flag/skull. The activator is the player who touched the team item and arg1 is the team index of the team whose flag/skull was touched.
- GAMEEVENT_RETURNS 4
- The flag/skull is returned. The activator is the player who returned the team item (or the world if the item was automatically returned), arg1 is the index of the team whose item was returned. arg2 is set to 0 if the return was done automatically or 1 if it was done by a player.
- GAMEEVENT_ROUND_STARTS 5
- When the round starts.
- GAMEEVENT_ROUND_ENDS 6
- The current round ends and the win sequence starts, e.g. when the fraglimit is hit.
- GAMEEVENT_ROUND_ABORTED 7
- If the round is aborted (e.g. in duel where one of the combatants leaves the game).
- GAMEEVENT_CHAT 8 (3.1 only)
- When a chat message is sent. The activator is always the world, arg1 is the number of the player who sent the message (if the server sent the message, -1 is passed instead), and arg2 is set to 0 if it was a global chat message or 1 if it was a team chat message.