Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Change weapon of DarkMatter 2 Model

Author
Message
Methusen
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location:
Posted: 30th Jul 2006 04:08 Edited at: 2nd Aug 2006 05:07
I took me a lot figure it out, and did not found any information on the forums, so I made a sample application that teach you how to change the weapon from a model taken from the Darkmatter 2 library, to another weapon taken from the same library.

The weapon is a limb, so If you know the limb number or the limb name, then the rest is easy.

The example is for the Agent.x model, so when you open this model in an mesh viewer (I use the one that comes with DirectX SDK) you can find out the name. For the Agent.x was "muzi", for other models It could be "weapon" or "sword"
(see attached file for a screen capture)

Once you got the name, write a routine to find the limb number, then use this number to glue and unglue the weapons.

The code explains it all.



I hope this helps someone.

Methusen

Playing is the very reason for life, Making games convert you in a God.

Attachments

Login to view attachments
Wolf Dreamer
19
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 30th Jul 2006 05:31
Cool.

I only have the first Dark Matter pack, but there are a lot of models out there this would be useful for.

I would've thought you'd have to make the limb you didn't want invisible, and then attach the item you did want to the same hand that held it.

But you can actual unglue a limb, delete it, and then glue on another one.

I would imagine many model editors out there exist that would allow you to remove the limb, and save the file without it, then save the limb as a seperate .x file. That'd probably save time.

the last sane human being in a world gone mad
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 31st Jul 2006 05:43
Thats sweet, and really intellegent. But one problem- wouldn't he be shooting a sword?

Applyby has Flies in his Eyes.
Methusen
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location:
Posted: 2nd Aug 2006 05:15 Edited at: 2nd Aug 2006 05:32
Jajaja, yeah, he would be shooting a sword if you like, actually any object that you glue to the original limb will do the trick.
For the Agent.x model I found that these were the best choices

"Micro UZI": The original weapon
"Ray Gun": Fits almost perfect
"Phaser": This one fits almost perfect too
"Auto Pistol": A little too big, looks like a borrowed gun
"Sub Tech": A two handed weapon, fits so so.



Playing is the very reason for life, Making games convert you in a God.

Login to post a reply

Server time is: 2024-11-23 03:49:22
Your offset time is: 2024-11-23 03:49:22