Rune Central

The Official Rune Quake Message Board
It is currently Mon Aug 10, 2020 6:34 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Teleporting Holograms
PostPosted: Sun Dec 04, 2005 9:27 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 235
Location: North Carolina
Just an alternative to normal/exploding holograms. Think of it like Dual Recall with 5 different places to teleport between.

This modification lets you swap places one at a time with each of your placed Holograms. They now all face the same direction you're looking in to make it hard to tell when you've switched. They also will have the same special effects your player has (like when shooting).

This code does not support telefragging, but it's easy to add. (I forgot to add it, but I'm tired now).

runes20.qc
Code:
void ()
Holo_Think =
{
   //IEEE ADD
   if (self.owner.runevector_x == self.runevector_x  && self.owner.runevector_y == 1)
      {
      local vector lastspot;
      lastspot = self.owner.origin;//Get the player's last location
      setorigin (self.owner, self.origin);//Move the player to the hologram
      setorigin (self, lastspot);//Move the hologram to where the player was
      self.owner.runevector_y = 0;//Reset the owner's teleport trigger
      self.runetime = time + 30;//Reset the time as if you spawned another one.
      }

   if (self.runetime < time)
   {
      if (maybe_update_trap_count (self.owner, RN_HOLO))
         sprint (self.owner, "A hologram burned out\n");

      spawn_tfog (self.origin);
      //IEEE ADD Subtract to get the correct number of holograms
      self.owner.runevector_x = self.owner.runevector_x - 1;

      remove (self);
      return;
   }

   //IEEE ADD Give the hologram the same effects to make them harder to tell which are fake
   //(Also used in Beatdown Alley)
   if (self.effects != self.owner.effects)
      self.effects = self.owner.effects;

   self.angles = self.owner.angles;
   //IEEE REMOVE This code is no longer needed
   //self.angles_y = self.angles_y + self.runevar;
   self.frame = self.owner.frame;
   self.nextthink = time + sys_ticrate;
};

void (float riders, entity of_e)
Rune_Holo_sprint =
{
   rprint_numdesc (self, riders, of_e.runevar, "hologram");
   rprint (self, riders, " active\n");
};

void ()
Rune_Holo =
{
   local entity hologram;

   //IEEE ADD Used for numbering the Holograms and for cycling through them when teleporting
   self.runevector_x = self.runevector_x + 1;

   if (self.runevar >= MAX_HOLO)
   {
      //IEEE ADD
      self.runevector_y = 1;//Used as a trigger in Holo_Think
      if (self.runevector_x >= MAX_HOLO)
         self.runevector_x = 1;//Reset to start teleporting at the start
      
      //IEEE REMOVE Not needed now
      //centerprint (self, "Too many fakes!");
      return;
   }


   self.runevar = self.runevar + 1;


   hologram = spawn ();

   //IEEE ADD
   hologram.runevector = self.runevector;//Number the holograms starting with 1

   hologram.movetype = MOVETYPE_NONE;
   hologram.solid = SOLID_NOT;
   hologram.owner = self;
   hologram.classname = "hologram";
   setmodel (hologram, "progs/player.mdl");
   setorigin (hologram, self.origin);
   setsize (hologram, VEC_ORIGIN, VEC_ORIGIN);
   hologram.angles = self.angles;
   hologram.colormap = self.colormap;
   hologram.think = Holo_Think;
   hologram.nextthink = time;
   sound (hologram, CHAN_BODY, "misc/basekey.wav", 1, ATTN_NORM);
   hologram.runetime = time + 30;

   //IEEE REMOVE To simplify flawless direction/angle switching
   //hologram.runevar = crandom ()*360;

};



Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group