Inside3D!
     

Changing Player model
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Feb 03, 2010 10:00 am    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Wed Feb 03, 2010 4:39 pm    Post subject: Reply with quote

Both Slide and RQP change the player model.

Sources:

http://www.quake-1.com/quakec-gallery/qcslide.zip
http://www.quake-1.com/quakec-gallery/RQP_0.5.4.zip
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Wed Feb 03, 2010 5:34 pm    Post subject: Reply with quote

Ghost Fang just doesn't read anything unless you actually code it for him. It's pretty pointless really.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Wed Feb 03, 2010 6:29 pm    Post subject: Reply with quote

Lol! Laughing 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:

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:

   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:

   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...
Back to top
View user's profile Send private message
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Wed Feb 03, 2010 8:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 2:59 am    Post subject: Reply with quote

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".
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Feb 04, 2010 4:39 am    Post subject: Reply with quote

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 =)
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 5:36 am    Post subject: Reply with quote

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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Feb 04, 2010 6:31 am    Post subject: Reply with quote

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:
//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();
   }
  }
}
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 6:51 am    Post subject: Reply with quote

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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...


Last edited by Baker on Thu Feb 04, 2010 6:52 am; edited 1 time in total
Back to top
View user's profile Send private message
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Thu Feb 04, 2010 6:51 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Thu Feb 04, 2010 8:06 am    Post subject: Reply with quote

Changing self.walkframe doesn't do anything. It's just a counter used by player_run and player_stand.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Thu Feb 04, 2010 9:42 am    Post subject: Reply with quote

why not just use self.frame and make a self.endframe?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Feb 04, 2010 1:52 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Feb 04, 2010 4:12 pm    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2004 phpBB Group