Charector pack and AI issue.
by Don Cramer · in Torque Game Engine · 01/29/2005 (2:22 am) · 15 replies
Hi!
I am trying to use Jill from the bravetree charector pack as one of the AI players and I just can not get her to work.
I have implimented both AIPatrol and AIGuard from the resources.
What I have done is
Create a directory inside data/shapes name jill, inside that I copied over the 3 files that came with jill (dts and 2 textures). I copied over from the data/player folder all dsq files, debres dts file, player.cs file. I also changed the TSShapeConstructor name in player.cs to be jillDts.
Inside server/scripts i created jill.cs which exec's the player.cs file inside of the jill dir, and then it includes the datablock PlayerData(jill).
In game.cs I include jill.cs
Inside AUGuard.cs I change the line
datablock PlayerData(GuardPlayer : PlayerBody)
to read
datablock PlayerData(GuardPlayer : jill)
I start the game and start a mission which includes aiguard. I can run around see that jill is now a guard, but as soon as she fires or we get within visual distance torque freezes up.
I tried a few other tests and replaced the jill.dts with a few other charectors mainly from realmwars and they all work perfectly, but jill will not.
Jill works fine when I use her as playerbody, the main player. So i guess I am not sure how to impliment her as an AI player.
I am trying to use Jill from the bravetree charector pack as one of the AI players and I just can not get her to work.
I have implimented both AIPatrol and AIGuard from the resources.
What I have done is
Create a directory inside data/shapes name jill, inside that I copied over the 3 files that came with jill (dts and 2 textures). I copied over from the data/player folder all dsq files, debres dts file, player.cs file. I also changed the TSShapeConstructor name in player.cs to be jillDts.
Inside server/scripts i created jill.cs which exec's the player.cs file inside of the jill dir, and then it includes the datablock PlayerData(jill).
In game.cs I include jill.cs
Inside AUGuard.cs I change the line
datablock PlayerData(GuardPlayer : PlayerBody)
to read
datablock PlayerData(GuardPlayer : jill)
I start the game and start a mission which includes aiguard. I can run around see that jill is now a guard, but as soon as she fires or we get within visual distance torque freezes up.
I tried a few other tests and replaced the jill.dts with a few other charectors mainly from realmwars and they all work perfectly, but jill will not.
Jill works fine when I use her as playerbody, the main player. So i guess I am not sure how to impliment her as an AI player.
About the author
#2
01/29/2005 (12:46 pm)
Thanks for posting the fix!
#3
01/29/2005 (1:40 pm)
The jill model has all of the sequences baked in so you don't need the dsq's or the TSShapeConstructor. When you exported her from Milkshape you probably blew away her animations (the ms3d exporter has the animation export turned off by default). My guess is that the dsq's were conflicting somehow with the animations in the model.
#4
// Load dts shapes and merge animations
exec("~/data/shapes/player/player.cs");
in the top. Im guessing that is what you mean. If so it appears it does load up the dsq's??
The dts exported from milshape is some 345k while the original is 190k which comes with the pack. So i checked milkshape and the include animations box is checked, if i export without animations the dts is only 140k and while still loading the player dsq's, no animations at all play. So i use the 345k export and removed all refrences to loading the dsq's and deleted the dsq's. Still works fine.
Take care..
01/30/2005 (10:06 pm)
The original player.cs that comes with the jill char pack has// Load dts shapes and merge animations
exec("~/data/shapes/player/player.cs");
in the top. Im guessing that is what you mean. If so it appears it does load up the dsq's??
The dts exported from milshape is some 345k while the original is 190k which comes with the pack. So i checked milkshape and the include animations box is checked, if i export without animations the dts is only 140k and while still loading the player dsq's, no animations at all play. So i use the 345k export and removed all refrences to loading the dsq's and deleted the dsq's. Still works fine.
Take care..
#5
02/28/2005 (11:30 am)
I'm having trouble activating the animations for the character once its exported to Torque. I can bring her in as a Static Shape but none of the animations play that are baked into the .dts file. Do I need to indicate in some .cs file where/ which animations play for the model? Thanks in advance.
#6
Have you looked at the model in Torque Show Tool Pro?
02/28/2005 (3:43 pm)
What are you exporting from?Have you looked at the model in Torque Show Tool Pro?
#7
02/28/2005 (3:51 pm)
Yeah, everything looks fine in the Show Tool. All the animations play appropriately and nothing looks out of whack. But in Torque, I bring the character in as a Static Shape and none of the animations play. Do I need to do some scripting to get the characater to walk and die based on the threads that I've animated it with?
#9
06/27/2005 (11:19 am)
Since we are on the subject of Jill.. I loaded Jill in Milkshape and all I see is 1000 blue and yellow lines. How do you change MS to just show the character?
#10
I used Jill with the AIGuard resource. It worked great.
06/28/2005 (4:21 am)
@Howard - There is a note in the docs how to fix that. A setting you have to change.I used Jill with the AIGuard resource. It worked great.
#11
Ok I got jill to export and the animations are in the showtool but not in the game, same problem John Cooney has.
@Matt that link points to "engine coding in C++"
08/19/2005 (8:48 am)
@Chris, thanks got it now.Ok I got jill to export and the animations are in the showtool but not in the game, same problem John Cooney has.
@Matt that link points to "engine coding in C++"
#12
08/19/2005 (3:06 pm)
Sorry, the website switch over ate that document. I updated the link to a resource that covers the same thing.
#13
I tried every button I could find in the exporter but still no animations in game.
08/19/2005 (3:17 pm)
Thanks Matt but now it points to "Ambient Animations with the StaticShape Class"I tried every button I could find in the exporter but still no animations in game.
#14
since that link covers calling animations on StaticShapes (specifically the playThread(0,"wave"); bit).
So, you are using the Jill Pack? What modelling package are you exporting her from? Did you edit the model? Are you using her as a StaticShape or as a Player (big difference in how the animations get called)?
08/19/2005 (3:24 pm)
Well...I linked that in response toQuote:
But in Torque, I bring the character in as a Static Shape and none of the animations play.
since that link covers calling animations on StaticShapes (specifically the playThread(0,"wave"); bit).
So, you are using the Jill Pack? What modelling package are you exporting her from? Did you edit the model? Are you using her as a StaticShape or as a Player (big difference in how the animations get called)?
#15
I used the BraveTree animframe setup for numbering which frames for each anim and exported but no animations as a "player".
I do understand the difference from player vs staticShape so thats not at issue.
The animations show up in the game using the original Jill.dts from the pak and the version I exported does not have animations.
Both Jill.dts from the bravetree pack and the one I exported from Milkshape work in show tool.
Mystery....
08/19/2005 (4:52 pm)
I am trying to just export her as is from MilkShape just to get it to work. I used the BraveTree animframe setup for numbering which frames for each anim and exported but no animations as a "player".
I do understand the difference from player vs staticShape so thats not at issue.
The animations show up in the game using the original Jill.dts from the pak and the version I exported does not have animations.
Both Jill.dts from the bravetree pack and the one I exported from Milkshape work in show tool.
Mystery....
Torque 3D Owner Don Cramer
thanks