Inside3D tutorials.
Created By: | DamieN |
eMail: | decker96@ix.netcom.com |
Difficulty Scale: | Easy\Medium |
/* */ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; void () player_run; void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage; void(vector org, vector vel, float damage) SpawnBlood; void() SuperDamageSound; void() DropTeleport; //Add this void() Teleport_to_drop; //Add this void (vector org) spawn_tfog; //Add this void (vector org, entity death_owner) spawn_tdeath; //Add this
/* ========== Self Teleporter ========== */ void() DropTeleport = //Will drop location for The destination { if(!self.tele_dropped) { self.teledrop_dest = spawn(); //create a temp entity for location of Teleporter } self.teledrop_dest.origin = self.origin; //records the location self.teledrop_dest.mangle = self.angles; self.tele_dropped = 1; dprint("Teleport destination dropped."); }; void() Teleport_to_drop = { //This will Teleport you to the Teleport Location temp entity that was recorded above local vector org; if(!self.tele_dropped) { dprint("No destination dropped."); return; } if(self.health <= 0) { return; } spawn_tfog (self.teledrop_dest.origin); makevectors (self.teledrop_dest.mangle); org = self.teledrop_dest.origin; spawn_tfog (org); spawn_tdeath (org,self); setorigin (self,self.teledrop_dest.origin); self.angles = self.teledrop_dest.mangle; self.fixangle = 1; self.velocity = v_forward * 100; self.teleport_time = time + 0.5; // Shorter teleport recovery time self.flags = self.flags - self.flags & FL_ONGROUND; }; /* ============ ImpulseCommands ============
Step 4
Now scroll down just a little bit, under Impulse Commands, and before
self.impulse = 0;
add(add is red) these lines:
if (self.impulse == 14) DropTeleport (); if (self.impulse == 15) Teleport_to_drop (); self.impulse = 0;
.entity teledrop_dest;
.float tele_dropped;
(They are going to be the 2 very last lines in the defs.qc file!)
Step 6
And that's it! Compile it, and load it up the usual way. And remember to bind the impulses to a
key! That makes it alot easier to get away from a beeing killed!