EVENT scripts: Difference between revisions

Documented GAMEEVENT_PLAYERLEAVESSERVER
m (Don't forget to mention the activators of GAMEEVENT_DOMINATION_CONTROL and GAMEEVENT_DOMINATION_POINT.)
Tag: Source edit
(Documented GAMEEVENT_PLAYERLEAVESSERVER)
Tag: Source edit
Line 37: Line 37:
;{{Devfeature|3.2|alpha}} GAMEEVENT_DOMINATION_POINT 14
;{{Devfeature|3.2|alpha}} GAMEEVENT_DOMINATION_POINT 14
:When a team gets a point for controlling point sector in [[Game Modes#Domination|Domination]]. The activator is always the world, <tt>arg1</tt> is the team index that occupies the sector, and <tt>arg2</tt> is a dynamic ACS string containing the name of the sector.
:When a team gets a point for controlling point sector in [[Game Modes#Domination|Domination]]. The activator is always the world, <tt>arg1</tt> is the team index that occupies the sector, and <tt>arg2</tt> is a dynamic ACS string containing the name of the sector.
;{{Devfeature|3.2|alpha}} GAMEEVENT_PLAYERLEAVESSERVER 15
:When a player disconnects from the server (the opposite of GAMEEVENT_PLAYERCONNECT). This is not to be confused with {{Zdoomwiki|Script types#DISCONNECT|DISCONNECT scripts}} which fire when a player leaves the game, including becoming a spectator. <tt>arg1</tt> indicates the reason the player disconnected, see [[#Leave reasons|Leave reasons]] below.


== Event handling==
== Event handling==
Line 71: Line 73:
It's recommended not to use these three event types in conjunction with <tt>CLIENTSIDE</tt> scripts, since the server must tell clients to execute the scripts every time the events are fired. Due to their frequent occurrence, this can create lots of network traffic, resulting in a huge drop in performance. Furthermore, the extra actor pointers available in damage events, along with the damage type stored in <tt>arg2</tt>, do not work properly in <tt>CLIENTSIDE</tt> scripts.
It's recommended not to use these three event types in conjunction with <tt>CLIENTSIDE</tt> scripts, since the server must tell clients to execute the scripts every time the events are fired. Due to their frequent occurrence, this can create lots of network traffic, resulting in a huge drop in performance. Furthermore, the extra actor pointers available in damage events, along with the damage type stored in <tt>arg2</tt>, do not work properly in <tt>CLIENTSIDE</tt> scripts.
[[Category:Level Development]]
[[Category:Level Development]]
=== Leave reasons ===
The argument passed to '''GAMEEVENT_PLAYERLEAVESSERVER''' indicates the reason a player disconnected from the server:
;LEAVEREASON_LEFT 0
:The player disconnected from the server of their own accord.
;LEAVEREASON_KICKED 1
:The player was kicked from the server by an admin.
;LEAVEREASON_ERROR 2
:The client was disconnected due to an error.
;LEAVEREASON_TIMEOUT 3
:The player timed out.
;LEAVEREASON_RECONNECT 4
:The player is re-connecting; e.g. the <tt>map</tt> command was used.


==Examples ==
==Examples ==