Vehicle Mount questions
by Kevin Ostrowski · in Torque Game Engine · 02/22/2002 (5:06 pm) · 4 replies
Ok, I've only owned the SDK for about 24 hours and I've done a few tutorials yada yada yada.... Anyway, a few questions about mounting. First off I tried doing the Vehicle tut, but something didn't work correctly so I'm not even sure how mounts work... Do you just walk up to it? And if so how would you change it so a key would make you mount it simmilar to the way you steal a car in GTA. I know this is a pretty vague question but, hey this is the getting started forum :) Thanks.
#2
02/23/2002 (3:51 pm)
It was your tutorial, but I just managed to get it working... I had some paths wrong... The only thing that still doesn't work is the mouseJet() function, although that's no bigge... So would I put an if statement inside that collision to only mount if a trigger is pressed? Or am I thinking about it all wrong? Thanks for the tutorial, besides my own retartedness it was great..
#3
no need to be hard on yourself :) simple mistakes are popular in the beginning ..
what I would consider for setting up a vehicle mount via keypress can be done in a few different ways ..
one such way would be to simply cast a ray in front of your character at time of button press .. if the cast meets an object and the distance is satisfactory.. set its position as a target position and draw the character to it..
this I think would be the easiest and possibly most efficient .. as well I would consider a VehicleSet
.. notice the class SimSet which enables one to create a "named group" of items so .. you can essentially add the vehicles to a group .. and peruse that group depending on your mounting needs..
This is the method I am implementing for my AI to cheat thier way to an appropriate vehicle when in need of one
02/23/2002 (10:15 pm)
Great glad to hear you gots it working ..no need to be hard on yourself :) simple mistakes are popular in the beginning ..
what I would consider for setting up a vehicle mount via keypress can be done in a few different ways ..
one such way would be to simply cast a ray in front of your character at time of button press .. if the cast meets an object and the distance is satisfactory.. set its position as a target position and draw the character to it..
this I think would be the easiest and possibly most efficient .. as well I would consider a VehicleSet
.. notice the class SimSet which enables one to create a "named group" of items so .. you can essentially add the vehicles to a group .. and peruse that group depending on your mounting needs..
This is the method I am implementing for my AI to cheat thier way to an appropriate vehicle when in need of one
#4
02/24/2002 (3:07 pm)
What I did was just create a "MountVehicle" server command and a 'mountVehicles' variable in the player's datablock. I bound the server command to a key. When invoked, the server sets the client's variable to true, after checking that it's ok to allow the player to mount. In the player's collision detection code, it just checks if the collided object is a vehicle with available mount slot, and if the mount variable in the player datablock is set. If all is good, player mounts.
Torque Owner Badguy
in my tutorial this is covered
you simply collide with it providing you've modified your script
.. which vehicle tutorial did you use?
if mine ..
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2036
please give me a better description of where it fails you..
you can open the console as im sure you know using the tilde key "~" and logged information read from there regarding the script used for the vehicle .. or the state of it when added would be helpfull in resolving this problem
simply page up thru the provided log looking for red or anything related to the vehicle code
as well I have some simple ideas to enable the keypress vehicle find / mount methods but first I suggest making sure you can get in it via the conventional methods