1 void SUB_DontUseTargets() { }
7 activator = self.enemy;
12 void FixSize(entity e)
14 e.mins_x = rint(e.mins_x);
15 e.mins_y = rint(e.mins_y);
16 e.mins_z = rint(e.mins_z);
18 e.maxs_x = rint(e.maxs_x);
19 e.maxs_y = rint(e.maxs_y);
20 e.maxs_z = rint(e.maxs_z);
24 ==============================
27 the global "activator" should be set to the entity that initiated the firing.
29 If self.delay is set, a DelayedUse entity will be created that will actually
30 do the SUB_UseTargets after that many seconds have passed.
32 Centerprints any self.message to the activator.
34 Removes all entities with a targetname that match self.killtarget,
35 and removes them, so some events can remove other triggers.
37 Search for (string)targetname in all entities that
38 match (string)self.target and call their .use function
40 ==============================
44 entity t, stemp, otemp, act;
53 // create a temp object to fire at a later time
55 t.classname = "DelayedUse";
56 t.nextthink = time + self.delay;
59 t.message = self.message;
60 t.killtarget = self.killtarget;
61 t.target = self.target;
62 t.target2 = self.target2;
63 t.target3 = self.target3;
64 t.target4 = self.target4;
74 if(IS_PLAYER(activator) && self.message != "")
75 if(IS_REAL_CLIENT(activator))
77 centerprint(activator, self.message);
79 play2(activator, "misc/talk.wav");
83 // kill the killtagets
88 for(t = world; (t = find(t, targetname, s)); )
100 if(stemp.target_random)
101 RandomSelection_Init();
103 for(i = 0; i < 4; ++i)
108 case 0: s = stemp.target; break;
109 case 1: s = stemp.target2; break;
110 case 2: s = stemp.target3; break;
111 case 3: s = stemp.target4; break;
115 for(t = world; (t = find(t, targetname, s)); )
118 if(stemp.target_random)
120 RandomSelection_Add(t, 0, string_null, 1, 0);
133 if(stemp.target_random && RandomSelection_chosen_ent)
135 self = RandomSelection_chosen_ent;
147 void trigger_touch_generic(void() touchfunc)
150 for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
153 vector emin = e.absmin, emax = e.absmax;
154 if(self.solid == SOLID_BSP)
159 if(boxesoverlap(emin, emax, self.absmin, self.absmax)) // quick
160 if(WarpZoneLib_BoxTouchesBrush(emin, emax, self, e)) // accurate
167 void trigger_draw_generic()
169 float dt = time - self.move_time;
170 self.move_time = time;
171 if(dt <= 0) { return; }
173 if(self.trigger_touch) { trigger_touch_generic(self.trigger_touch); }