Forum

[beta release] Return to Nameless City

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

Postby goldenboy » Sun Feb 28, 2010 12:08 am

Oh, I just meant that I should have thought of stuffcmd - hence the facepalm.

I'm thinking to do this inside a trigger, as well as the automatic quickloading on death. Every mod should have this.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby Scrama » Mon Mar 01, 2010 5:41 am

items.qc
Code: Select all
void() key_touch =
{
   if (other.classname != "player")
      return;
   if (other.health <= 0)
      return;
   if (other.items & self.items)
      return;

   sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
   stuffcmd (other, "bf\n");
   other.items = other.items | self.items;

   // Scrama: auto save games on old maps
   // rtnc maps should use trigger_autosave
   if (!world.frags)
      SUB_AutoSave();

   sprint (other, "You got the ");
   sprint (other, self.netname);
   sprint (other,"\n");

   activator = other;
   SUB_UseTargets();            // fire all targets / killtargets
   if (!coop)
      remove(self);
};

and somewere
Code: Select all
void () SUB_AutoSave =
{
   if (coop||deathmatch)
      return;
      
   localcmd("save auto\n");
   game_autosaved = 1;
}

client.qc
Code: Select all
void() respawn =
{
   if ((intermission_running)&&((coop)||(deathmatch)))  // not allowed during intermission
      return;

   if (coop)
   {
      // make a copy of the dead body for appearances sake
      CopyToBodyQue (self);
      //   save weapons and ammo
      // get the spawn parms as they were at level start
      setspawnparms (self);
      // respawn
      PutClientInServer ();
   }
   else if (deathmatch)
   {
      // make a copy of the dead body for appearances sake
      CopyToBodyQue (self);
      // set default spawn parms
      SetNewParms ();
      // respawn      
      PutClientInServer ();
   }
   else
   {   // restart the entire server
      if (game_autosaved)
         localcmd ("load auto\n");
      else
         localcmd ("restart\n");
   }
};


Dr. Shadowborg +1 =)
User avatar
Scrama
 
Posts: 20
Joined: Fri Aug 28, 2009 6:16 am
Location: Siberia, Omsk

Postby goldenboy » Mon Mar 01, 2010 6:13 am

Thanks.

I'm going to use an autosaving trigger in strategic spots of RMQ Episode 1 - one of its trademarks are "traps", so this will come in handy. :)
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest