Game Development Community

Muzzlepoint, ejectpoint, mountpoint?

by John Burke · in Artist Corner · 08/02/2002 (12:05 pm) · 15 replies

Hi, i'm hoping someone can help me here. i have a weapon model created in 3D Max ready for export into our torque engine game. I created a dummy object called 'shape' and then a 'detail 64' object, making 'shape' detail64s parent. I then created a 'weapon' dummy object and made shape its parent also. I then named my model gun64 and made 'weapon' its parent. Next, I created a mountpoint dummy object, orientated the pivot point and placed it in the handle of the weapon. i also did the same for a muzzlepoint and ejectpoint. ( I also used the name MountPoint, muzzlePoint and ejectPoint to see if it made a difference )

Now, when I export the weapon into the game, the mountpoint, muzzlepoint and ejectpoint are not being recognized, with these actions occuring where they occured on the weapon that I replaced with mine. Can anybody help me out? :)......

#1
08/02/2002 (12:17 pm)
Two things to check. First, check the dump file of the shape. Make sure that the nodes got exported. You may need to create a .cfg to force export those nodes.

Second, check the script file for the weapon shape. There are offset values in the to offset the effects from the node transform.
#2
08/02/2002 (1:20 pm)
thanks joe, i'll check this out.....
#3
08/02/2002 (10:48 pm)
Joe, i hope you don't mind me posting this here, not too much of a liberty I hope. Heres the dump file, problem is I don't really understand whats being said. From what I read I assume the nodes are being exported? If you don't mind reading this could you perhaps point out any problems to me? Many,many thanks :)

Max file C:\3dsmax4\Scenes\Tommy gun - foregrip (test)2.max exported to c:\windows\desktop\publish\publish\fps\data\shapes\rifle\weapon.dts
Exported on Sat Aug 03 06:56:26 2002


Config file not found.
First pass: collect useful nodes...

Processing Node shape with parent Scene Root
Found subtree starting at Node "shape"
Processing Node detail64 with parent shape
Processing Node weapon with parent shape
Processing Node gun64 with parent weapon
Processing Node ejectPoint with parent weapon
Processing Node mountPoint with parent weapon
Processing Node muzzlePoint with parent weapon
Processing Node bounds with parent Scene Root
Bounding box found
Processing Node base01 with parent Scene Root
Found subtree starting at Node "base01"
Processing Node start01 with parent base01

Second pass: put shape structure together...

Adding detail named "detail64" of size 64 to subtree "shape".
Adding node "shape" with parent "shape" to subtree rooted on max-node "shape".
Adding node "weapon" with parent "shape" to subtree rooted on max-node "shape".
Adding node "gun64" with parent "weapon" to subtree rooted on max-node "shape".
Attaching object to node.
Adding object named "gun".
Adding mesh of size 64 to object "gun".
Object offset transform:
scale: x=0.00297, y=0.00297, z=0.00297
stretch rotation: x=0.00000, y=0.00000, z=0.00000, w=1.00000
translation: x=0.00000, y=0.00000, z=0.00000
actual rotation: x=0.00000, y=-0.00000, z=0.00000, w=1.00000
Adding node "ejectPoint" with parent "weapon" to subtree rooted on max-node "shape".
Adding node "mountPoint" with parent "weapon" to subtree rooted on max-node "shape".
Adding node "muzzlePoint" with parent "weapon" to subtree rooted on max-node "shape".
Adding detail named "start01" of size 1 to subtree "base01".

Third pass: Collapsing unneeded nodes...

Removing node "shape"
Removing node "weapon"
Removing node "ejectPoint"
Removing node "mountPoint"
Removing node "muzzlePoint"

Add default object states...

Adding object state to 1 detail level(s) of mesh "gun".
Adding frame.
Object is visible.
652 faces, 1956 verts, 1956 tverts before cropping textures and joining verts
---------------------------------

Add default node states...

Adding node rotation at time 0 for node "gun64".
rotation: x=-0.49998, y=0.49998, z=0.49998, w=0.49998
---------------------------------
Adding node translation at time 0 for node "gun64".
translation: x=-0.00000, y=-0.39081, z=0.20609
---------------------------------

Adding 0 sequences...


Optimizing meshes...

Optimizing mesh "gun" detail level 64.
1956 verts before joining verts
712 verts after joining verts
652 faces before stripping
Using quick and dirty stripping method.
157 strips with average length 6.82 (range 3 to 61) and 105 reversals
Results in 804 cache misses

Shape Hierarchy:

Details:
detail64, Subtree 0, objectDetail 0, size 64

Subtrees:
Subtree 0
gun64 --> Object gun with following details: 64

Sequences:

Material list:
material #0: "scorched_lt".

Checking for duplicate nodes...

Checking for duplicate objects...
#4
08/03/2002 (1:29 am)
Well, you should understand this line at least.. :P
Config file not found.
;-)
The config file has to be in the same folder as your MAX file to export properly...
#5
08/03/2002 (4:40 am)
lol, stefan thank you, but where is this file? Do I have to create it? If so how? Wonder at my ignorance, as long as I get this done! ;)
#6
08/03/2002 (5:11 am)
Yeah, sorry, you have to create it ... simply name it .cfg and put it into your folder...
although I'm having problems with getting a weapon in, too atm...
I have the cfg file, the shape gets exported, but no matter how I set the mountPoint, the rifle is always mounted wrong... and it doesn't change position no matter how far I change the point in MAX... so it seems to not find the mountPoint at all and uses some default value... but maybe it's a hierarchy problem in MAX?
Anyhow, here is the schematic view, here is the cfg file I'm using and here is the dump file that is created... maybe Joe can help us here? :))
#7
08/03/2002 (5:16 am)
thanks Stefan :) cfg file in the same folder as my exported model, right? do I need to put the actual max model in the exported folder too? Yeah, thats basically my problem, the model exports ok, but the nodes aren't being recognised......
#8
08/03/2002 (5:18 am)
Put the config file where your MAX file is, then it should work... although it doesn't *really* work for me atm... let me know if it works for you, maybe you could post the schematic view of your model here?
#9
08/03/2002 (5:24 am)
Sorry Stefan, i can't get to the PC with the model on it until Sunday...though if the problem isn't solved by then I'll definately post it for you. Thanks for your help :)
#10
08/03/2002 (6:57 am)
Has your working with max, you could also try moving the "pivot point" only. (Affect pivot point only in hiarachy of max panel) on Your "Bounds Box".
I have had some success with this when mounting players in vehicles, i think that if you experiment with this you could get your weapon mounted in the correct position.
TARON
Also i just took a look at your schematic, and your mountpoint, muzzlepoint and egectpoint, doint appear to be linked, they should be linked to Start, (Start as parent).
Without it being linked it will be ignored, and a default value would be used i suspect.
Looking more closly at your post, sorry i only just skimmed through it at first, hence the edits. In the dump file you pasted here, what i said above is probably your problem, according to the dump file you have linked your varoius points to weapon, unlink them and link them to Start , and then export the model again.

If you continue having problems, i could probably create a default max file with all the correct linkings for a weapon, and from that you can study it to see were your going wrong.
alternativly post a link to your max file and i will take a look at it for you.
#11
08/03/2002 (7:39 am)
Taron, thanks a lot for your help!
I've linked the points to "Start" now as you said, and now the mountPoint, muzzlePoint etc. seem to work in 1st person view (I see the muzzle now, etc.), but in 3rd person, the gun is like 2m away from my player:
www.beffy.de/upload/pics/screenshot_00001.jpg!
So I've uploaded the current MAX file to __x__, if you want to check it out... the current schematic view looks like this:www.beffy.de/upload/pics/schematic2.gif, the dump is here: :www.beffy.de/upload/pics/dump2.dmp...

would be really awesome if you could get this baby to export correctly...:)!! Btw, is there some tutorial that *really* shows which nodes are needed for different object, e.g. weapons and how they should be linked and set up? I couldn't find something really helpful in the official DTS Exporter document....

Thanks again for your help!! :)
#12
08/03/2002 (9:31 am)
Looking at the screenshot, the positioning problem is just probably aligning your model in max in respect to the game world, try opening up the max file and centering the whole scene 0.0.0 also the X axis should be horizontal to the gun barrel and the Z axis is your vertical, so use move and rotate functions to adjust this, remember to unhide any thing beforehand, especially bounds, you may have also to recentre the bounds pivot point to the centre of the bounds box.
I couldnt open the max file you uploaded or i would have had a look at it for you, its either been corrupted during the upload process or your using a different version of max, i use max 3 not max 4.
I am considering writing a Tutorial about nodes, as a resource, as i dont think they are explained or documented too well, its just time restraints at the moment.
#13
08/03/2002 (9:40 am)
I downloaded the file and played with it a bit. You are doing everything right with the .cfg.

The mointpoint, etc.. need to be in the shape tree. Just link them to 'start'

The transforms in the glock shape are totally mucked up.

You can check this out by selecting the "Shape" Dummy in your max scene and reset the x-form (reset x-form utility). Notice how it moves to the position that you see it in the game?

The exporter ignores all the screwed up transform info. It assumes that you did not screw up the transform during set-up.

Recreate all your dummies and make sure that they are alligned to the world (create them from the top, user or perspective view)

DO NOTscale or rotate them. Repostion them and re-export.

I did this and everything worked just fine.
#14
08/03/2002 (9:55 am)
Taron & Joe, thanks a lot!!
Taron, yes, it is MAX4, sorry for that... a tutorial would be very cool, btw.! ;)
Joe, I'll try what you suggested and recreate all the dummies...
John, so it should work for you, too, if you use the cfg file...
Again, thanks to everyone and I'm sure now I'll get this thing to work correctly... :)
#15
08/04/2002 (11:27 am)
Looking forward to trying this out..thanks guys :)