Game Development Community

Wepon mount in two hand

by CIMO · in General Discussion · 04/02/2006 (2:00 pm) · 8 replies

Any idea for use a weapon for my player with two hand?
I create a m4a1 and insert a mountpoint node....
On my player i have create a mountpoint0 on right hand and mountpoint1 on left hand...
But my weapon stay only on right hand...
Help my please for take a my weapon at the same time with two hand...
THANKS =D

#1
04/02/2006 (2:06 pm)
Check out my resource

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8821

if you have any questions post there and Ill get to them ASAP.
#2
04/02/2006 (2:13 pm)
Ok....But i would use a single weapon in two hand and not two weapon on two hand =P
#3
04/02/2006 (3:52 pm)
Try this one
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9846
#4
04/02/2006 (4:28 pm)
Cimo,

I'm just browsing threads so please forgive me if I missed the intent of your question, but it sounds like you want to mount two weapons right? One in the left hand and one in the right hand? To do this, you must make two ShapeBaseImageData (image) instances. i.e. One to be mounted on the left and one on the right. It also sounds like you want the same weapon to be used in both hands. i.e., You want the same model and behaviors.

The easiest way to do this is to get one image working, then inherit all of its properties while making the changes you need. For example:

datablock ShapeBaseImageData( RightHandGun ) 
{
    className     = "myGun"; 
    shapeFile     = "~/.../myGun.dts";

    mountPoint    =  0;

    // ... Whatever else you need, like statemachines, etc.
};

datablock ShapeBaseImageData( LeftHandGun : RightHandGun  ) 
{
    mountPoint    =  1;
};

As you can see in the above code, I implemented one image and then inherited all of its properties in a second image. Then, I modified the mountPoint to mount on mount1. Now, I can mount wto guns that will behave the same way and even use the same scripts*.

* Notice the use of the className field. I can now write scripts scoped to 'myGun' and both images will use them. i.e.:

function myGun::onFire(...) {}
function myGun::onMount(...) {}
... etc ...


Well, I hope this helps.

www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
#5
04/02/2006 (4:39 pm)
Cimo,

Ah... I just noticed you did say you want ONE weapon mounted to two hands... Sorry that I missed that.

Although it is probably technically feasible to do this, stock TGE does not allow you to mount the same image or an object to two mount points at the same time. Nor, can you make circular mounts.

All of these cases are illegal:

1. Object A mounted to object B at mount points 0 and 1 simultaneously.

2. Object A mounted to object B and mounted to object C.

3. Object A mounted to object B while object B mounted to object A.

However, this is legal:

1. Object A mounted to object B while object B mounted to object C...


Again, sorry I missed your point the first time. Please don't consider this question ended however. Please write back and let us know why you want to mount in this fashion. Tell us what effect you are hoping to acheive. The community might have an answer yet.

www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
#6
04/02/2006 (4:47 pm)
Oh I missed that also sorry. I would also be interested in what effect you are hoping to achieve.
#7
04/02/2006 (5:50 pm)
If it wasnt critical for the second hand to stay ont he object, this could very simply be acheived through an animation.
However, if you wanted to do an animation like he switches hands, or holds the gun in the other hand while getting a clip, etc, it gets much more complicated and harder to do.
The previous statements about mounting limitations are correct in that you may only mount one to another in a chain, so this cant really be done in stock Torque.
It may be possible to code otherwise, or you could potentially have animations do it, but neither way would be easy to pull off.
Hope this helps in any way :)
#8
04/03/2006 (4:44 am)
Ok...and i create a animation of change a clip.....Any help me to take this effect? I use a resource to implement a reload a gun...But i see a message and i see a animation....help please thanks...