Game Development Community

Slwoing down npcs

by Wayne · in Technical Issues · 04/07/2008 (12:20 pm) · 5 replies

Hi,

i have a function moving npcs...

$runVar = 30;

function ApplePlayer::gotoRandomPoint( %this )
{
%currentTransform = %this.getTransform() ;
%randomVect = getRandom(-$runVar,$runVar) SPC getRandom(-$runVar,$runVar) SPC 0 ;
%newTransform = VectorAdd(%currentTransform, %randomVect) ;
%this.setMoveDestination( %newTransform ) ;
}

but my npcs are moving very fast. Is there any function for the aiplayer like setSpeed? And is there any resource, where I can find functions like that for the specific objects in torque. I haven't found a documentation for that, so i have to ask :-/

Thanks in advance...

#1
04/11/2008 (9:39 pm)
Wouldn't this just be set in the datablock for the aiplayer?
#2
04/12/2008 (11:02 am)
You should be able to call %this.setMoveSpeed on any AI Players. Set move speed use percents of speed, so make him run half of his normal speed, use %this.setMoveSpeed(0.5).
#3
04/13/2008 (10:33 am)
Thanks... where do I find these attributes to manipulate. or do you just guess?
#4
04/13/2008 (3:36 pm)
Check out TDN.garagegames.com. Also, I find it handy to do a dump in-game. For example, get the aiPlayer's simID, then in the console do like: 2354.dump, and it will list out all the methods and such for that object.
#5
04/13/2008 (4:25 pm)
Oh great.. thanks