Best Method for Various Player Heads
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Best Method for Various Player Heads
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.
Re: Best Method for Various Player Heads
Darkplaces does support all of MD3's features (.skin files, tags).
Read dpextensions.qc
Read dpextensions.qc
i should not be here
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
i assumed that already: EDIT: Sorry misread that. leileilol
In dpextensions.qc, all i see about md3s is:Ghost_Fang wrote:I'm pretty sure Darkplaces doesn't support ALL of the Md3's features.
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.
Re: Best Method for Various Player Heads
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
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
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
Is there a good tutorial or documentation how to use these properly in darkplaces?
Re: Best Method for Various Player Heads
Check out supertorso: http://forums.inside3d.com/viewtopic.php?t=58
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
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....Ace12GA wrote:Check out supertorso: http://forums.inside3d.com/viewtopic.php?t=58
Re: Best Method for Various Player Heads
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.Ghost_Fang wrote: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....Ace12GA wrote:Check out supertorso: http://forums.inside3d.com/viewtopic.php?t=58
Re: Best Method for Various Player Heads
if your using mdl's you could try the visible equip thing using drawonlytoclient?
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...Ace12GA wrote: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.Ghost_Fang wrote: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....Ace12GA wrote:Check out supertorso: http://forums.inside3d.com/viewtopic.php?t=58
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...ceriux wrote:if your using mdl's you could try the visible equip thing using drawonlytoclient?
Re: Best Method for Various Player Heads
http://www.quaketastic.com/upload/files ... -05-05.zipGhost_Fang wrote:Is there a good tutorial or documentation how to use these properly in darkplaces?
Re: Best Method for Various Player Heads
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.Ghost_Fang wrote:Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...
Sorry if that is not helpful.
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
Ace12GA wrote: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.Ghost_Fang wrote:Well i see it... but whats the point if the model doesnt work? I cant get them to work at all...
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?
Re: Best Method for Various Player Heads
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.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?
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.
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: Best Method for Various Player Heads
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. :/