Mounted objects and the players that love them
by Cinder Games · in Torque Game Engine · 06/30/2005 (4:03 pm) · 15 replies
Ok. let me first say i've scoured around the forums and haven't exactly found what i need....
I want to mount a sword to my player using mount object. I can do this. but when i do the player is constantly colliding with it and can't move. I want to disable collsion between the player and the mounted object. Also in any case, i do not want the mounted object to ever cause another item to stop moving. so basically everything can pass thru it, but i want to know when it passes thru anything other then the player. I think i will have to do something with the Masks.. but i don't know what.
www.garagegames.com/mg/forums/result.thread.php?qt=31306
I thought this would do it.. but no.
I want to mount a sword to my player using mount object. I can do this. but when i do the player is constantly colliding with it and can't move. I want to disable collsion between the player and the mounted object. Also in any case, i do not want the mounted object to ever cause another item to stop moving. so basically everything can pass thru it, but i want to know when it passes thru anything other then the player. I think i will have to do something with the Masks.. but i don't know what.
www.garagegames.com/mg/forums/result.thread.php?qt=31306
I thought this would do it.. but no.
#3
Thinking i might be able to just add a flag to the item i'm mounting wherever shapebase is defined and during the part of the collsion where the player and the object are Stopped from moving... i think that's player updatepos or something....., it would read that flag and if the flag is true then the collsion trigger would still occur... but the player wouldn't be stopped.
www.garagegames.com/mg/forums/result.thread.php?qt=25559
perhaps similiar to this bit of code. i was able to get that working but i need to check to see if an oncollsion still occurs or not.
Anyone done anything like this? i could really use some insight on the EASIEST was to get melee working for me.
07/01/2005 (7:21 pm)
Hmmm ok, might have to try this though i'm not too good with C++ so maybe someone can help.Thinking i might be able to just add a flag to the item i'm mounting wherever shapebase is defined and during the part of the collsion where the player and the object are Stopped from moving... i think that's player updatepos or something....., it would read that flag and if the flag is true then the collsion trigger would still occur... but the player wouldn't be stopped.
www.garagegames.com/mg/forums/result.thread.php?qt=25559
perhaps similiar to this bit of code. i was able to get that working but i need to check to see if an oncollsion still occurs or not.
Anyone done anything like this? i could really use some insight on the EASIEST was to get melee working for me.
#4
07/01/2005 (9:19 pm)
Make a disableCollision() call on the mounted object before the player runs its collision checks, and make an enableCollision() call after the collision checks are run. The player won't collide with the object, but everything else still will. It's not the exact solution you want, but it's a start I think.
#5
07/01/2005 (9:27 pm)
Hmmm well i'll take a peek at that and see if i can come up with anything. but it's probably not exactly what i'm looking for.
#6
Mounting an image does not require any C++ changes. All you gotta do is use the MountImage method in Torque Script where you are probably using MountObject.
07/02/2005 (7:18 am)
@Ramen, Mounting an image does not require any C++ changes. All you gotta do is use the MountImage method in Torque Script where you are probably using MountObject.
#7
07/02/2005 (11:30 am)
Yeah... mounting an Image will not return any collsion information. i want to monitor the collsion events.
#8
07/02/2005 (11:31 am)
I mean i can put a sword in my hand with mount image and swing for hours an it do nothing. i simply need to know when my sword or other object has touched someting else. Images will not do that.
#9
07/02/2005 (1:10 pm)
Use one of the melee resources.
#10
07/02/2005 (2:37 pm)
If i could get one to work, i would. But still i don't need all the functionality. i just need it to be simple.
#11
Whenever your player swings the sword ( an image ) you mount that shape ( as object ) on a mount point that's off the players bounding box. It won't hit the player but it will hit everything else, thus yielding your collision.
07/03/2005 (8:09 am)
Another sollution you may try is creating an invisible object ( all you have to do is use an invisible texture ) that represents that specific sword range. Something with a triangle-like shape. Whenever your player swings the sword ( an image ) you mount that shape ( as object ) on a mount point that's off the players bounding box. It won't hit the player but it will hit everything else, thus yielding your collision.
#12
07/03/2005 (11:58 am)
Hmm that may work for some swings, but would limit me on what i could do.. if i were to move the sword in certain ways that may bring that object into the collision mesh.
#13
07/04/2005 (1:28 pm)
Put as many mount points you need. Moving the sword left would change the mount point of the inv. col mesh to other more to the left.
#14
07/05/2005 (9:23 pm)
You could always do the very short range projectile trick if you want the easiest way.. it's not pretty but it would work for prototyping. Depends how simple your melee system is. Just mount a weapon that shoots a projectile short range.
#15
07/05/2005 (10:34 pm)
Yeah, that's already been suggested to me... i just can't figure out why no one seems to know how to just disable the collsion between the object and the mounted one and retain collision for other items. I can disable the collision while it's mounted, but it turns off collision for all things including the player.
Torque Owner Bruno Grieco
HTH