Getting a milkshape player into my game
by Ari J · in Torque Game Engine · 12/11/2004 (2:22 am) · 9 replies
Hello everyone,
I am here to ask a question wich i think has been answered very often, but, i am going to ask anyway:
How do i get my milkshape player into the game?
I followed these instructions on how to prepare the dts model, but now all i need to know is how to get it into the game: How should the player.cs look like? How should the sequence lines look like? And what scripts should I change?
I have been working on this for a week and i basically have no clue what to do :(
Thanks,
Ari J.
I am here to ask a question wich i think has been answered very often, but, i am going to ask anyway:
How do i get my milkshape player into the game?
I followed these instructions on how to prepare the dts model, but now all i need to know is how to get it into the game: How should the player.cs look like? How should the sequence lines look like? And what scripts should I change?
I have been working on this for a week and i basically have no clue what to do :(
Thanks,
Ari J.
About the author
#2
12/11/2004 (3:51 am)
Thank you, but about the animations, how do i declare the seq? what should the code line look like?
#3
I know that if you are trying to create a model and use the animations (dsq files) already supplied with the default torque player, you have to make sure your skeleton is the same. I remember reading some forum posts on that.
Hopefully someone who's done this already can give you a better answer.
12/11/2004 (3:59 am)
I haven't gotten to that part of my game yet, but I assume you would just do it the same way it is in data/shapes/player/player.cs. Of course you have to export the sequences from milkshape properly. There's documentation on the exporter that explains how to do that.I know that if you are trying to create a model and use the animations (dsq files) already supplied with the default torque player, you have to make sure your skeleton is the same. I remember reading some forum posts on that.
Hopefully someone who's done this already can give you a better answer.
#4
12/11/2004 (4:03 am)
Milkshape doesn't use dsq, so that is why i am asking how to implement animation :S
#5
seq:root=21-31,fps=10,cyclic this would be the standard idle animation. the 21-31 are the frames that the animation will be played over.
seq:run=1-10,fps=17,cyclic this is the run animation.
seq:die1=32-50 that would be the death animation.
Of course there are many other animations for torque. But, those are the main ones. You can look in player.cs and find other animation names. THen just replace player.dts with the new one that made and run the game.
I hope I helped you, Max :)
12/11/2004 (6:48 pm)
Hello, You must joint the moddel, rig it with the player mesh, and then use a material name that looks summit like this seq:root=21-31,fps=10,cyclic this would be the standard idle animation. the 21-31 are the frames that the animation will be played over.
seq:run=1-10,fps=17,cyclic this is the run animation.
seq:die1=32-50 that would be the death animation.
Of course there are many other animations for torque. But, those are the main ones. You can look in player.cs and find other animation names. THen just replace player.dts with the new one that made and run the game.
I hope I helped you, Max :)
#6
12/11/2004 (9:27 pm)
There are two ways to define animations; the first is just inside the DTS and the second is in extra external files (ie, DSQs). The latter is a means to easily share animation between the shapes. If you "just need animation" then do it the standard way and put it in the DTS...
#7
I just need to know what i should put after the sequence#, because of course, i don't have any dsq files. Should i change it to .mat or something?
Thanks,
Ari J.
12/12/2004 (12:39 am)
Hey and thank you for the answers, but acctually i have the animations declared that way in the .dts (with the exception of the fps command, thanks Max.) What i need to know is how to declare these animations in script. In the regular player.cs it looks something like this:datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_forward.dsq run";
sequence2 = "./player_back.dsq back";I just need to know what i should put after the sequence#, because of course, i don't have any dsq files. Should i change it to .mat or something?
Thanks,
Ari J.
#8
12/12/2004 (11:56 am)
The TSShapeConstructor exists only to "link" DSQ and DTS shapes. If the animation is in the DTS it's already there, you don't have to do anything else to make it show up in engine.
#9
12/12/2004 (12:03 pm)
Thank you :) You've been a great help.
Torque Owner Vijay Myneni
shapeFile = "~/data/shapes/player/player.dts";
Just change this to point to your dts file. That should do the trick for just replacing the model (which is as far as that tutorial goes, I think). If you've got your own skeleton/animations as well, you're going to have to also modify data/shapes/player/player.cs to point to your animations.