Forum

Changing Player model

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Postby Spike » Wed Feb 03, 2010 10:00 am

using setmodel will not appear to do anything. the player's modelindex is overwritten every frame in postthink so you'll not see the change. you will NEED to modify the invisibility powerup code somehow.

setmodel will also change the mins/maxs of your player, resizing it. the actual size used depends upon the engine, so be warned.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Wed Feb 03, 2010 4:39 pm

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby c0burn » Wed Feb 03, 2010 5:34 pm

Ghost Fang just doesn't read anything unless you actually code it for him. It's pretty pointless really.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby r00k » Wed Feb 03, 2010 6:29 pm

Lol! :lol: Yet remember this forum can also be used as a reference to the rest of the world...

First in world.qc, you need to precache your custom model(s),
find
Code: Select all
void () worldspawn =
{

go near the bottom of that function (above the lightstyle animation definitions), and add more precache calls to your custom models. (this should be obvious), but incase, here's an example:

Code: Select all
   precache_model ("progs/mymodel.mdl");

// add more here --->>>

   


//not beyond this point!!!!!!!!!!! ;)
   //
   // Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
   //

   // 0 normal
   lightstyle(0, "m");
...

then in client.qc

in PutClientInServer,
Code: Select all
   if (modelindex_eyes == 0) // hasn't been done yet
   {
      setmodel (self, "progs/eyes.mdl");
      modelindex_eyes = self.modelindex;

      setmodel (self, "progs/h_player.mdl");
      modelindex_head = self.modelindex;

         //add more modelindexes here, must be precached!
        // setmodel (self,"progs/mymodel.mdl");
       // modelindex_mymodel = "self.modelindex;
       // etc...
   }

   setmodel(self, "progs/player.mdl");//sets the DEFAULT model
   modelindex_player = self.modelindex;
   
   setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);

   self.view_ofs = '0 0 22';
   


then whenever you want just set your model index to self.modelindex = modelindex_whatever...
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Ghost_Fang » Wed Feb 03, 2010 8:07 pm

c0burn wrote:Ghost Fang just doesn't read anything unless you actually code it for him. It's pretty pointless really.


Don't be a fucking dick, i completely understand what they have explained so far, i just got weird results. I read all replies thoroughly dumbass. I ask for code because i don't know much syntax, and if you supply the code and tell me why it does that because of that etc. i can easily pick it up. I dont know enough syntax for people to use terms. Thanks for the pipebomb code, i appreciate it, but if your not gona help me dont bother posting. I hate how 90% of all coders are stuck up douchebags.
Thank you all who are being patient with me as i struggle to learn this. As you have noticed, the gaps between my questions are expanding, which means im learning lol.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Baker » Thu Feb 04, 2010 2:59 am

You are just starting this. It is overwhelming. Don't worry about it. Quake is very simple, yet deep and complex.

I give your project and projects like it credit for wanting to do some very non-traditional things. Quake could very much benefit from a "how-to" wiki. But it doesn't have one. And so we turn to forums ...

c0burn wrote:Ghost Fang just doesn't read anything unless you actually code it for him. It's pretty pointless really.


Ah, I think he is still trying to get a handle on things.

One day, you wake up and realize "Hey, QuakeC actually makes some sense".
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Ghost_Fang » Thu Feb 04, 2010 4:39 am

Baker wrote:One day, you wake up and realize "Hey, QuakeC actually makes some sense".


A lot of it does make sense. In fact, i didnt even use r00k's code, i looked at it and saw wat i needed to do i actually did it my own way and within the impulse command, his way wouldnt have worked for me anyways, i got an error because i needed to be activated in weapons.qc, but client come AFTER weapons so i did it my own way, thanks though r00k =)
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Baker » Thu Feb 04, 2010 5:36 am

Note to anyone reading this thread:

In any kind of future worth having -- a future that some of us probably don't merely wish for, but in fact demand -- there will be more Ghost Fangs in the future reading this thread looking to learn and understand why things you'd think would work don't work the way you'd think.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Ghost_Fang » Thu Feb 04, 2010 6:31 am

Lol so Ghost Fang = "Super-Noob"? lol

well i got the player model to change, but i have tried probably about 50 different ways to make it animate when you are moving forward. the model has animation frames, i just cant get it them to work.

This is wat i have:

Code: Select all
//Morphball Frames --Ghost

void() player_mball1 =      [$mball1, player_mball2]      {self.walkframe=1;};
void() player_mball2 =      [$mball2, player_mball3]      {self.walkframe=2;};
void() player_mball3 =      [$mball3, player_mball4]      {self.walkframe=3;};
void() player_mball4 =      [$mball4, player_mball5]      {self.walkframe=4;};
void() player_mball5 =      [$mball5, player_mball1]      {self.walkframe=5;};

void() player_mball0 =
{
if (self.mballtoggle == 1)
  {
   if (self.velocity_x || self.velocity_y)
   {
   player_mball1();
   }
  }
}
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Baker » Thu Feb 04, 2010 6:51 am

Potentially useless information:

The RQP mod allows you to change from a player to a Shambler or an Ogre with "Monster Transfomers" (the start map teleporters, specifically). The reason looking through the code might help is that the player and an ogre/shambler has different animation frames than the player.

http://www.quake-1.com/quakec-gallery/RQP_0.5.4.zip

Seeing how that mod handles it might help ... the ring and the Slide mod player model on the hoverboard are not animated so those are not as useful examples as far as I know.

/Is this post helpful, I don't know. I duck out an let the *real* QuakeC experts continue this thread.
Last edited by Baker on Thu Feb 04, 2010 6:52 am, edited 1 time in total.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Junrall » Thu Feb 04, 2010 6:51 am

Hey there Ghost_Fang,

I'm a bit of a noob too...
I may be wrong, but it looks like that any time you move, your code goes right in to player_mball1(); Initially this seems ok... but since you are in motion it never makes through the rest of your animation because it is continually jumping to player_mball1(); Basically your animation is instantly "resetting" to the first frame before it has a chance to get to the next frame.
Though, as I said, I could be wrong as at the moment animating model frames is a bit sketchy for me.
Good God! You shot my leg off!
User avatar
Junrall
 
Posts: 191
Joined: Mon Sep 21, 2009 12:27 am
Location: North West Oregon, USA

Postby c0burn » Thu Feb 04, 2010 8:06 am

Changing self.walkframe doesn't do anything. It's just a counter used by player_run and player_stand.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby ceriux » Thu Feb 04, 2010 9:42 am

why not just use self.frame and make a self.endframe?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Ghost_Fang » Thu Feb 04, 2010 1:52 pm

well i also tried those a self.frames. and @junrall, i see your point, player_mball5 was suppose to start the loop over at player_mball0, so that was my bad, but it didnt work anyways. Ill take a look at what you posted Baker.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Spike » Thu Feb 04, 2010 4:12 pm

if your frame constants are defined in the same file as ones from a different model, try using numbers instead of names for the frame index to use.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

PreviousNext

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest