Forum

Changing Player model

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Changing Player model

Postby Ghost_Fang » Mon Feb 01, 2010 5:23 am

I have the chasecam added from the tutorial in the tutorial section, how would i make it so when it goes into chasecam, it also changed the player model, and back to the origonal when not in chasecam?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Baker » Mon Feb 01, 2010 12:34 pm

setmodel (self, "progs/eyes.mdl");

setmodel (self, "progs/player.mdl");

setmodel (self, "progs/whatever.mdl");
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 » Mon Feb 01, 2010 12:56 pm

i did that, well on the impulse, should i do it in the chasecam function?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby c0burn » Mon Feb 01, 2010 1:06 pm

Don't use setmodel. Use modelindex, otherwise hulls will break and the player will clip through walls and stuff.

Check client.qc for how it's done with the ring powerup.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby Spike » Mon Feb 01, 2010 2:11 pm

if you use setmodel you should follow it up with setsize too, otherwise your player will fall into the floor and changing it back will make them stick (The mins size is used to offset the hull).
Changing the modelindex directly means that any checks against the player's model name still work.
Either way, the ring code will overwrite your new modelindex every single frame.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Ghost_Fang » Tue Feb 02, 2010 3:09 am

nothing happens, i did baker's way, i put that on impulse 15, and then when i messed with player index i got some really weird results....
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby ceriux » Tue Feb 02, 2010 4:52 am

look at the invis code the way they do it is what you need to do. modelindex is the only proper way i know of to set a model.
maybe try seeing if your new models are precahed?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Ghost_Fang » Tue Feb 02, 2010 5:15 am

My model was precached. What should i do since weapons.qc comes before client.qc? and that is one huge function, i only need a little bit form it, what would i do then?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby ceriux » Tue Feb 02, 2010 5:54 am

first tell me what your trying to change specifically and how? are you just trying to make a menu to choose different models from using impulses? ill take a look at the code and see what i come up with.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby c0burn » Tue Feb 02, 2010 8:46 am

Ghost_Fang wrote:nothing happens, i did baker's way, i put that on impulse 15, and then when i messed with player index i got some really weird results....


Look at PutClientInServer for how it's done. Also, delete the CheckPowersups() line in client.qc.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby LonePossum. » Tue Feb 02, 2010 10:04 am

I believe from my understanding he was to Press and Impulse which switches the player model to a different model and goes into chasecam at the same time and then he wants to press the button again for it to switch back into firstperson and switch the player model back to the origianal model it switched from.

Another thing is that it must also reduce how tall the player is called. and then switch back to regular height.

This is not neccesary to do at this stage he is just wanting to get the switching into chasecam with the model change and switching back sorted out.

Hope that clears it up, I thought he said it rather straight forward.

Peace.
LonePossum.
 
Posts: 38
Joined: Mon Nov 02, 2009 11:07 am

Postby c0burn » Tue Feb 02, 2010 12:11 pm

Changing size won't work if you're thinking of crouching in Q1BSP anyway.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby Teiman » Tue Feb 02, 2010 2:30 pm

If you ever change the player size, first use something to detect if that new box are valid points (not inside a solid), or you character will get stuck. DP as a special builtin to check solids inside "box's" (tracebox?)
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby Ghost_Fang » Wed Feb 03, 2010 4:33 am

OK.... this is wat i want:

if (self.impulse == 15)
{
ccam();
and whatever i gotta do to change the player model here
}

ccam(); is done and working, i followed the tut from the tut section.

I did look at the invisible function in the powerups, and i didnt learn squat, i tried "setmodel (self, "progs/mball.mdl") and nothing happened

I do also want the hitbox size to change also, because its gona be a morphball just like in metroid prime (cause thats wat it is lol) so you can fit into smaller places.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby ceriux » Wed Feb 03, 2010 9:04 am

hmm, honestly im not sure if thats 100% possible (the hitbox thing idk. if im wrong someone correct me.). ill check into all of that. i got some coding for someone to do tomorrow. ill see about squeezing in time to see if i can replicate your code and get it all working, if i do ill post up how and explain everything.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest