Game Development Community

How to implement mount?

by Ironbelly Studios · in Torque Game Engine · 08/04/2006 (5:54 am) · 5 replies

Hello everyone
hey i have a small problem
i had made a new terrain in which i put in player and Rifle and tommygun
now the player simply passes through them and does not pick them up?
i want it to work like whrn the player goes to it and touches it i.e., collides with it , the gun simply moves off the place where it was in the terrain and mount on the player i.e., the player holds the gun henceforth
can anyone help me in this regard?
help much appreciated
thanking you

#1
08/04/2006 (10:21 am)
Use item class for objects and put a function that causes something to happen when it picks up the item. Search for item class and how to use it.
#2
08/05/2006 (1:57 pm)
Are you sure you didn't add them as static shape? Cause then it's just the model lying there doing nothing.
#3
08/07/2006 (5:47 am)
Hi
thanks to everyone

hey robin
can u please tell me detail from starting what all should i do to put an item properly and then get it detected by the player when collided with it and then it scould be mounted onto the player colliding with it
help much appreciated
thanking you


hey frank
can u please tell me about the item class in much more detail and how to handle it and modify it please
thanking you
#4
08/07/2006 (1:13 pm)
I have to go back a little, since i have my own type of weapons.. that handle damage of their own and don't need pickup.
When you create an itemdata, it should appear in the map editor.
Examples of those blocks are
datablock ItemData(Crossbow)
and even
datablock ItemData(CrossbowAmmo)
where you define how the weapon will act, what model it has etc.
There's a difference between Shapes and Static Shapes. Static shapes are just the DTS models loaded into your map, mostly to add detail like trees, rocks and alike.

If you have defined an itemdata, your item should appear in the Shapes list. There's a simple way to test it, because when you add an itemdata shape, it should start rotating (just zoom in on it, and you can see it rotating), meaning you can pick it up. If you done this, and the thing is rotating but you still can't pick it up, check your console for errors when you walk over it. If it gives any errors, try fixing them or posting them here.
#5
08/08/2006 (3:38 am)
Hi
thanks everyone

hi robin
i had put up a rifle which was in the shapes (as it was rotating )
now the problem is that in my player.cs file the oncollision function is defined and is working fine as i have checked this using the echo command but when it the player goes to the rifle it does not move from the place and mount itself on the player hands
th eplayer just passes through it although the console shows the collision function is getting executed when it goes to it
now can u guide me how to make this thing possible that when th eplayer goes to the rifle it gets moved form the place and get mounted on the player
please tell me if u require any [particular data from my script to help me out
thanking you