Game Development Community

Help understanding weapons and shapebaseimages

by Bruno Grieco · in Torque Game Engine · 06/23/2004 (8:08 pm) · 12 replies

Guys,

Resuming part of this thread, I discovered the following :

Weapons may be items ( or StaticShapes ) and have a collision mesh. This mesh is used when a player collides with them and pick them up.

After picking them up. What is REALLY mounted on the player is an IMAGE of the weapon. not the weapon ( object ) itself.

This image is enough for animations and shooting stuff thru it's muzzle. But it's useless for collisions because there is nothing ( no real, instantiated, object ) to collide with.

I tried instantiating and mounting an object but it didn't work. the object wouldn't mount properly and wouldn't play the animation.

Any help on how to apply collision meshes to images ?

TIA

#1
06/25/2004 (1:33 pm)
Items do not have a collision mesh, rather they use the "bounds" box as its collision. Why would you need to have a collidable image? If the image is mounted to you then the player wouldnt be able to move unless you disabled collision on the player but then your back where you started.?.?
#2
06/25/2004 (1:38 pm)
I'm not sure this is what you mean Bruno, but that the ShapeImage is a 2D object is not true. How would lighting work with that? I have a hard time believing this.

Maybe that's not what you meant thought.
#3
06/25/2004 (2:23 pm)
You can get images to collide.
#4
06/25/2004 (6:17 pm)
@Sam,
The whole idea of having another collision mesh applied is enhancing your player collision mesh. Think about melee combats.

@Stefan
No, not even close.

@Westy
Please tell me how.

Actually I was able to work around the problem. I created a new mount node ( mount1) in where I mount an invisible object that serves as a collision mesh and I also mount the image in mount0.
#5
06/25/2004 (6:26 pm)
Calls for Ben G :p ??

I dont know hoe exactly, but they had it pushing the mounted image back to keep them out of walls, but unfortunatly this is no longer in HEAD..

Anybody will old version of torque plz help out here?
#6
06/26/2004 (9:42 am)
The weapons being pushed into walls was a raycast call. If distance < so many fraction meters then push the weapon back.
#7
06/27/2004 (9:37 pm)
Yeah but the problem with the weapon retraction is that in third person the weapon often pokes throught the player. I noticed this in the tribes 2 demo. you wallk close to a wall with certain guns and you will see the handle pop out of the players back!

@Bruno

Call me crazy but I think you could mount your collision object and your Image on the same node. Object mounting and image mounting work completely independent of each other as far as I can tell.
#8
06/27/2004 (9:49 pm)
Images do collide with static objects like buildings and such, or even other players. As pointed out they will back up instead of stop the player when they collide. It would be nice to have a slightly more realistic representation but it's really not neccesary in most situations.


And yes, you should be able to mount as many objects as you like to a mount node although it might look funny if you can see them all, lol.
#9
06/27/2004 (10:37 pm)
@Bruno Grieco
if you want your weapon collide with objects you should have a joint named MuzzlePoint in a right place.
#10
06/27/2004 (11:00 pm)
Good idea, would it be possible to just extend the collision mesh of the arm that holds the weapon to a point where the weapon ends?
#11
06/28/2004 (7:02 am)
@Michael-Paul J.
The problem when mounting an object and an image in the same node is that the images mounts correctly, since they have a mount node that matches the vehicle mount node. But the same doesn't happen to objects. They mount using their bounding box center.

@Mike GM.
Yes, I had a Muzzle Point but it did nothing at all.

But mounting a new invisible collision mesh did the job quite well.
#12
06/28/2004 (11:58 am)
Hey, i forgot to say i used MS3D not Maya, i exported my weapon with no collision mesh(i selected "none" and exported), and no collision happened but when i added a muzzlepoint joint on the end of muzzle got collosion and my weapon didn't go throuth interiors then.