Game Development Community

AI Guard animation not playing

by Tim Lang · in Technical Issues · 08/19/2007 (12:33 pm) · 7 replies

Ok, so I got AI guard working...here's the new problem...

First, I have a player character that isn't Kork. I renamed the player folder "kork"...

When I change the shapeFile in the AIGuard datablock to kork, kork appears in game just fine.

The problem is that he doesn't animate anymore. He animates fine when he's the player. I'm sure it's something simple I forgot to chamge....what did I do wrong?

#1
08/19/2007 (3:47 pm)
Do you have the player.cs in the data/shapes correct?
#2
08/19/2007 (6:30 pm)
I'm pretty sure I do....I just copied the one out of the original player directory

//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

datablock TSShapeConstructor(PlayerDts)
{
   baseShape = "./player.dts";
   sequence0 = "./player_root.dsq root";
   sequence1 = "./player_forward.dsq run";
   sequence2 = "./player_back.dsq back";
   sequence3 = "./player_side.dsq side";
   sequence4 = "./player_lookde.dsq look";
   sequence5 = "./player_head.dsq head";
   sequence6 = "./player_fall.dsq fall";
   sequence7 = "./player_land.dsq land";
   sequence8 = "./player_jump.dsq jump";
   sequence9  = "./player_diehead.dsq death1";
   sequence10 = "./player_diechest.dsq death2";
   sequence11 = "./player_dieback.dsq death3";
   sequence12 = "./player_diesidelf.dsq death4";
   sequence13 = "./player_diesidert.dsq death5";
   sequence14 = "./player_dieleglf.dsq death6";
   sequence15 = "./player_dielegrt.dsq death7";
   sequence16 = "./player_dieslump.dsq death8";
   sequence17 = "./player_dieknees.dsq death9";
   sequence18 = "./player_dieforward.dsq death10";  
   sequence19 = "./player_diespin.dsq death11";
   sequence20 = "./player_looksn.dsq looksn";
   sequence21 = "./player_lookms.dsq lookms";
   sequence22 = "./player_scoutroot.dsq scoutroot";
   sequence23 = "./player_headside.dsq headside";
   sequence24 = "./player_recoilde.dsq light_recoil";
   sequence25 = "./player_sitting.dsq sitting";
   sequence26 = "./player_celsalute.dsq celsalute";
   sequence27 = "./player_celwave.dsq celwave";
   sequence28 = "./player_standjump.dsq standjump";
   sequence29 = "./player_looknw.dsq looknw";
};

even though it isn't the player, is it ok that all the dsq's start with player_?
#3
08/19/2007 (6:41 pm)
You need to change this part to be unique:

datablock TSShapeConstructor(PlayerDts)

namely, PlayerDts needs to be unique for each of your players.
All the rest is fine.
Make sure to point your serverside player to your newly named player.
#4
08/19/2007 (6:53 pm)
Did you create this model or purchase it? Can you give alittle background on the model.
#5
08/19/2007 (7:06 pm)
The first model is a model I created. we'll call him "Norman". (shapes\player\player.dts) Norman is the player and works just fine.

When AIGuard uses the Norman model everything works fine.

When I switch the AIGuard to use kork (shapes\kork\player.dts) kork plays no animation.
#6
08/21/2007 (10:16 am)
So I think I'm getting closer....here's what I think the problem is...

I used shapeFile = "..." in the Datablock to tell Torque to use Kork instead of Norman, but I guess Torque doesn't know where to look for the animations.

Is there a animFile or something like that that I can use in a Datablock to tell Torque where to look for the kork.cs file?
#7
08/21/2007 (2:35 pm)
I think I figured out the problem...

I have to create a new cs file in the data/server directory that basically copies player.cs and changes the shapes in there.

If anyone else has the problem, here's my step by step to fix it:

1. in data/server, copy player.cs and rename it to something else (player2, adam, etc)
2. Inside your new file change line 7 from exec("~/data/shapes/player/player.cs"); to the cs file in your new chars directory Like exec("~/data/shapes/adam/adam.cs");
3. go down to datablock PlayerData(PlayerBody) and rename that to a unique name (I used PlayerData(AdamBody))
4. Change the shape file in that datablock to your new dts ("~/data/shapes/adam/adam.dts";)
5. Save that file
6. Open aiguard.cs and change datablock PlayerData(GuardPlayer : PlayerBody) to your new datablock (datablock PlayerData(GuardPlayer : AdamBody))
7. (Forgot to add this) go into game.cs and add an exec of your new version of the player.cs
8. save that file
9. delete your DSOs and you should be good to go.

for reference, I found this fix in Alan James' post in the AIGuard page