Game Development Community

GetBehaviorCount()

by Gellyware · in Torque Game Builder · 05/11/2007 (11:49 pm) · 1 replies

Does getBehaviorCount() work?

If so, how is it used?

The console keeps giving me errors from below saying either unknown command or unable to find function.

I've tried the following:



function gemBehavior::checkForMoreGems(%this)
{
      
   echo("getBehaviorCount():"@ getBehaviorCount());
   echo("getBehaviorCount():"@ %this.getBehaviorCount());
   echo("getBehaviorCount():"@ gemBehavior::getBehaviorCount());

}


P.S. The behavior part works fine, just trying to get a "gemBehavior" count so I can loop through all of the behavior objects within it from another object.

#1
05/12/2007 (12:13 am)
Behaviors do not have behaviorCounts() objects do ;p

try:

function gemBehavior::checkForMoreGems( %this )
{
   echo( "getBehaviorCount():" @ %this.owner.getBehaviorCount());
}

Notice the %this.owner in there.