Game Development Community

Advanced 3DGPAI1 - Making Chap. 7 More Complicated :P

by Chris Oconnell · in Torque Game Engine · 02/23/2006 (9:01 pm) · 2 replies

I am trying to utilize many multiple AI chaser guards in a project, but I don't want them all to look alike.
Can anyone tell me how I would go about modifying aiGuard.cs to load a random model from any number of 3 or 4 dts characters?

...or if easier, how to load random skins onto one dts guy?

...Thanks ahead.

#1
03/03/2006 (1:06 pm)
Try this, in the on add part of the aiguard.cs,

(Bear with me I'm working from thought alone no code in front of me)


............Under the onAdd function

%obj.setskinname(%randomskins);

switch$(%randomskins)
{
case "blue":
%randomskins = "~/data/Shapes/Player/BlueTexture";
case "Green":
%randomskins = "~/data/Shapes/Player/GreenTexture";
case "Grey":
%randomskins = "~/data/Shapes/Player/GreyTexture";
default:
%randomskins = "~/data/Shapes/Player/DefaultTexture";
}

Something like that should work I think.
#2
03/03/2006 (2:14 pm)
Well... there's no onAdd function anywhere in AiGuard.cs. I tried putting it in different parts of the spawn and playerdata datablocks, but no luck.
Thanks for trying, though.