Forum

Skins?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Skins?

Postby redrum » Tue Feb 28, 2012 9:20 pm

OK, finally got those nasty little Frikbots into my QW server. :D
Now I'm trying to change their skins. I made a new player.mdl called player1.mdl. The new model has numerous skins.
Here's the code in PutClientInServer();
Code: Select all
   setmodel (self, "progs/eyes.mdl");
   modelindex_eyes = self.modelindex;
   setmodel (self, "progs/player1.mdl");
   modelindex_player = self.modelindex;

        if (self.netname == "òåäòõí")   // working, just not for bots
           self.skin = 1;

        if (self.netname == "Shadow")
           self.skin = 2;

        if (self.netname == "Godzilla")                 
           self.skin = 3;

Ok, so it works for the "human" player but not for the Frikbots. :?
I've tried putting the code in other routines all over, but still it doesn't work.

Here's the code from bot_qw.qc:

Code: Select all
void() BotFrame =
{
   local float num;
   local string h;
   
   h = infokey(world, "bot_options");
   b_options = stof(h);
   
   sv_maxspeed = cvar("sv_maxspeed");          // for the sake of speed
   sv_gravity = cvar("sv_gravity");
   sv_friction = cvar("sv_friction");
   sv_accelerate = cvar("sv_accelerate");
   sv_stopspeed = cvar("sv_stopspeed");
   real_frametime = time - lasttime;              // in QW frametime is fuxx0red
   lasttime = time;
   
   self = nextent(world);
   num = 0;
   while (num < max_clients)
   {
      if (self.ishuman == FALSE)
      {
         if (self.b_clientno > 0)
         {
            frik_obstacles();
            CL_KeyMove();
            SV_ClientThink();
            SV_Physics_Client();

            if (self.phys_obj)
            {
               if (self.phys_obj.modelindex != self.modelindex)
               {
                  setmodel(self.phys_obj, "progs/player1.mdl");
                  self.phys_obj.modelindex = self.modelindex;                                 
               }
               self.phys_obj.frame = self.frame;
               self.phys_obj.angles = self.angles;
               self.phys_obj.colormap = self.colormap;
               self.phys_obj.effects = self.effects;
            }
         }
      }
      self = nextent(self);
      num = num + 1;
   }
};


Any ideas?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Re: Skins?

Postby ceriux » Tue Feb 28, 2012 10:07 pm

maybe has to do with that ? -> // working, just not for bots

why not give each bot put in a variable self.bot == x; if self.bot == x self.skin == x; just set self.bot with random(); ? that way each bot get's a random skin? rather than using netname since it doesn't seem to work with bots?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Skins?

Postby redrum » Tue Feb 28, 2012 10:17 pm

I'll give it a go.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Re: Skins?

Postby redrum » Tue Feb 28, 2012 10:26 pm

nope, same thing :(
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Re: Skins?

Postby Spike » Tue Feb 28, 2012 10:31 pm

try using a different client (same server).
many qw clients don't do skins properly, especially player.mdl skins.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest