Game Development Community

Changing Default Enemy Models

by Tom Biagioni · in Torque Game Engine · 02/12/2009 (10:10 am) · 5 replies

Hey guys whats going on. Im doing a game for school, and so far everyone here inthe community has been a great help for me in my learning expirience. My question is how do i change the AI models that spawn? right now when i spawn my ai (Via spawn point) they default to whatever the player character model is. I have a skeleton model i would like to use for my ai, however im having no luck. Ive tried making changes to aiPlayer, and the datablock for the skeleton, but it only causes torque to crash on game start.

I also ive looked through tons of threads trying to find a solution, and most of them are on private forums (i dont own TGE yet, but i do plan on buying it after this semester)


#1
02/12/2009 (2:40 pm)
If you're using the default demo pathed AI you'll need to modify the aiPlayer's datablock
datablock PlayerData(DemoPlayer : PlayerBody)
{
   shootingDelay = 2000;
};
"DemoPlayer" is the name of the datablock, the " : " denotes that it inherits all of the properties of the "PlayerBody" datablock -- which means it also inherits the shapeFile also. To "overwrite" that you'll need to add a "new" shapeFile field to the DemoPlayer datablock.
datablock PlayerData(DemoPlayer : PlayerBody)
{
    shootingDelay = 2000;
    shapeFile = "~/data/shapes/player/player.dts";// filepath to your skeleton.dts
};
And that works for me, hope it helps.
#2
02/12/2009 (3:14 pm)
do i have to duplicate the player.cs file, or will it know to go to the skeleton.cs file that contains all the datablocks for skeleton? Im asking becuase in Player.cs the datablock is called PlayerBody, and in my skeleton file its datablock is also called PlayerBody.

also this is what im using to spawn my AI

http://www.garagegames.com/community/blogs/view/15961
#3
02/12/2009 (9:53 pm)
ha i got the skeleton to spawn, but for some reason theres no texture. hes all metalic blue lookin
#4
02/12/2009 (10:04 pm)
hmm when im approaching the skeleton the skeletons textures look fone but when i get closer he turns blue...

heres a screenshot
http://img156.imageshack.us/img156/2387/errorbluetexturela8.jpg
#5
02/12/2009 (10:46 pm)
Well i figured it out, i had to turn of

$pref::environmentMaps = "1";

in preferences. I set the value to "0" and now they look great:D