Game Development Community

MountObject with ShapeBase does not work correctly

by Game Maker 2 · in Torque Game Engine · 11/25/2004 (2:51 am) · 9 replies

Hi!

I have mounted a ShapeBase object to my player but it seems it's not working. If i do echo($Player.getMountedObject(0)); i get a value which corresponds to the value i get if i would echo my object. I hope this means i have successfully mounted my object :)
I've tried to fly around the world in hope to find the shape (to see if it has some other position instead of the mount point) but i can't find it.
My conclusion is that it is not drawed. Am i correct? Is this a recognized problem with mounting a ShapeBase?

There seems to be a lack of information about mounting a ShapeBase. I've searched through both the forums and resources but can't find anything that help me.

I wonder if there is anyone that have successfully mounted a ShapeBase and got it to draw correctly?

#1
11/25/2004 (4:58 am)
Mounts do work and they are not invisible when you first mount them.

Quote:
I've tried to fly around the world in hope to find the shape (to see if it has some other position instead of the mount point) but i can't find it.

I expect you wouldn't, because it is being repositioned every time you move, so even if it was 100 units infront, it will always be 100 units infront.

What player model are you using? Do you have valid mount points built in?
#2
11/25/2004 (5:03 am)
Question 1) is thier a Mount0 in the dts file, that is where the object will mount, if not it will mount to the object' pivot point

Quote:
i get a value which corresponds to the value i get if i would echo my object.
That is the object ID, if you are getting an ID then you definatly have an object.

If for somereason it isn't mounting, you can find the object at mission area location 0, 0, 0 which is usually somewhere under the terrain.
#3
11/25/2004 (5:22 am)
For what I know, on the player you can only mount an image, not an object, I tried this time ago and it didn't work, probabily it's just a renderer problem. But it should work if you mount for example, an item over another item
#4
11/25/2004 (5:38 am)
Thank you for the replies!

@Simon & Anthony:
Yes, the model has a mount point called mount0 and i can't find the model at the worlds origin 0 0 0. How do you mean it will be "always infront"? Does that go for moving the camera also?

@Davide:
That is exactly what i'm trying to do, mounting a shape to the player object, but i can't see why it won't work :/
Did you find out why, or have anyone else found out?
#5
11/25/2004 (1:44 pm)
When object a is mounted to object b, it will have the translation of object b applied.

So, if object a's mount point 0 is lets say for some reason stright up 100 units from the center of object b. Then when you move object b, object a, will always be 100 units above object b.

So even if you went up a hill 50 units, object a will still be above object b by 100 units.

edit: No, this does not appy to camera movement, you need to locate where mount0 is on your model.

When you look at your model in what ever 3d modling program you used, where is mount0 ???

Also, did you define it in the player.cs file?
#6
11/25/2004 (2:05 pm)
Guys, the only problem here is that ShapeBase doesn't do rendering, so not even a ShapeBase on the world would render, try mounting a StaticShape instead, it's derived from ShapeBase and DOES render.

And a ShapeBase can mount both images and objects, depends what you want it for.
#7
11/25/2004 (11:09 pm)
@Simon:
Before i started experimenting with ShapeBase we had a ShapeBaseImageData mounted, and it was translated to the correct location.

@Xavier:
I thought it was something like this, however, the reason why we switched to ShapeBase was that ShapeBase do collision detection and have full controll playing animations, which is a requirement. Is static shape able to use the function playThread()? ( if so, then why is it called StaticShape? =) )
#8
01/06/2005 (10:45 am)
I'm having the same problem. I can only mount a ShapeBaseImageDatablock to my vehicle. I've tried mounting ShapeBaseDatablocks as well as StaticShapes and neither seem to work. Is there any solution or documentation to solve this problem?
#9
01/06/2005 (12:00 pm)
I am mounting objects based on shapebase to each other, in my project, but there are some issues. It seems like the mountImage stuff is more heavily used, so it is better debugged. I had to make some code changes to the engine to make it so that a mounted shapebase object would move with the object it was mounted to.