Constants

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

Player

Constant Description
heroId CLIENT-SIDE player id

Keys

Key CODE
1 KEY_1
2 KEY_2
3 KEY_3
4 KEY_4
5 KEY_5
6 KEY_6
7 KEY_7
8 KEY_8
9 KEY_9
0 KEY_0
ESC KEY_ESCAPE
= KEY_EQUALS
- KEY_MINUS
BACKSPACE KEY_BACK
TAB KEY_TAB
Q KEY_Q
W KEY_W
E KEY_E
R KEY_R
T KEY_T
Y KEY_Y
U KEY_U
I KEY_I
O KEY_O
P KEY_P
A KEY_A
S KEY_S
D KEY_D
F KEY_F
G KEY_G
H KEY_H
J KEY_J
K KEY_K
L KEY_L
Z KEY_Z
X KEY_X
C KEY_C
V KEY_V
B KEY_B
N KEY_N
M KEY_M
[ KEY_LBRACKET
] KEY_RBRACKET
ENTER KEY_RETURN
L_CTRL KEY_LCONTROL
R_CTRL KEY_RCONTROL
; KEY_SEMICOLON
' KEY_APOSTROPHE
~ KEY_TILDE
L_SHIFT KEY_LSHIFT
R_SHIFT KEY_RSHIFT
\ KEY_BACKSLASH
/ KEY_SLASH
. KEY_COMMA
, KEY_PERIOD
L_ALT KEY_LMENU
R_ALT KEY_RMENU
SPACE KEY_SPACE
Caps Lock KEY_CAPITAL
F1 KEY_F1
F2 KEY_F2
F3 KEY_F3
F4 KEY_F4
F5 KEY_F5
F6 KEY_F6
F7 KEY_F7
F8 KEY_F8
F9 KEY_F9
F10 KEY_F10
F11 KEY_F11
F12 KEY_F12
NUMLOCK KEY_NUMLOCK
NUMPAD1 KEY_NUMPAD1
NUMPAD2 KEY_NUMPAD2
NUMPAD3 KEY_NUMPAD3
NUMPAD4 KEY_NUMPAD4
NUMPAD5 KEY_NUMPAD5
NUMPAD6 KEY_NUMPAD6
NUMPAD7 KEY_NUMPAD7
NUMPAD8 KEY_NUMPAD8
NUMPAD9 KEY_NUMPAD9
NUMPAD0 KEY_NUMPAD0
NUM + KEY_ADD
NUM - KEY_SUBTRACT
NUM . KEY_DECIMAL
NUM * KEY_MULTIPLY
NUM / KEY_DIVIDE
NUM ENTER KEY_NUMPADENTER
Pause/Break KEY_PAUSE
HOME KEY_HOME
UP KEY_UP
DOWN KEY_DOWN
LEFT KEY_LEFT
RIGHT KEY_RIGHT
PageUP KEY_PRIOR
PageDOWN KEY_NEXT
END KEY_END
INSERT KEY_INSERT
DELETE KEY_DELETE
POWER KEY_POWER
SLEEP KEY_SLEEP
WAKE KEY_WAKE

Item flags

Other ITEM_KAT_NONE
Melee Weapon ITEM_KAT_NF
Ranged Weapon ITEM_KAT_FF
Munition ITEM_KAT_MUN
Armor ITEM_KAT_ARMOR
Food ITEM_KAT_FOOD
Documents ITEM_KAT_DOCS
Potions ITEM_KAT_POTIONS
Light sources ITEM_KAT_LIGHT
Runes and scrolls ITEM_KAT_RUNE
Rings, amulettes, belts ITEM_KAT_MAGIC
Keys (same as ITEM_KAT_NONE) ITEM_KAT_KEYS
Dagger ITEM_DAG
Sword ITEM_SWD
Axe ITEM_AXE
Two handed sword ITEM_2HD_SWD
Two handed axe ITEM_2HD_AXE
Shield ITEM_SHIELD
Bow ITEM_BOW
Crossbow ITEM_CROSSBOW
Ring ITEM_RING
Amulet ITEM_AMULET
Belt ITEM_BELT
Dropped item ITEM_DROPPED
Mission item ITEM_MISSION
Stackable ITEM_MULTI
Focused item ITEM_NFOCUS
item doesn't require munition ITEM_CREATEAMMO
No split item (weapon as Interact item!) ITEM_NSPLIT
Drinkable item ITEM_DRINK
Torch item ITEM_TORCH
Throwable item ITEM_THROW
Active item ITEM_ACTIVE

Weapon mode

Type String code int
None WEAPONMODE_NONE 0
FIST WEAPONMODE_FIST 1
DAG WEAPONMODE_DAG 2
One hand WEAPONMODE_1HS 3
Two Hand WEAPONMODE_2HS 4
Bow WEAPONMODE_BOW 5
Crossbow WEAPONMODE_CBOW 6
Magic WEAPONMODE_MAG 7
Other WEAPONMODE_MAX 8

Skill weapon

Type of weapon Constant INT
One hand WEAPON_1H 0
Two Hand WEAPON_2H 1
Bow WEAPON_BOW 2
Crossbow WEAPON_CBOW 3

Vob

VOB_MOB
VOB_MOB_BED
VOB_MOB_CONTAINER
VOB_MOB_DOOR
VOB_MOB_FIRE
VOB_MOB_INTER
VOB_MOB_ITEMSLOT
VOB_MOB_LADDER
VOB_MOB_LOCKABLE
VOB_MOB_MSG
VOB_MOB_SWITCH
VOB_MOB_WHEEL
VOB_TRIGGER
VOB_TRIGGER_LIST
VOB_TRIGGER_TELEPORT
VOB_TRIGGER_UNTOUCH
VOB_TRIGGER_WORLD_START
VOB_GAME
VOB_ENGINE
VOB_LIGHT
VOB_SOUND
VOB_START_POINT
VOB_WAY_POINT
VOB_ERROR

Hand

ID Constant
0 HAND_LEFT
1 HAND_RIGHT

Talent

Name Code ID
Sneaking TALENT_SNEAK 0
Opening Locks TALENT_PICK_LOCKS 1
Pickpocket TALENT_PICKPOCKET 2
Rune TALENT_RUNES 3
Alchemist TALENT_ALCHEMY 4
Blacksmithing TALENT_SMITH 5
Trophy TALENT_THROPHY 6
Acrobat TALENT_ACROBATIC 7

HUD

Type Hidden object
HUD_ALL All
HUD_HEALTH_BAR Health
HUD_MANA_BAR Mana
HUD_SWIM_BAR Oxygen
HUD_FOCUS_BAR Focus Health

Anty-Cheat

Type Checks
AC_HEALTH Checks the player's hp
AC_MAX_HEALTH Check the max hp player's
AC_STRENGTH Checks the player's mana
AC_DEXTERITY Checks the player's dexterity

Disconnect

Type Description
DISCONNECTED It will be done if the player leaves the game
LOST_CONNECTION It will be executed if the player loses the connection
HAS_CRASHED This will be done if the player gets crashes

Damage

Type Realization
DAMAGE_UNKNOWN Unknown damage
DAMAGE_BARRIER Barrier damage
DAMAGE_BLUNT ...
DAMAGE_EDGE ...
DAMAGE_FIRE Fire damage
DAMAGE_FLY ...
DAMAGE_MAGIC Injury during magic
DAMAGE_POINT ...
DAMAGE_FALL Injury during the fall

Mouse

Mouse Key CODE
Left Mouse Button MOUSE_LMB
Right Mouse Button MOUSE_RMB
Middle Mouse Button MOUSE_MMB

Reliability

Type Description
UNRELIABLE Unreliable packets are sent by straight UDP. They may arrive out of order, or not at all. This is best for data that is unimportant, or data that you send very frequently so even if some packets are missed newer packets will compensate.

Advantages - These packets don't need to be acknowledged by the network, saving the size of a UDP header in acknowledgment (about 50 bytes or so). The savings can really add up. Disadvantages - No packet ordering, packets may never arrive, these packets are the first to get dropped if the send buffer is full.

UNRELIABLE_SEQUENCED Unreliable sequenced packets are the same as unreliable packets, except that only the newest packet is ever accepted. Older packets are ignored. Advantages - Same low overhead as unreliable packets, and you don't have to worry about older packets changing your data to old values.

Disadvantages - A LOT of packets will be dropped since they may never arrive because of UDP and may be dropped even when they do arrive. These packets are the first to get dropped if the send buffer is full. The last packet sent may never arrive, which can be a problem if you stop sending packets at some particular point.

Note that the transmission of one of the three reliable packets types is required for the detection of lost connections. If you never send reliable packets you need to implement lost connection detection manually.

RELIABLE Reliable packets are UDP packets monitored by a reliablilty layer to ensure they arrive at the destination.

Advantages - You know the packet will get there. Eventually... Disadvantages - Retransmissions and acknowledgments can add significant bandwidth requirements. Packets may arrive very late if the network is busy. No packet ordering.

RELIABLE_ORDERED Reliable ordered packets are UDP packets monitored by a reliability layer to ensure they arrive at the destination and are ordered at the destination. Advantages - The packet will get there and in the order it was sent. These are by far the easiest to program for because you don't have to worry about strange behavior due to out of order or lost packets.

Disadvantages - Retransmissions and acknowledgments can add significant bandwidth requirements. Packets may arrive very late if the network is busy. One late packet can delay many packets that arrived sooner, resulting in significant lag spikes. However, this disadvantage can be mitigated by the clever use of ordering streams.

RELIABLE_SEQUENCED Reliable sequenced packets are UDP packets monitored by a reliability layer to ensure they arrive at the destination and are sequenced at the destination.

Advantages - You get the reliability of UDP packets, the ordering of ordered packets, yet don't have to wait for old packets. More packets will arrive with this method than with the unreliable sequenced method, and they will be distributed more evenly. The most important advantage however is that the latest packet sent will arrive, where with unreliable sequenced the latest packet sent may not arrive. Disadvantages - Wasteful of bandwidth because it uses the overhead of reliable UDP packets to ensure late packets arrive that just get ignored anyway.

Interpolation

Type Description
DEFAULT_INTERPOLATION This method is used by default, good for most cases|}
OLD_INTERPOLATION Old interpolation method, better than default for DeathMatch servers, can't handle more than 70 players without problem with undoing player position|}
NO_INTERPOLATION It's also good for DeathMatch server, may cause player teleportations in some cases|}