Forum

weapon attachments

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

weapon attachments

Postby Boss429 » Wed Oct 14, 2009 4:49 am

I finally figured out how to get DPM models working in darkplaces but setattachments isn't working right.

Here's the code:
Code: Select all
void(entity person) checkvisibleweapon =
{

      setmodel(person.md3weapon, "models/weapons/shotgun.md3");

};

void(entity person) setweaponmodel =
{
   //don't add new weapon while respawning in multiplayer
   if (person.md3weaponspawned == FALSE)
   {
      person.md3weapon = spawn();
      person.md3weaponspawned = TRUE;
   }
   setattachment(person.md3weapon, person, "bone20");

   person.md3weapon.exteriormodeltoclient = person;
   checkvisibleweapon(person);
};

(yes, I stole it from q1md3)

Now instead of attaching the shotgun to bone20 which is the right hand bone, it just hangs out in between the character's legs.
Boss429
 
Posts: 39
Joined: Sun Dec 03, 2006 7:29 pm

Postby Spike » Wed Oct 14, 2009 9:22 am

if its between the legs, chances are its using bone #0 instead of bone "bone20". Check that your bone name is correct, and the correct case, and has no whitespace. Etc.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Boss429 » Wed Oct 14, 2009 6:12 pm

yeah i've tried using different bones and it always appears at bone0
Boss429
 
Posts: 39
Joined: Sun Dec 03, 2006 7:29 pm

Postby Spike » Wed Oct 14, 2009 7:30 pm

try setting person.md3weapon.tag_index directly instead.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest