I want to ride a horse in Torque
by Rob Riddell · in Torque Game Engine · 04/27/2004 (8:33 pm) · 12 replies
My goal is to ride a horse in torque. I will guess that I need to start with the shape class somehow.
This seems to be different than a flyer or a wheeled vehicle.
Can I do this in the scripting or do I need to get into the vehicle.cc file?
I am using the MilkShape for models and the 3d-diggers .dts exporter. Will that affect answers about nodes to be included in the model to be riden?
I have figured out some stuff like replacing the player .dts and some of the animations with milkshape and .dts exporter and writing in animations for different key bindings.
I'm a noob on his way! lol
thanks in advance
smiles . . .
This seems to be different than a flyer or a wheeled vehicle.
Can I do this in the scripting or do I need to get into the vehicle.cc file?
I am using the MilkShape for models and the 3d-diggers .dts exporter. Will that affect answers about nodes to be included in the model to be riden?
I have figured out some stuff like replacing the player .dts and some of the animations with milkshape and .dts exporter and writing in animations for different key bindings.
I'm a noob on his way! lol
thanks in advance
smiles . . .
#2
04/28/2004 (8:08 pm)
I am starting tonight with an AIplayer and trying to make it mountable, and with 4 legs. lol
#3
04/30/2004 (9:15 am)
:)...that was my latest idea also, Rob...lol. I don't know if you'll be able to control it? or if it will just run between path nodes, I still don't fully understand scripting. Like for example with the AIPlayer attempt; won't the engine get confussed deciding which mountPoint to choose? and if you put a mountPoint Node onto a PlayerCharacter, how will it correctly know which Node to use for a weapon attachment? These are the start of my questions, :)!
#4
smiles . . .
05/01/2004 (1:31 am)
Hmm, an animal is a sentient vehicle. there is not a class for that yet in the engine , maybe?smiles . . .
#5
05/01/2004 (3:02 am)
There are many threads about this already :P you might want to check them out too
#6
any direction to resources is welcome
Am currently reading through all the resources to understand how to get a vehicle that might be mountable and think like a bot
an I crazy?
05/01/2004 (3:09 am)
I've been looking for relevant threads. I am also using this as a way to delve into the code and learnhow things interact.any direction to resources is welcome
Am currently reading through all the resources to understand how to get a vehicle that might be mountable and think like a bot
an I crazy?
#7
%aiplayer.mountObject(%player, 0);
If it is set as the player's control object, you will control it, i.e. even if you use %aiplayer.setMoveDestination(...) it will be ignored.
The player and aiplayer will collide all the time tho, causing strange behaviours, but you can prevent this by looking for the Player::buildConvex() function in player.cc and adding:
One more thing is that whenever you fire, your projectiles will hit the animal you're riding 9 times out of 10. I made some changes in projectile.cc to avoid that, let me know if you need it (i believe this can be done from scripts too).
05/01/2004 (3:16 am)
Using an aiplayer shouldn't be hard, you can simply use %aiplayer.mountObject(%player, 0);
If it is set as the player's control object, you will control it, i.e. even if you use %aiplayer.setMoveDestination(...) it will be ignored.
The player and aiplayer will collide all the time tho, causing strange behaviours, but you can prevent this by looking for the Player::buildConvex() function in player.cc and adding:
if (isMounted()) return;just at the top of the function.
One more thing is that whenever you fire, your projectiles will hit the animal you're riding 9 times out of 10. I made some changes in projectile.cc to avoid that, let me know if you need it (i believe this can be done from scripts too).
#8
05/01/2004 (5:31 am)
THANKS a great deal, Hadoken, I've looked but haven't seen a lot of actual deatails into this process yet, I don't have access to Source code, I'm merely an Artist[merely!], but this is good to know it is indeed possible to achieve this. I don't know if my hacky scripting skills are up to it...I usually spend a lot of time staring at Datablocks trying to interept their meaning as if hierogliphics[sic] on a temple wall...:) Sometimes I find the secret door, many times; not.
#9
05/01/2004 (1:44 pm)
Thanks very much too. I will try to continue working on this. Smiles . . .
#10
I have recompiled with the alteration to player.cc
But where do I put the
%aiplayer.mountObject(%player, 0);
line. I have been learning lots but still don't have the horse working yet. I made a model with the mount0 point on top so the player can be on top. I have done tutorials about spawning in bots, and tried making a copy of aiplayer, calling it with its own model and no path to follow. Also tried just sticking that line in at various places , but I still don't know enough yet.
Do you have more hints and directions to point me to? Thanks very kindly in advance.
This has been fun tracking through and working on. An interesting goal to start learning the deeper scriptig interactions.
smiles . . .
05/16/2004 (9:25 am)
@HadokenI have recompiled with the alteration to player.cc
But where do I put the
%aiplayer.mountObject(%player, 0);
line. I have been learning lots but still don't have the horse working yet. I made a model with the mount0 point on top so the player can be on top. I have done tutorials about spawning in bots, and tried making a copy of aiplayer, calling it with its own model and no path to follow. Also tried just sticking that line in at various places , but I still don't know enough yet.
Do you have more hints and directions to point me to? Thanks very kindly in advance.
This has been fun tracking through and working on. An interesting goal to start learning the deeper scriptig interactions.
smiles . . .
#11
mountPose[0] = "riding";
numMountPoints = 1;
your aiplayer model needs a mount0 node and your player should have a "riding" animation.
In my experience, the player will always be mounted at his own pivot point, node names like "mountPoint" on the player object won't work (i might be wrong about this, but i tried quite a few different names for the nodes and none worked). So i think for a horse its mount0 node should be placed on the bottom to have the player properly sitting on it.
If your aiplayer's datablock + model are ok, you should be able to mount it by typing that command in the console during the game, whenever you need it
05/18/2004 (3:16 pm)
I did this some time ago so i'm not sure i can remember everything you need to get it working, anyway i think your aiplayer's datablock should have these lines:mountPose[0] = "riding";
numMountPoints = 1;
your aiplayer model needs a mount0 node and your player should have a "riding" animation.
In my experience, the player will always be mounted at his own pivot point, node names like "mountPoint" on the player object won't work (i might be wrong about this, but i tried quite a few different names for the nodes and none worked). So i think for a horse its mount0 node should be placed on the bottom to have the player properly sitting on it.
If your aiplayer's datablock + model are ok, you should be able to mount it by typing that command in the console during the game, whenever you need it
#12
I was looking at the mount points and the interactions.
I am also looking at the setControlObject lines also.
smiles . . .
05/19/2004 (6:57 am)
Thank-you, I will dontinue to read about other vehicle issues too, they all seem interconnected I was looking at the mount points and the interactions.
I am also looking at the setControlObject lines also.
smiles . . .
Torque Owner Rex
BrokeAss Games
Rex
PS-please anyone with any concrete data on this subject please chime in...I'm looking for a way to accomplish a rideable vehicle...and am quite willing to commision some work done. Scripting/coding is not my best skill, I'm a shape artist and have gotten the whole gamut of objects imported[players, weapons, vehicles{single axle cart type!}, this object is proving to be quite difficult for me to generate...!
Thanks all.