What is the best way to add a non-animated player?
by Mike Rowley · in Torque 3D Professional · 11/15/2009 (4:20 pm) · 7 replies
I need to add an aiPlayer that isn't animated. I just want it to sit.
Here's what I've tried, using kork the orc, but he just stands and has no texture.
This doesn't work in t3d.
Also, in with my orc.dts file, I have added a material.cs file, but it isn't being read eather.
edit to add:
Nevermind the texture. I got that to work. :-)
I simply changed the texture name to player.
Here's what I've tried, using kork the orc, but he just stands and has no texture.
datablock StaticShapeData(orcShape)
{
category = "Misc";
className = "MyTest";
shapeFile = "art/shapes/orc/orc.dts"; // path to my orc.dts file
isPlaying = 1;
};
function MyTest::onAdd(%this, %obj)
{
%obj.playthread(0, "sitting"); // the animation to play (dsq)
}This doesn't work in t3d.
Also, in with my orc.dts file, I have added a material.cs file, but it isn't being read eather.
new Material(myOrc)
{
baseTex[0] = "orc"; // Renamed from player_orc.png
translucent = false;
};Does anyone have any ideas how to make this work?edit to add:
Nevermind the texture. I got that to work. :-)
I simply changed the texture name to player.
#2
Also, after adding more orcs, they have lost their textures and are all yellow. I have no clue why.
11/15/2009 (6:23 pm)
Yes. Sorry about that. Also, after adding more orcs, they have lost their textures and are all yellow. I have no clue why.
#3
Also do you have a cs file for the object itself. Which will probably need to point to the animations you want it to use (like player.cs in shapes).
Example, my aidstation - it doesn't have any animations, but it is a dynamic object and so needs it's own aidstation.cs in the same directory as tyhe DTS just to initialize it, on top of the staticshape info in art/datablocks.
11/15/2009 (6:38 pm)
Select an orc in the editor, boot up Matieral Editor, select texture from the drop down list to see which ones the model is using.Also do you have a cs file for the object itself. Which will probably need to point to the animations you want it to use (like player.cs in shapes).
singleton TSShapeConstructor(aidstationDts)
{
baseShape = "./aidstation.dts";
};Example, my aidstation - it doesn't have any animations, but it is a dynamic object and so needs it's own aidstation.cs in the same directory as tyhe DTS just to initialize it, on top of the staticshape info in art/datablocks.
#4
I think I'm just going to pull the orc into deled and model him to sit. (or I'll leave him standing. Haven't decided yet)
In oder to just get him into the game, I had to change the word "datablock" in the code above (original post) to "singleton". (I have no clue why they changed that, but that's ok)
I'll try the material editor and see if I can at least get cloths on him. Orcs don't look good naked. :-O
Thanks for the help guys. It is much appreciated.
11/15/2009 (8:04 pm)
heh. I totally forgot about the datablocks folder. I think I'm just going to pull the orc into deled and model him to sit. (or I'll leave him standing. Haven't decided yet)
In oder to just get him into the game, I had to change the word "datablock" in the code above (original post) to "singleton". (I have no clue why they changed that, but that's ok)
I'll try the material editor and see if I can at least get cloths on him. Orcs don't look good naked. :-O
Thanks for the help guys. It is much appreciated.
#5
11/15/2009 (8:43 pm)
I think it has to do with TSShapeConstructor no longer being a datablock. Kind of threw a giant wrench on us till we decided to use the Beta code before it happened.
#6
Anyhoo - new Material should also be changed to singleton Material ... apparently.
11/15/2009 (10:58 pm)
Apparently it (singleton) can re/write on the fly ... or something, something which datablock can't.Anyhoo - new Material should also be changed to singleton Material ... apparently.
#7
Hey, at lease I was able to get cloths back on Kork. (you didn't want to see that sight.)
11/15/2009 (11:08 pm)
Thanks guys. Both things are good to know. Torque 3d, as awesome as it is, is different from the other 2 engines I'm used to working with. I'll get it tho. :-)Hey, at lease I was able to get cloths back on Kork. (you didn't want to see that sight.)
Associate Manoel Neto
Default Studio Name