forked from itslunaranyo/copper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_tele.qc
787 lines (672 loc) · 20.9 KB
/
t_tele.qc
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
/*
==============================================================================
TELEPORT TRIGGERS
all teleport functionality handled by one function, to allow me to invoke
teleports with a couple different entities that don't replicate each other's
code
==============================================================================
*/
float TELEPORT_PLAYER_ONLY = 1;
float TELEPORT_SILENT = 2;
float TELEPORT_PUSH = 2;
float TELEPORT_TRIGGER_FIRST = 4;
float TELEPORT_NOTRIGGER = 8;
float TELEPORT_NOFLASH = 16;
float TELEPORT_MONSTER_ONLY = 32;
// --------------------------------
void() teleport_flash =
{
local float v;
local string snd;
v = random() * 5;
if (v < 1)
snd = "misc/r_tele1.wav";
else if (v < 2)
snd = "misc/r_tele2.wav";
else if (v < 3)
snd = "misc/r_tele3.wav";
else if (v < 4)
snd = "misc/r_tele4.wav";
else
snd = "misc/r_tele5.wav";
sound (self, CHAN_VOICE, snd, 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TELEPORT);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
}
// player teleports are the only case we don't want to play the tflash right on
// an entity, so teleport_flash still accepts an entity argument and we just make
// a temp entity for it in this single case
// arguably not at all better than changing teleport_flash to accept a vector arg
// but we need an ent to play the sound on anyway
void() teleport_flasher =
{
teleport_flash();
remove(self);
}
void(float d) teleport_flash_delay =
{
entity flash;
if (d)
{
flash = spawn();
setorigin(flash, self.origin);
flash.think = teleport_flasher;
flash.nextthink = time + d;
return;
}
teleport_flash();
}
/*
================================
TELEPORT LIMBO
not telefragging teammates in coop sometimes cannot be avoided (spawning in
the wrong place, or falling into a func_void two at a time)
instead clients will disappear into 'teleport limbo' if they would telefrag
a teammate upon arrival, seeing a black screen until the destination is clear
a trigger_push is spawned at the destination to nudge players, but if this
doesn't work after 1 second of waiting, the teleporting player can press jump
or fire to force a telefrag. after 5 seconds it happens automatically.
================================
*/
void(entity client, entity dst, float tfog, float nofwd) teleport_enter_limbo =
{
ClearItemEffects(client); // remove powerups to clear glows/tints
TintScreen(client, 255);
client.flags |= FL_NOTARGET;
client.customflags |= CFL_LIMBO;
client.takedamage = DAMAGE_NO;
client.solid = SOLID_NOT;
client.movetype = MOVETYPE_NONE;
client.goalentity = dst;
client.dest = Vector(tfog, nofwd, 0); // z is for the 'force' flag
client.velocity = VEC_ORIGIN;
client.model = string_null;
client.attack_finished = time + 1; // allow forcing a telefrag after 1000ms
client.search_time = time + 0.1;
spawn_tpush(dst, client); // gust of wind at the spot to hasten the process
}
void(entity client) teleport_exit_limbo =
{
TintScreen(client, 0);
RestoreItemEffects(client);
client.flags = not(client.flags, FL_NOTARGET);
client.customflags = not(client.customflags, CFL_LIMBO);
client.takedamage = DAMAGE_AIM;
client.solid = SOLID_SLIDEBOX;
client.movetype = MOVETYPE_WALK;
self.attack_finished = time + 0.1; // don't shoot on the first frame
client.dest = VEC_ORIGIN;
if (has_invis(client))
{
client.modelindex = modelindex_eyes;
client.model = "progs/eyes.mdl";
}
else
{
client.modelindex = modelindex_player;
client.model = "progs/player.mdl";
}
}
void() teleport_limbo_think =
{
// self is the player in limbo
// if it's been a second, check for jump/fire and set force flag
if (time >= self.attack_finished)
{
if (self.button1 || self.button2 || self.button0 ||
time >= self.attack_finished + 4) // autoforce after 5 seconds
{
self.dest_z = TRUE;
}
}
// keep trying to teleport
if (time >= self.search_time)
{
self.search_time = time + 0.1;
teleport(self, self.goalentity, self.dest_x, self.dest_y);
}
}
float(entity spot) teleport_check_for_client =
{
float cl = 0;
entity pl = world;
while (cl < clients)
{
pl = find(pl, classname, "player");
if (!pl) break;
if (pl.health <= 0 || pl.type == "head") continue;
if (pl != self) // players can't block themselves
if (BoundsTouching(spot.absmin, spot.absmax, pl.absmin, pl.absmax, 2))
return TRUE;
cl++;
}
// also check for client owned teledeath here
pl = world;
do {
pl = find(pl, classname, "teledeath");
if (pl)
if (pl.owner.classname == "player")
if (BoundsTouching(spot.absmin, spot.absmax, pl.absmin, pl.absmax, 2))
return TRUE;
} while (pl);
return FALSE;
}
/*
================================
TELEPORT
just call this to teleport something somewhere
================================
*/
void(entity traveler, entity dst, float tfog, float nofwd) teleport =
{
vector vdir;
float flash = 3; // 1 = @org, 2 = @dest, 3 = both
entity t;
// telefrag protection in coop
if (coop && traveler.classname == "player")
{
if (teleport_check_for_client(dst))
{
if (!(traveler.customflags & CFL_LIMBO))
{
teleport_enter_limbo(traveler, dst, tfog, nofwd);
flash = 1;
}
else if (traveler.dest_z != 0)
{
teleport_exit_limbo(traveler);
flash = 2;
}
else return; // stay in limbo
}
else if (traveler.customflags & CFL_LIMBO)
{
teleport_exit_limbo(traveler);
flash = 2;
}
}
if (dst.classname == "misc_teleporttrain")
{
// monsters get pooped out of a teleport train facing their enemy
if ((traveler.flags & FL_MONSTER) && traveler.enemy)
{
vdir = vectoangles(traveler.enemy.origin - dst.origin);
}
// if the teleball isn't moving, emerge facing the direction you traveled to help orientation
else if (dst.buddy && dst.buddy.velocity == VEC_ORIGIN)
{
vdir = vectoangles(dst.origin - traveler.origin);
nofwd = TRUE;
}
// if the teleball is moving, face the direction the teleball is moving
else
{
vdir = vectoangles(dst.velocity);
}
vdir_x = 0; // null pitch
}
else
vdir = dst.mangle;
if (tfog)
{
if (flash & 1)
SUB_CallAsSelf(teleport_flash, traveler); // flash at departure point
if (flash & 2)
{
t = spawn();
// teleport controller's origin is desired teleport flash location on arrival
if (traveler.classname == "player")
{
makevectors (vdir);
setorigin(t, dst.origin + v_forward * 16);
}
else
{
setorigin(t, dst.origin);
}
t.think = teleport_flasher;
t.nextthink = time + 0.05;
}
}
if (traveler.customflags & CFL_LIMBO)
return;
spawn_tdeath(dst.origin, traveler);
setorigin(traveler, dst.origin);
traveler.angles = vdir;
if (traveler.flags & FL_MONSTER)
{
traveler.ideal_yaw = traveler.angles_y;
}
if (traveler.classname == "player")
{
fog_setFromEnt(traveler, dst);
traveler.fixangle = 1; // turn this way immediately
makevectors (vdir);
if (dst.classname == "info_teleport_destination" ||
dst.classname == "info_teleport_target" ||
dst.classname == "misc_teleporttrain" ||
dst.classname == "info_notnull")
{
t = self;
self = dst;
activator = traveler;
SUB_UseTargets();
self = t;
}
if (nofwd)
{
traveler.velocity = VEC_ORIGIN;
}
else
{
traveler.teleport_time = time + 0.7;
traveler.velocity = v_forward * 300;
}
}
else
{
traveler.velocity = VEC_ORIGIN;
}
traveler.flags = not(traveler.flags, FL_ONGROUND);
}
// --------------------------------
// tpush
//
// shove coop players off a teledest as a more neighborly alternative to telefragging them
// --------------------------------
void() tpush_touch =
{
if (!CheckValidTouch()) return; // don't telepush monsters
if (other == self.owner)
{
// our owner has arrived by teleport, tpush no longer needed
SUB_RemoveSoon();
return;
}
// push all clients in coop
if (time != self.dmgtime)
if (time < self.attack_finished)
return;
other.velocity = self.mangle;
self.dmgtime = time;
self.attack_finished = time + 0.1;
}
void(entity spot, entity pusher) spawn_tpush =
{
entity p;
vector dir;
p = spawn();
p.classname = "telepush";
p.movetype = MOVETYPE_NONE;
p.solid = SOLID_TRIGGER;
setsize (p, pusher.mins - '1 1 1', pusher.maxs + '1 1 1');
setorigin (p, spot.origin);
if (spot.mangle != VEC_ORIGIN)
dir = spot.mangle;
else
dir = spot.angles;
makevectors(dir);
p.mangle = v_forward * 300 + '0 0 50';
p.touch = tpush_touch;
p.nextthink = time + 1;
p.think = SUB_Remove;
p.owner = pusher;
force_retouch = 2; // make sure even still objects get hit
}
// --------------------------------
// tdeath
// --------------------------------
void() tdeath_touch =
{
if (other == self.owner)
return;
// original owner of this teledeath has cleared its bounds, and there's
// no more danger of overlapping bboxes, so remove it
if (!BoundsTouching(self.absmin, self.absmax, self.owner.absmin, self.owner.absmax, 2))
{
SUB_RemoveSoon();
return;
}
// frag anyone who teleports in on top of an invincible player
if (other.classname == "player")
{
if (has_invuln(other))
self.classname = "teledeath2";
if (self.owner.classname != "player")
{ // other monsters explode themselves
T_Damage (self.owner, self, self, 50000, DMGTYPE_TELEFRAG);
return;
}
}
if ((other.flags & FL_MONSTER) && (other.spawnflags & SPAWN_NO_TFRAG))
return;
if (other.health)
T_Damage (other, self, self, 50000, DMGTYPE_TELEFRAG);
}
entity(vector org, entity death_owner) spawn_tdeath =
{
entity death;
// dumb hack so the world isn't flooded with a tdeath for every monster at map start
if (time < 2) return world;
death = spawn();
death.classname = "teledeath";
death.movetype = MOVETYPE_NONE;
death.solid = SOLID_TRIGGER;
setsize (death, death_owner.mins - '0.1 0.1 0.1', death_owner.maxs + '0.1 0.1 0.1');
setorigin (death, org);
death.angles = '0 0 0';
death.touch = tdeath_touch;
death.nextthink = time + 0.2;
death.think = SUB_Remove;
death.owner = death_owner;
force_retouch = 2; // make sure even still objects get hit
return death;
}
// --------------------------------
void() teleport_touch =
{
local entity t;
if (self.customflags & CFL_LOCKED) return;
if (other.health <= 0 || other.solid != SOLID_SLIDEBOX) return; // only teleport living creatures
if (other.movetype == MOVETYPE_NOCLIP) return;
if ((self.spawnflags & TELEPORT_PLAYER_ONLY) && (other.classname != "player")) return;
if ((self.spawnflags & TELEPORT_MONSTER_ONLY) && !(other.flags & FL_MONSTER)) return;
if ((self.spawnflags & TELEPORT_NOTRIGGER) == 0)
if (self.targetname != string_null)
if ((self.spawnflags & TELEPORT_TRIGGER_FIRST) == 0) // not trigger first
if (self.nextthink < time)
{
//dprint3(" teleport with targetname ", self.targetname, " not activated yet, not teleporting\n");
return;
}
t = findunlockedtarget(self, world);//find (world, targetname, self.target);
if (!t)
{
objerror ("teleporter couldn't find target");
return;
}
playercount_convert(count);
if (!self.count)
{
SUB_RemoveSoon();
return;
}
else if (self.count > 0)
self.count -= 1;
teleport( other, t, ((self.spawnflags & TELEPORT_NOFLASH) == 0), 0 );
if (t.classname == "misc_teleporttrain")
return;
activator = other;
SUB_UseTargets();
}
// ================================================================
/*QUAKED info_teleport_destination (.8 0 .9) (-16 -16 0) (16 16 48)
This is the destination marker for a teleporter.
Keys:
"angle" new view angle after teleporting
"targetname" value used by teleporter
"fog_color"/"fog_density" set the fog for anyone teleporting here
*/
/*FGD
@PointClass size(-16 -16 0, 16 16 48) color(240 0 255) base(Appearflags, Angle, Targetname, Fog) model({ "path": ":progs/player.mdl" }) = info_teleport_destination : "Teleporter destination" []
*/
void() info_teleport_destination =
{
if (!SUB_ShouldSpawn()) return;
if (!self.targetname)
objerror ("no targetname");
self.mangle = self.angles;
self.angles = '0 0 0';
self.model = string_null;
self.origin = self.origin + '0 0 27';
setsize(self,VEC_HULL_MIN,VEC_HULL_MAX);
fog_fixKeys();
}
// --------------------------------
// info_teleport_target
//
// this entity is handy when activating a big trigger_teleport volume
// to try and teleport something is inconvenient
// --------------------------------
float(.string fld) teleport_target_acton =
{
if (self.fld == string_null)
return FALSE;
entity t;
float did = FALSE;
t = find(world, targetname, self.fld);
while (t)
{
if (teleport_target_check(t))
{
teleport( t, self, !(self.spawnflags & TELEPORT_NOFLASH), !(self.spawnflags & TELEPORT_PUSH) );
t.jump_flag = 0;
did = TRUE;
}
t = find(t, targetname, self.fld);
}
return did;
}
float(entity e) teleport_target_check =
{
if (self.spawnflags & TELEPORT_PLAYER_ONLY)
if (e.classname != "player")
return FALSE;
if (self.spawnflags & TELEPORT_MONSTER_ONLY)
if (!(e.flags & FL_MONSTER))
return FALSE;
if (e.movetype == MOVETYPE_NOCLIP)
return FALSE;
// only teleport living creatures
if (e.health <= 0 || e.solid != SOLID_SLIDEBOX)
return FALSE;
return TRUE;
}
// teleports the activator to this spot
void() teleport_target_use =
{
if (self.customflags & CFL_LOCKED)
{
dprint(" teleport_target is locked: not teleporting\n");
return;
}
// trigger first
if (self.spawnflags & 4)
{
self.spawnflags -= 4;
return;
}
playercount_convert(count);
if (!self.count)
{
SUB_RemoveSoon();
return;
}
if (self.spawnflags & 8)
{
if (teleport_target_acton(target) ||
teleport_target_acton(target2) ||
teleport_target_acton(target3) ||
teleport_target_acton(target4))
{
if (self.count > 0)
self.count -= 1;
}
}
else
{
if (!teleport_target_check(activator))
return;
if (self.count > 0)
self.count -= 1;
teleport( activator, self, !(self.spawnflags & TELEPORT_NOFLASH), !(self.spawnflags & TELEPORT_PUSH) );
activator.jump_flag = 0;
}
}
/*QUAKED info_teleport_target (.5 .75 .25) (-16 -16 -8) (16 16 40) PLAYER_ONLY PUSH TRIGGER_FIRST ACT_ON_TARGETS NOFLASH MONSTER_ONLY
This is a usable destination marker that acts as its own teleporter. When triggered, the activator is teleported to this spot.
Flags:
PLAYER_ONLY only players will teleport
PUSH chuck the player forward like a trigger_teleport does
TRIGGER_FIRST first use turns it on, and every subsequent use teleports
ACT_ON_TARGETS teleport its targets intead of firing them and ignore the activator
NOFLASH don't spawn telefog or make noise
MONSTER_ONLY only monsters will teleport
Keys:
"fog_color"/"fog_density" set the fog for anyone teleporting here
"count" remove after this many uses
*/
/*FGD
@PointClass size(-16 -16 -8, 16 16 40) base(Appearflags, Angle, Fog, Trigger) = info_teleport_target : "Triggerable Teleporter destination
This is a usable destination marker that acts as its own teleporter. When triggered, the activator is teleported to this spot.
If 'Act On Targets' is set, teleports its targets intead of firing them and ignores the activator.
If 'Player only' or 'Monsters only' is checked, this can only be activated by players or monsters respectively.
Set 'Push forward' if you want the teleport-exit forward velocity effect, or 'No teleflash' to plop an entity here silently.
PLAYER_ONLY only players will teleport
PUSH chuck the player forward like a trigger_teleport does
TRIGGER_FIRST first use turns it on, and every subsequent use teleports
NOFLASH don't spawn telefog or make noise
MONSTER_ONLY only monsters will teleport"
[
spawnflags(flags) = [
1 : "Player only" : 0
2 : "Push forward" : 0
8 : "Act On Targets" : 0
16 : "No teleflash" : 0
32 : "Monsters only" : 0
]
count(integer) : "Remove after this many uses"
]
*/
void() info_teleport_target =
{
if (!SUB_ShouldSpawn()) return;
if (self.targetname == string_null && !self.impulse)
objerror ("no targetname");
if ((self.spawnflags & 8) &&
(self.target == string_null && self.target2 == string_null &&
self.target3 == string_null && self.target4 == string_null))
objerror ("act_on_targets with no target set");
self.mangle = self.angles;
self.angles = '0 0 0';
setorigin(self, self.origin + '0 0 16'); //
setsize(self,VEC_HULL_MIN,VEC_HULL_MAX);
self.count = zeroconvertdefault(self.count, -1);
self.use = teleport_target_use;
fog_fixKeys();
}
// --------------------------------
void() teleport_hum =
{
local vector o;
if (self.origin != '0 0 0')
o = self.origin;
else
o = (self.absmin + self.absmax)*0.5;
ambientsound (o, "ambience/hum1.wav",0.5 , ATTN_STATIC);
}
void() teleport_use =
{
self.nextthink = time + 0.2;
force_retouch = 2; // make sure even still objects get hit
self.think = SUB_Null;
}
void() teleport_reactivate =
{
trigger_reactivate();
// triggerfirst + nonsilent = delayed ambientsound, so shortcut teleporters don't sound like secrets
if ( self.spawnflags & TELEPORT_TRIGGER_FIRST && !(self.spawnflags & TELEPORT_SILENT) )
teleport_hum();
self.use = teleport_use;
}
void() trigger_teleport_setup =
{
self.touch = teleport_touch;
// find the destination
if (!self.target)
objerror ("no target");
self.use = teleport_use;
self.count = zeroconvertdefault(self.count, -1);
if (!(self.spawnflags & TELEPORT_SILENT))
{
precache_sound_safe ("ambience/hum1.wav");
if (!(self.spawnflags & TELEPORT_TRIGGER_FIRST))
teleport_hum();
}
}
/*FGD
@baseclass base(Appearflags, Target, Targetname) = Teleport [
spawnflags(Flags) =
[
1 : "Player only" : 0
2 : "Silent" : 0
8 : "Not triggerable (ignore targetname)" : 0
16 : "No teleflash" : 0
32 : "Monsters only" : 0
]
count(integer) : "Limited uses" : -1
]
*/
/*QUAKED trigger_teleport (.5 .0 .5) ? PLAYER_ONLY SILENT TRIGGER_FIRST NOTRIGGER NOFLASH MONSTER_ONLY
Any object touching this will be transported to the corresponding info_teleport_destination entity.
You must set the "target" field, and create an object with a "targetname" field that matches.
Flags:
"player_only" only players will teleport
"silent" no whispering from the slipgate
"trigger_first" won't be touchable until triggered once by something else
"notrigger" default behavior for a teleporter with a targetname is to only teleport what's touching it
when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's
targetname for a killtarget for example)
"noflash" don't spawn tfog or make noise
"monster_only" only monsters will teleport
Keys:
"target" targetname of info_teleport_destination (required)
"targetname" entity name (required)
"count" remove after this many uses
*/
/*FGD
@SolidClass base(Trigger, Teleport) = trigger_teleport : "Trigger: Teleporter.
Any object touching this will be transported to the corresponding info_teleport_destination entity.
The 'Not Triggerable' spawnflag: default behavior for a teleporter with a targetname is to only teleport what's touching it when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's targetname for a killtarget for example)." []
*/
void() trigger_teleport =
{
if (!SUB_ShouldSpawn()) return;
InitTrigger ();
trigger_teleport_setup(); // after inittrigger, so that size/model is set, so the telehum hums in the right place
if (self.spawnflags & TELEPORT_TRIGGER_FIRST)
self.use = teleport_reactivate;
}
/*QUAKED trigger_teleport_box (.5 .0 .5) (-8 -8 -8) (8 8 8) PLAYER_ONLY SILENT TRIGGER_FIRST NOTRIGGER
Any object touching this will be transported to the corresponding info_teleport_destination entity.
You must set the "target" field, and create an object with a "targetname" field that matches.
Quoth2-style edict-saving bounding box trigger: define bounds size with 'size' - trigger volume will be centered on the trigger's origin.
Flags:
"player_only" only players will teleport
"silent" no whispering from the slipgate
"trigger_first" won't be touchable until triggered once by something else
"notrigger" default behavior for a teleporter with a targetname is to only teleport what's touching it
when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's
targetname for a killtarget for example)
"noflash" don't spawn tfog or make noise
Keys:
"target" targetname of info_teleport_destination (required)
"targetname" entity name (required)
*/
/*FGD
@PointClass base(Trigger, Teleport, Bounds) = trigger_teleport_box : "Trigger: Teleporter.
Any object touching this will be transported to the corresponding info_teleport_destination entity.
Quoth2-style edict-saving bounding box trigger: define bounds size with 'size' - trigger volume will be centered on the trigger's origin.
The 'Not Triggerable' spawnflag: default behavior for a teleporter with a targetname is to only teleport what's touching it when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's targetname for a killtarget for example)." []
*/
void() trigger_teleport_box =
{
if (!SUB_ShouldSpawn()) return;
InitTriggerBounds();
trigger_teleport_setup();
if (self.spawnflags & TELEPORT_TRIGGER_FIRST)
self.use = teleport_reactivate;
}