-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGoldSrc.CSSDK.pas
4319 lines (3737 loc) · 133 KB
/
GoldSrc.CSSDK.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*============ (C) Copyright 2020, Alexander B. All rights reserved. ============*)
(* *)
(* Module: *)
(* GoldSrc.CSSDK *)
(* *)
(* License: *)
(* You may freely use this code provided you retain this copyright message. *)
(* *)
(* Description: *)
(* Provides relatively full SDK for Counter-Strike 1.6 Mod. *)
(*===============================================================================*)
unit GoldSrc.CSSDK;
{$MinEnumSize 4}
interface
uses
System.Math.Vectors,
GoldSrc.SDK,
GoldSrc.BaseInterface,
GoldSrc.VGUI;
const
CSSDK_VERSION = 20200831;
const
FBEAM_STARTENTITY = $00000001;
FBEAM_ENDENTITY = $00000002;
FBEAM_FADEIN = $00000004;
FBEAM_FADEOUT = $00000008;
FBEAM_SINENOISE = $00000010;
FBEAM_SOLID = $00000020;
FBEAM_SHADEIN = $00000040;
FBEAM_SHADEOUT = $00000080;
FBEAM_STARTVISIBLE = $10000000; // Has this client actually seen this beam's start entity yet?
FBEAM_ENDVISIBLE = $20000000; // Has this client actually seen this beam's end entity yet?
FBEAM_ISACTIVE = $40000000;
FBEAM_FOREVER = $80000000;
HISTORY_MAX = 64; // Must be power of 2
HISTORY_MASK = HISTORY_MAX - 1;
STUDIO_RENDER = 1;
STUDIO_EVENTS = 2;
PLANE_ANYZ = 5;
ALIAS_Z_CLIP_PLANE = 5;
// flags in finalvert_t.flags
ALIAS_LEFT_CLIP = $0001;
ALIAS_TOP_CLIP = $0002;
ALIAS_RIGHT_CLIP = $0004;
ALIAS_BOTTOM_CLIP = $0008;
ALIAS_Z_CLIP = $0010;
ALIAS_ONSEAM = $0020;
ALIAS_XY_CLIP_MASK = $000F;
ZISCALE = Single($8000); // TODO: Check (float)0x8000
CACHE_SIZE = 32; // used to align key data structures
// Max # of clients allowed in a server.
MAX_CLIENTS = 32;
// How many bits to use to encode an edict.
MAX_EDICT_BITS = 11; // # of bits needed to represent max edicts
// Max # of edicts in a level (2048)
MAX_EDICTS = 1 shl MAX_EDICT_BITS;
// How many data slots to use when in multiplayer (must be power of 2)
MULTIPLAYER_BACKUP = 64;
// Same for single player
SINGLEPLAYER_BACKUP = 8;
//
// Constants shared by the engine and dlls
// This header file included by engine files and DLL files.
// Most came from server.h
// edict->flags
FL_FLY = 1 shl 0; // Changes the SV_Movestep() behavior to not need to be on ground
FL_SWIM = 1 shl 1; // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
FL_CONVEYOR = 1 shl 2;
FL_CLIENT = 1 shl 3;
FL_INWATER = 1 shl 4;
FL_MONSTER = 1 shl 5;
FL_GODMODE = 1 shl 6;
FL_NOTARGET = 1 shl 7;
FL_SKIPLOCALHOST = 1 shl 8; // Don't send entity to local host, it's predicting this entity itself
FL_ONGROUND = 1 shl 9; // At rest / on the ground
FL_PARTIALGROUND = 1 shl 10; // not all corners are valid
FL_WATERJUMP = 1 shl 11; // player jumping out of water
FL_FROZEN = 1 shl 12; // Player is frozen for 3rd person camera
FL_FAKECLIENT = 1 shl 13; // JAC: fake client, simulated server side; don't send network messages to them
FL_DUCKING = 1 shl 14; // Player flag -- Player is fully crouched
FL_FLOAT = 1 shl 15; // Apply floating force to this entity when in water
FL_GRAPHED = 1 shl 16; // worldgraph has this ent listed as something that blocks a connection
// UNDONE: Do we need these?
FL_IMMUNE_WATER = 1 shl 17;
FL_IMMUNE_SLIME = 1 shl 18;
FL_IMMUNE_LAVA = 1 shl 19;
FL_PROXY = 1 shl 20; // This is a spectator proxy
FL_ALWAYSTHINK = 1 shl 21; // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path)
FL_BASEVELOCITY = 1 shl 22; // Base velocity has been applied this frame (used to convert base velocity into momentum)
FL_MONSTERCLIP = 1 shl 23; // Only collide in with monsters who have FL_MONSTERCLIP set
FL_ONTRAIN = 1 shl 24; // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
FL_WORLDBRUSH = 1 shl 25; // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
FL_SPECTATOR = 1 shl 26; // This client is a spectator, don't run touch functions, etc.
FL_CUSTOMENTITY = 1 shl 29; // This is a custom entity
FL_KILLME = 1 shl 30; // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
FL_DORMANT = 1 shl 31; // Entity is dormant, no updates to client
// SV_EmitSound2 flags
SND_EMIT2_NOPAS = 1 shl 0; // never to do check PAS
SND_EMIT2_INVOKER = 1 shl 1; // do not send to the client invoker
// Engine edict->spawnflags
SF_NOTINDEATHMATCH = $0800; // Do not spawn when deathmatch and loading entities from a file
// Goes into globalvars_t.trace_flags
FTRACE_SIMPLEBOX = 1 shl 0; // Traceline with a simple box
// walkmove modes
WALKMOVE_NORMAL = 0; // normal walkmove
WALKMOVE_WORLDONLY = 1; // doesn't hit ANY entities, no matter what the solid type
WALKMOVE_CHECKONLY = 2; // move, but don't touch triggers
// edict->movetype values
MOVETYPE_NONE = 0; // never moves
//MOVETYPE_ANGLENOCLIP 1;
//MOVETYPE_ANGLECLIP 2;
MOVETYPE_WALK = 3; // Player only - moving on the ground
MOVETYPE_STEP = 4; // gravity, special edge handling -- monsters use this
MOVETYPE_FLY = 5; // No gravity, but still collides with stuff
MOVETYPE_TOSS = 6; // gravity/collisions
MOVETYPE_PUSH = 7; // no clip to world, push and crush
MOVETYPE_NOCLIP = 8; // No gravity, no collisions, still do velocity/avelocity
MOVETYPE_FLYMISSILE = 9; // extra size to monsters
MOVETYPE_BOUNCE = 10; // Just like Toss, but reflect velocity when contacting surfaces
MOVETYPE_BOUNCEMISSILE = 11; // bounce w/o gravity
MOVETYPE_FOLLOW = 12; // track movement of aiment
MOVETYPE_PUSHSTEP = 13; // BSP model that needs physics/world collisions (uses nearest hull for world collision)
// edict->solid values
// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves
// SOLID only effects OTHER entities colliding with this one when they move - UGH!
SOLID_NOT = 0; // no interaction with other objects
SOLID_TRIGGER = 1; // touch on edge, but not blocking
SOLID_BBOX = 2; // touch on edge, block
SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
SOLID_BSP = 4; // bsp clip, touch on edge, block
// edict->deadflag values
DEAD_NO = 0; // alive
DEAD_DYING = 1; // playing death animation or still falling off of a ledge waiting to hit ground
DEAD_DEAD = 2; // dead. lying still.
DEAD_RESPAWNABLE = 3;
DEAD_DISCARDBODY = 4;
DAMAGE_NO = 0;
DAMAGE_YES = 1;
DAMAGE_AIM = 2;
// entity effects
EF_BRIGHTFIELD = 1; // swirling cloud of particles
EF_MUZZLEFLASH = 2; // single frame ELIGHT on entity attachment 0
EF_BRIGHTLIGHT = 4; // DLIGHT centered at entity origin
EF_DIMLIGHT = 8; // player flashlight
EF_INVLIGHT = 16; // get lighting from ceiling
EF_NOINTERP = 32; // don't interpolate the next frame
EF_LIGHT = 64; // rocket flare glow sprite
EF_NODRAW = 128; // don't draw entity
EF_NIGHTVISION = 256; // player nightvision
EF_SNIPERLASER = 512; // sniper laser effect
EF_FIBERCAMERA = 1024;// fiber camera
// entity flags
EFLAG_SLERP = 1; // do studio interpolation of this entity
//
// temp entity events
//
TE_BEAMPOINTS = 0; // beam effect between two points
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_BEAMENTPOINT = 1; // beam effect between point and entity
// short (start entity)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_GUNSHOT = 2; // particle effect plus ricochet sound
// coord coord coord (position)
TE_EXPLOSION = 3; // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
// byte (flags)
//
// The Explosion effect has some flags to control performance/aesthetic features:
TE_EXPLFLAG_NONE = 0; // all flags clear makes default Half-Life explosion
TE_EXPLFLAG_NOADDITIVE = 1; // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite)
TE_EXPLFLAG_NODLIGHTS = 2; // do not render dynamic lights
TE_EXPLFLAG_NOSOUND = 4; // do not play client explosion sound
TE_EXPLFLAG_NOPARTICLES = 8; // do not draw particles
TE_TAREXPLOSION = 4; // Quake1 "tarbaby" explosion with sound
// coord coord coord (position)
TE_SMOKE = 5; // alphablend sprite, move vertically 30 pps
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
TE_TRACER = 6; // tracer effect from point to point
// coord, coord, coord (start)
// coord, coord, coord (end)
TE_LIGHTNING = 7; // TE_BEAMPOINTS with simplified parameters
// coord, coord, coord (start)
// coord, coord, coord (end)
// byte (life in 0.1's)
// byte (width in 0.1's)
// byte (amplitude in 0.01's)
// short (sprite model index)
TE_BEAMENTS = 8;
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_SPARKS = 9; // 8 random tracers with gravity, ricochet sprite
// coord coord coord (position)
TE_LAVASPLASH = 10; // Quake1 lava splash
// coord coord coord (position)
TE_TELEPORT = 11; // Quake1 teleport splash
// coord coord coord (position)
TE_EXPLOSION2 = 12; // Quake1 colormaped (base palette) particle explosion with sound
// coord coord coord (position)
// byte (starting color)
// byte (num colors)
TE_BSPDECAL = 13; // Decal from the .BSP file
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// short (texture index of precached decal texture name)
// short (entity index)
// [optional - only included if previous short is non-zero (not the world)] short (index of model of above entity)
TE_IMPLOSION = 14; // tracers moving toward a point
// coord, coord, coord (position)
// byte (radius)
// byte (count)
// byte (life in 0.1's)
TE_SPRITETRAIL = 15; // line of moving glow sprites with gravity, fadeout, and collisions
// coord, coord, coord (start)
// coord, coord, coord (end)
// short (sprite index)
// byte (count)
// byte (life in 0.1's)
// byte (scale in 0.1's)
// byte (velocity along vector in 10's)
// byte (randomness of velocity in 10's)
TE_BEAM = 16; // obsolete
TE_SPRITE = 17; // additive sprite, plays 1 cycle
// coord, coord, coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (brightness)
TE_BEAMSPRITE = 18; // A beam with a sprite at the end
// coord, coord, coord (start position)
// coord, coord, coord (end position)
// short (beam sprite index)
// short (end sprite index)
TE_BEAMTORUS = 19; // screen aligned beam ring, expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_BEAMDISK = 20; // disk that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_BEAMCYLINDER = 21; // cylinder that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_BEAMFOLLOW = 22; // create a line of decaying beam segments until entity stops moving
// short (entity:attachment to follow)
// short (sprite index)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte,byte,byte (color)
// byte (brightness)
TE_GLOWSPRITE = 23;
// coord, coord, coord (pos) short (model index) byte (scale / 10)
TE_BEAMRING = 24; // connect a beam ring to two entities
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
TE_STREAK_SPLASH = 25; // oriented shower of tracers
// coord coord coord (start position)
// coord coord coord (direction vector)
// byte (color)
// short (count)
// short (base speed)
// short (ramdon velocity)
TE_BEAMHOSE = 26; // obsolete
TE_DLIGHT = 27; // dynamic light, effect world, minor entity effect
// coord, coord, coord (pos)
// byte (radius in 10's)
// byte byte byte (color)
// byte (brightness)
// byte (life in 10's)
// byte (decay rate in 10's)
TE_ELIGHT = 28; // point entity light, no world effect
// short (entity:attachment to follow)
// coord coord coord (initial position)
// coord (radius)
// byte byte byte (color)
// byte (life in 0.1's)
// coord (decay rate)
TE_TEXTMESSAGE = 29;
// short 1.2.13 x (-1 = center)
// short 1.2.13 y (-1 = center)
// byte Effect 0 = fade in/fade out
// 1 is flickery credits
// 2 is write out (training room)
// 4 bytes r,g,b,a color1 (text color)
// 4 bytes r,g,b,a color2 (effect color)
// ushort 8.8 fadein time
// ushort 8.8 fadeout time
// ushort 8.8 hold time
// optional ushort 8.8 fxtime (time the highlight lags behing the leading text in effect 2)
// string text message (512 chars max sz string)
TE_LINE = 30;
// coord, coord, coord startpos
// coord, coord, coord endpos
// short life in 0.1 s
// 3 bytes r, g, b
TE_BOX = 31;
// coord, coord, coord boxmins
// coord, coord, coord boxmaxs
// short life in 0.1 s
// 3 bytes r, g, b
TE_KILLBEAM = 99; // kill all beams attached to entity
// short (entity)
TE_LARGEFUNNEL = 100;
// coord coord coord (funnel position)
// short (sprite index)
// short (flags)
TE_BLOODSTREAM = 101; // particle spray
// coord coord coord (start position)
// coord coord coord (spray vector)
// byte (color)
// byte (speed)
TE_SHOWLINE = 102; // line of particles every 5 units, dies in 30 seconds
// coord coord coord (start position)
// coord coord coord (end position)
TE_BLOOD = 103; // particle spray
// coord coord coord (start position)
// coord coord coord (spray vector)
// byte (color)
// byte (speed)
TE_DECAL = 104; // Decal applied to a brush entity (not the world)
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// byte (texture index of precached decal texture name)
// short (entity index)
TE_FIZZ = 105; // create alpha sprites inside of entity, float upwards
// short (entity)
// short (sprite index)
// byte (density)
TE_MODEL = 106; // create a moving model that bounces and makes a sound when it hits
// coord, coord, coord (position)
// coord, coord, coord (velocity)
// angle (initial yaw)
// short (model index)
// byte (bounce sound type)
// byte (life in 0.1's)
TE_EXPLODEMODEL = 107; // spherical shower of models, picks from set
// coord, coord, coord (origin)
// coord (velocity)
// short (model index)
// short (count)
// byte (life in 0.1's)
TE_BREAKMODEL = 108; // box of models or sprites
// coord, coord, coord (position)
// coord, coord, coord (size)
// coord, coord, coord (velocity)
// byte (random velocity in 10's)
// short (sprite or model index)
// byte (count)
// byte (life in 0.1 secs)
// byte (flags)
TE_GUNSHOTDECAL = 109; // decal and ricochet sound
// coord, coord, coord (position)
// short (entity index???)
// byte (decal???)
TE_SPRITE_SPRAY = 110; // spay of alpha sprites
// coord, coord, coord (position)
// coord, coord, coord (velocity)
// short (sprite index)
// byte (count)
// byte (speed)
// byte (noise)
TE_ARMOR_RICOCHET = 111; // quick spark sprite, client ricochet sound.
// coord, coord, coord (position)
// byte (scale in 0.1's)
TE_PLAYERDECAL = 112; // ???
// byte (playerindex)
// coord, coord, coord (position)
// short (entity???)
// byte (decal number???)
// [optional] short (model index???)
TE_BUBBLES = 113; // create alpha sprites inside of box, float upwards
// coord, coord, coord (min start position)
// coord, coord, coord (max start position)
// coord (float height)
// short (model index)
// byte (count)
// coord (speed)
TE_BUBBLETRAIL = 114; // create alpha sprites along a line, float upwards
// coord, coord, coord (min start position)
// coord, coord, coord (max start position)
// coord (float height)
// short (model index)
// byte (count)
// coord (speed)
TE_BLOODSPRITE = 115; // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent)
// coord, coord, coord (position)
// short (sprite1 index)
// short (sprite2 index)
// byte (color)
// byte (scale)
TE_WORLDDECAL = 116; // Decal applied to the world brush
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// byte (texture index of precached decal texture name)
TE_WORLDDECALHIGH = 117; // Decal (with texture index > 256) applied to world brush
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// byte (texture index of precached decal texture name - 256)
TE_DECALHIGH = 118; // Same as TE_DECAL, but the texture index was greater than 256
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// byte (texture index of precached decal texture name - 256)
// short (entity index)
TE_PROJECTILE = 119; // Makes a projectile (like a nail) (this is a high-priority tent)
// coord, coord, coord (position)
// coord, coord, coord (velocity)
// short (modelindex)
// byte (life)
// byte (owner) projectile won't collide with owner (if owner == 0, projectile will hit any client).
TE_SPRAY = 120; // Throws a shower of sprites or models
// coord, coord, coord (position)
// coord, coord, coord (direction)
// short (modelindex)
// byte (count)
// byte (speed)
// byte (noise)
// byte (rendermode)
TE_PLAYERSPRITES = 121; // sprites emit from a player's bounding box (ONLY use for players!)
// byte (playernum)
// short (sprite modelindex)
// byte (count)
// byte (variance) (0 = no variance in size) (10 = 10% variance in size)
TE_PARTICLEBURST = 122; // very similar to lavasplash.
// coord (origin)
// short (radius)
// byte (particle color)
// byte (duration * 10) (will be randomized a bit)
TE_FIREFIELD = 123; // makes a field of fire.
// coord (origin)
// short (radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
// short (modelindex)
// byte (count)
// byte (flags)
// byte (duration (in seconds) * 10) (will be randomized a bit)
//
// to keep network traffic low, this message has associated flags that fit into a byte:
TEFIRE_FLAG_ALLFLOAT = 1; // all sprites will drift upwards as they animate
TEFIRE_FLAG_SOMEFLOAT = 2; // some of the sprites will drift upwards. (50% chance)
TEFIRE_FLAG_LOOP = 4; // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
TEFIRE_FLAG_ALPHA = 8; // if set, sprite is rendered alpha blended at 50% else, opaque
TEFIRE_FLAG_PLANAR = 16; // if set, all fire sprites have same initial Z instead of randomly filling a cube.
TEFIRE_FLAG_ADDITIVE = 32; // if set, sprite is rendered non-opaque with additive
TE_PLAYERATTACHMENT = 124; // attaches a TENT to a player (this is a high-priority tent)
// byte (entity index of player)
// coord (vertical offset) ( attachment origin.z = player origin.z + vertical offset )
// short (model index)
// short (life * 10 );
TE_KILLPLAYERATTACHMENTS = 125; // will expire all TENTS attached to a player.
// byte (entity index of player)
TE_MULTIGUNSHOT = 126; // much more compact shotgun message
// This message is used to make a client approximate a 'spray' of gunfire.
// Any weapon that fires more than one bullet per frame and fires in a bit of a spread is
// a good candidate for MULTIGUNSHOT use. (shotguns)
//
// NOTE: This effect makes the client do traces for each bullet, these client traces ignore
// entities that have studio models.Traces are 4096 long.
//
// coord (origin)
// coord (origin)
// coord (origin)
// coord (direction)
// coord (direction)
// coord (direction)
// coord (x noise * 100)
// coord (y noise * 100)
// byte (count)
// byte (bullethole decal texture index)
TE_USERTRACER = 127; // larger message than the standard tracer, but allows some customization.
// coord (origin)
// coord (origin)
// coord (origin)
// coord (velocity)
// coord (velocity)
// coord (velocity)
// byte ( life * 10 )
// byte ( color ) this is an index into an array of color vectors in the engine. (0 - )
// byte ( length * 10 )
// contents of a spot in the world
CONTENTS_EMPTY = -1;
CONTENTS_SOLID = -2;
CONTENTS_WATER = -3;
CONTENTS_SLIME = -4;
CONTENTS_LAVA = -5;
CONTENTS_SKY = -6;
CONTENTS_LADDER = -16;
CONTENT_FLYFIELD = -17;
CONTENT_GRAVITY_FLYFIELD = -18;
CONTENT_FOG = -19;
CONTENT_EMPTY = -1;
CONTENT_SOLID = -2;
CONTENT_WATER = -3;
CONTENT_SLIME = -4;
CONTENT_LAVA = -5;
CONTENT_SKY= -6;
// channels
CHAN_AUTO = 0;
CHAN_WEAPON = 1;
CHAN_VOICE = 2;
CHAN_ITEM = 3;
CHAN_BODY = 4;
CHAN_STREAM = 5; // allocate stream channel from the static or dynamic area
CHAN_STATIC = 6; // allocate channel from the static area
CHAN_NETWORKVOICE_BASE = 7; // voice data coming across the network
CHAN_NETWORKVOICE_END = 500; // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
CHAN_BOT = 501; // channel used for bot chatter.
// attenuation values
ATTN_NONE = 0;
ATTN_NORM: Single = 0.8;
ATTN_IDLE: Single = 2.0;
ATTN_STATIC: Single = 1.25;
// pitch values
PITCH_NORM = 100; // non-pitch shifted
PITCH_LOW = 95; // other values are possible - 0-255, where 255 is very high
PITCH_HIGH = 120;
// volume values
VOL_NORM = 1.0;
BREAK_TYPEMASK = $4F;
BREAK_GLASS = $01;
BREAK_METAL = $02;
BREAK_FLESH = $04;
BREAK_WOOD = $08;
BREAK_SMOKE = $10;
BREAK_TRANS = $20;
BREAK_CONCRETE = $40;
BREAK_2 = $80;
// Colliding temp entity sounds
BOUNCE_GLASS = BREAK_GLASS;
BOUNCE_METAL = BREAK_METAL;
BOUNCE_FLESH = BREAK_FLESH;
BOUNCE_WOOD = BREAK_WOOD;
BOUNCE_SHRAP = $10;
BOUNCE_SHELL = $20;
BOUNCE_CONCRETE = BREAK_CONCRETE;
BOUNCE_SHOTSHELL = $80;
// Temp entity bounce sound types
TE_BOUNCE_NULL = 0;
TE_BOUNCE_SHELL = 1;
TE_BOUNCE_SHOTSHELL = 2;
// Rendering constants
kRenderNormal = 0; // src
kRenderTransColor = 1; // c*a+dest*(1-a)
kRenderTransTexture = 2; // src*a+dest*(1-a)
kRenderGlow = 3; // src*a+dest -- No Z buffer checks
kRenderTransAlpha = 4; // src*srca+dest*(1-srca)
kRenderTransAdd = 5; // src*a+dest
kRenderFxNone = 0;
kRenderFxPulseSlow = 1;
kRenderFxPulseFast = 2;
kRenderFxPulseSlowWide = 3;
kRenderFxPulseFastWide = 4;
kRenderFxFadeSlow = 5;
kRenderFxFadeFast = 6;
kRenderFxSolidSlow = 7;
kRenderFxSolidFast = 8;
kRenderFxStrobeSlow = 9;
kRenderFxStrobeFast = 10;
kRenderFxStrobeFaster = 11;
kRenderFxFlickerSlow = 12;
kRenderFxFlickerFast = 13;
kRenderFxNoDissipation = 14;
kRenderFxDistort = 15; // Distort/scale/translate flicker
kRenderFxHologram = 16; // kRenderFxDistort + distance fade
kRenderFxDeadPlayer = 17; // kRenderAmt is the player index
kRenderFxExplode = 18; // Scale up really big!
kRenderFxGlowShell = 19; // Glowing Shell
kRenderFxClampMinScale = 20; // Keep this sprite from getting very small (SPRITES only!)
kRenderFxLightMultiplier = 21; //CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier
FCVAR_ARCHIVE = 1 shl 0; // set to cause it to be saved to vars.rc
FCVAR_USERINFO = 1 shl 1; // changes the client's info string
FCVAR_SERVER = 1 shl 2; // notifies players when changed
FCVAR_EXTDLL = 1 shl 3; // defined by external DLL
FCVAR_CLIENTDLL = 1 shl 4; // defined by the client dll
FCVAR_PROTECTED = 1 shl 5; // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
FCVAR_SPONLY = 1 shl 6; // This cvar cannot be changed by clients connected to a multiplayer server.
FCVAR_PRINTABLEONLY = 1 shl 7; // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
FCVAR_UNLOGGED = 1 shl 8; // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
FCVAR_NOEXTRAWHITEPACE = 1 shl 9; // strip trailing/leading white space from this cvar
// director_cmds.h
// sub commands for svc_director
DRC_ACTIVE = 0; // tells client that he's an spectator and will get director command
DRC_STATUS = 1; // send status infos about proxy
DRC_CAMERA = 2; // set the actual director camera position
DRC_EVENT = 3; // informs the dircetor about ann important game event
// commands of the director API function CallDirectorProc(...)
DRCAPI_NOP = 0; // no operation
DRCAPI_ACTIVE = 1; // de/acivates director mode in engine
DRCAPI_STATUS = 2; // request proxy information
DRCAPI_SETCAM = 3; // set camera n to given position and angle
DRCAPI_GETCAM = 4; // request camera n position and angle
DRCAPI_DIRPLAY = 5; // set director time and play with normal speed
DRCAPI_DIRFREEZE = 6; // freeze directo at this time
DRCAPI_SETVIEWMODE = 7; // overview or 4 cameras
DRCAPI_SETOVERVIEWPARAMS = 8; // sets parameter for overview mode
DRCAPI_SETFOCUS = 9; // set the camera which has the input focus
DRCAPI_GETTARGETS = 10; // queries engine for player list
DRCAPI_SETVIEWPOINTS = 11; // gives engine all waypoints
//DLL State Flags
DLL_INACTIVE = 0; // no dll
DLL_ACTIVE = 1; // dll is running
DLL_PAUSED = 2; // dll is paused
DLL_CLOSE = 3; // closing down dll
DLL_TRANS = 4; // Level Transition
// DLL Pause reasons
DLL_NORMAL = 0; // User hit Esc or something.
DLL_QUIT = 4; // Quit now
DLL_RESTART = 5; // Switch to launcher for linux, does a quit but returns 1
// DLL Substate info ( not relevant )
NG_NORMAL = 1 shl 0;
// For entityType below
ENTITY_NORMAL = 1 shl 0;
ENTITY_BEAM = 1 shl 1;
ET_NORMAL = 0;
ET_PLAYER = 1;
ET_TEMPENTITY = 2;
ET_BEAM = 3;
// BMODEL or SPRITE that was split across BSP nodes
ET_FRAGMENTED = 4;
type
netsrc_s =
(
NS_CLIENT,
NS_SERVER,
NS_MULTICAST // xxxMO
);
netsrc_t = netsrc_s;
TNetSrc = netsrc_t;
PNetSrc = ^TNetSrc;
const
// Event was invoked with stated origin
FEVENT_ORIGIN = 1 shl 0;
// Event was invoked with stated angles
FEVENT_ANGLES = 1 shl 1;
// Skip local host for event send.
FEV_NOTHOST = 1 shl 0;
// Send the event reliably. You must specify the origin and angles and use
// PLAYBACK_EVENT_FULL for this to work correctly on the server for anything
// that depends on the event origin/angles. I.e., the origin/angles are not
// taken from the invoking edict for reliable events.
FEV_RELIABLE = 1 shl 1;
// Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC
// sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ).
FEV_GLOBAL = 1 shl 2;
// If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate
//
FEV_UPDATE = 1 shl 3;
// Only send to entity specified as the invoker
FEV_HOSTONLY = 1 shl 4;
// Only send if the event was created on the server.
FEV_SERVER = 1 shl 5;
// Only issue event client side ( from shared code )
FEV_CLIENT = 1 shl 6;
// all shared consts between server, clients and proxy
TYPE_CLIENT = 0; // client is a normal HL client (default)
TYPE_PROXY = 1; // client is another proxy
TYPE_COMMENTATOR = 3; // client is a commentator
TYPE_DEMO = 4; // client is a demo file
// sub commands of svc_hltv:
HLTV_ACTIVE = 0; // tells client that he's an spectator and will get director commands
HLTV_STATUS = 1; // send status infos about proxy
HLTV_LISTEN = 2; // tell client to listen to a multicast stream
// director command types:
DRC_CMD_NONE = 0; // NULL director command
DRC_CMD_START = 1; // start director mode
DRC_CMD_EVENT = 2; // informs about director command
DRC_CMD_MODE = 3; // switches camera modes
DRC_CMD_CAMERA = 4; // set fixed camera
DRC_CMD_TIMESCALE = 5; // sets time scale
DRC_CMD_MESSAGE = 6; // send HUD centerprint
DRC_CMD_SOUND = 7; // plays a particular sound
DRC_CMD_STATUS = 8; // HLTV broadcast status
DRC_CMD_BANNER = 9; // set GUI banner
DRC_CMD_STUFFTEXT = 10; // like the normal svc_stufftext but as director command
DRC_CMD_CHASE = 11; // chase a certain player
DRC_CMD_INEYE = 12; // view player through own eyes
DRC_CMD_MAP = 13; // show overview map
DRC_CMD_CAMPATH = 14; // define camera waypoint
DRC_CMD_WAYPOINTS = 15; // start moving camera, inetranl message
DRC_CMD_LAST = 15;
// DRC_CMD_EVENT event flags
DRC_FLAG_PRIO_MASK = $0F; // priorities between 0 and 15 (15 most important)
DRC_FLAG_SIDE = 1 shl 4; //
DRC_FLAG_DRAMATIC = 1 shl 5; // is a dramatic scene
DRC_FLAG_SLOWMOTION = 1 shl 6; // would look good in SloMo
DRC_FLAG_FACEPLAYER = 1 shl 7; // player is doning something (reload/defuse bomb etc)
DRC_FLAG_INTRO = 1 shl 8; // is a introduction scene
DRC_FLAG_FINAL = 1 shl 9; // is a final scene
DRC_FLAG_NO_RANDOM = 1 shl 10; // don't randomize event data
// DRC_CMD_WAYPOINT flags
DRC_FLAG_STARTPATH = 1; // end with speed 0.0
DRC_FLAG_SLOWSTART = 2; // start with speed 0.0
DRC_FLAG_SLOWEND = 4; // end with speed 0.0
IN_ATTACK = 1 shl 0;
IN_JUMP = 1 shl 1;
IN_DUCK = 1 shl 2;
IN_FORWARD = 1 shl 3;
IN_BACK = 1 shl 4;
IN_USE = 1 shl 5;
IN_CANCEL = 1 shl 6;
IN_LEFT = 1 shl 7;
IN_RIGHT = 1 shl 8;
IN_MOVELEFT = 1 shl 9;
IN_MOVERIGHT = 1 shl 10;
IN_ATTACK2 = 1 shl 11;
IN_RUN = 1 shl 12;
IN_RELOAD = 1 shl 13;
IN_ALT1 = 1 shl 14;
IN_SCORE = 1 shl 15; // Used by client.dll for when scoreboard is held down
type
VoiceTweakControl =
(
MicrophoneVolume = 0, // values 0-1.
OtherSpeakerScale, // values 0-1. Scales how loud other players are.
MicBoost // 20 db gain to voice input
);
TVoiceTweakControl = VoiceTweakControl;
const
NETAPI_REQUEST_SERVERLIST = 0; // Doesn't need a remote address
NETAPI_REQUEST_PING = 1;
NETAPI_REQUEST_RULES = 2;
NETAPI_REQUEST_PLAYERS = 3;
NETAPI_REQUEST_DETAILS = 4;
// Set this flag for things like broadcast requests, etc. where the engine should not
// kill the request hook after receiving the first response
FNETAPI_MULTIPLE_RESPONSE = 1 shl 0;
NET_SUCCESS = 0;
NET_ERROR_TIMEOUT = 1 shl 0;
NET_ERROR_PROTO_UNSUPPORTED = 1 shl 1;
NET_ERROR_UNDEFINED = 1 shl 2;
type
netadrtype_t =
(
NA_UNUSED,
NA_LOOPBACK,
NA_BROADCAST,
NA_IP,
NA_IPX,
NA_BROADCAST_IPX
);
TNetAdrType = netadrtype_t;
ptype_t =
(
pt_static,
pt_grav,
pt_slowgrav,
pt_fire,
pt_explode,
pt_explode2,
pt_blob,
pt_blob2,
pt_vox_slowgrav,
pt_vox_grav,
pt_clientcustom // Must have callback function specified
);
TPType = ptype_t;
const
NUM_GLYPHS = 256;
// DATA STRUCTURE INFO
MAX_NUM_ARGVS = 50;
// SYSTEM INFO
MAX_QPATH = 64; // max length of a game pathname
MAX_OSPATH = 260; // max length of a filesystem pathname
ON_EPSILON = 0.1; // point on plane side epsilon
MAX_LIGHTSTYLE_INDEX_BITS = 6;
MAX_LIGHTSTYLES = 1 shl MAX_LIGHTSTYLE_INDEX_BITS;
// Resource counts;
MAX_MODEL_INDEX_BITS = 9; // sent as a short
MAX_MODELS = 1 shl MAX_MODEL_INDEX_BITS;
MAX_SOUND_INDEX_BITS = 9;
MAX_SOUNDS = 1 shl MAX_SOUND_INDEX_BITS;
MAX_GENERIC_INDEX_BITS = 9;
MAX_GENERIC = 1 shl MAX_GENERIC_INDEX_BITS;
MAX_DECAL_INDEX_BITS = 9;
MAX_BASE_DECALS = 1 shl MAX_DECAL_INDEX_BITS;
MAX_USER_MSG_DATA = 192;
// Temporary entity array
TENTPRIORITY_LOW = 0;
TENTPRIORITY_HIGH = 1;
// TEMPENTITY flags
FTENT_NONE = $00000000;
FTENT_SINEWAVE = $00000001;