Forum

Best Method for Various Player Heads

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

Best Method for Various Player Heads

Postby Ghost_Fang » Thu Mar 01, 2012 12:56 am

So as the title says I want to have various heads/helmets for player models and maybe even NPCs. What would be the best way of doing this in Darkplaces? I am going to assume that Md3s are my best bet, unless there is a better way? If Md3 are the best way, could anyone point me in the direction of good, Darkplaces compatible, Md3 documentation? The few that I found seemed pretty Q3A and Sauerbraten specific, and I'm pretty sure Darkplaces doesn't support ALL of the Md3's features.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby leileilol » Thu Mar 01, 2012 1:10 am

Darkplaces does support all of MD3's features (.skin files, tags).

Read dpextensions.qc
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Thu Mar 01, 2012 4:36 am

i assumed that already: EDIT: Sorry misread that. leileilol
Ghost_Fang wrote:I'm pretty sure Darkplaces doesn't support ALL of the Md3's features.


In dpextensions.qc, all i see about md3s is:

Code: Select all
//DP_GFX_QUAKE3MODELTAGS
//idea: id Software
//darkplaces implementation: LordHavoc
//field definitions:
.entity tag_entity; // entity this is attached to (call setattachment to set this)
.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
//builtin definitions:
void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
//description:
//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
//note 3: attaching to world turns off attachment
//note 4: the entity that this is attached to must be visible for this to work
//note 5: if an entity is attached to the player entity it will not be drawn in first person.
Last edited by Ghost_Fang on Fri Mar 02, 2012 11:36 pm, edited 1 time in total.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby Seven » Thu Mar 01, 2012 9:33 am

Hello Ghost_Fang,

DP_GFX_QUAKE3MODELTAGS is exactly what I would do, too.
"setattachment" is your best friend i guess :)
I think SUPA wrote a small tutorial here in the inside3d forum how to exactly use "setattachment".
Pleased search for it if necessary.

Inside the monster spawn function you will have a small random function that selects the head.
Then use "setattachment" to glue them together.

Good luck.
Seven
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Fri Mar 02, 2012 5:19 am

Is there a good tutorial or documentation how to use these properly in darkplaces?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby Ace12GA » Fri Mar 02, 2012 2:13 pm

Check out supertorso: viewtopic.php?t=58
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Fri Mar 02, 2012 11:35 pm

Ace12GA wrote:Check out supertorso: viewtopic.php?t=58


Yea tried that. It might be easier to understand if it would actually work. I tried supertorso and nothing happened, i don't see any of the models or anything....
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby Ace12GA » Sat Mar 03, 2012 3:11 am

Ghost_Fang wrote:
Ace12GA wrote:Check out supertorso: viewtopic.php?t=58


Yea tried that. It might be easier to understand if it would actually work. I tried supertorso and nothing happened, i don't see any of the models or anything....


Look at your shadow in game, read the readme and switch to 3rd person. It works in Darkplaces, and the code makes extensive use of the Q3 MDL tag system to tie together the model from separate parts.
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: Best Method for Various Player Heads

Postby ceriux » Sun Mar 04, 2012 5:21 am

if your using mdl's you could try the visible equip thing using drawonlytoclient?
User avatar
ceriux
 
Posts: 2228
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Wed Mar 07, 2012 12:37 am

Ace12GA wrote:
Ghost_Fang wrote:
Ace12GA wrote:Check out supertorso: viewtopic.php?t=58


Yea tried that. It might be easier to understand if it would actually work. I tried supertorso and nothing happened, i don't see any of the models or anything....


Look at your shadow in game, read the readme and switch to 3rd person. It works in Darkplaces, and the code makes extensive use of the Q3 MDL tag system to tie together the model from separate parts.


Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...
ceriux wrote:if your using mdl's you could try the visible equip thing using drawonlytoclient?


That was my first intention, but i am attempting to use md3s to be a bit more clean about it. Its beginning to seem like im stuck with mdls...
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby qbism » Wed Mar 07, 2012 2:54 am

Ghost_Fang wrote:Is there a good tutorial or documentation how to use these properly in darkplaces?

http://www.quaketastic.com/upload/files ... -05-05.zip
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Best Method for Various Player Heads

Postby Ace12GA » Wed Mar 07, 2012 4:06 am

Ghost_Fang wrote:Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...


My point is that if you look at cl_main.qc, you will see where the player model is assembled from 4 separate md3 models into one model. It does work, the purpose of super torso was to demonstrate a system by which the players arms and torso bend to match the view pitch. Regardless, there is the working code that assembles the models into one working model. I would think that would be a great starting point to simply swapping the head on a player model using md3's with attachment tags.

Sorry if that is not helpful.
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Wed Mar 07, 2012 8:51 pm

Ace12GA wrote:
Ghost_Fang wrote:Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...


My point is that if you look at cl_main.qc, you will see where the player model is assembled from 4 separate md3 models into one model. It does work, the purpose of super torso was to demonstrate a system by which the players arms and torso bend to match the view pitch. Regardless, there is the working code that assembles the models into one working model. I would think that would be a great starting point to simply swapping the head on a player model using md3's with attachment tags.

Sorry if that is not helpful.



No thats great and all i can see how to code them via QC. But what good does it do if i cant even get the md3s to show up, just the shadows?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Best Method for Various Player Heads

Postby Ace12GA » Wed Mar 07, 2012 9:21 pm

Ghost_Fang wrote:No thats great and all i can see how to code them via QC. But what good does it do if i cant even get the md3s to show up, just the shadows?


It shows you how to spawn and connect md3 models from the qc. You want to have multple player heads, so, using the md3 tag attachment stuff, you have a headless player model, and then you have a half dozen head models. All are md3, and have suitable attachment tags placed.

From qc, you spawn the main part of the player model, then the head, and attach the head to the player model. Swapping the head is as simple as removing the current head, destroying the object, spawning a new head, and attaching it.

Well, maybe not simple, but the code in that project demonstrates how to do that clearly and cleanly. That was my point. The functioning of that project so far as visually seeing the model is immaterial. That you can see the assembled model's shadow working, shows that it is working. You are not going to directly see your player model or it's head in game either; other clients will.
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: Best Method for Various Player Heads

Postby Ghost_Fang » Fri Mar 09, 2012 5:23 am

I know, i will definitely use supertorso for a reference when the time comes, but my only issue is that there is NO MD3, its not there at all, chase_active 1? Nope.avi connect another client? nope.avi. I cannot see the player model at all in game. And i think the code was designed so you could see your arms, torso and legs in first person anyways. I'm almost thinking about just using a headless player.mdl and having the heads spawn with MOVETYPE_FOLLOW. :/
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Next

Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest