Game Development Community

enableUpdateCallback. Unknown command

by rennie moffat · in Torque Game Builder · 12/10/2009 (3:03 pm) · 4 replies

Hey, I am working on a few things and maybe someone can shed some light on this. I have a code with enableUpdateCallback being called in my on behaviorAdd.


In my console log I am getting an error (written in grey) "(17) Unknown command enableUpdateCallback."


? pardon my language but "huh?"



this is the code, if someone could help me that would be great. Thanks, appreciate it.
Ren


if (!isObject(CubeImageSwitcher))
{
   %template = new BehaviorTemplate(CubeImageSwitcher);
   
   %template.friendlyName = "CubeImageSwitcher";
   %template.behaviorType = "PlayerAI";
   %template.description = "Swiches frame of image when cube passes a certain point";
   
   %template.addBehaviorField(image, "image of object being used", object, "", t2dImageMapDataBlock);
   %template.addBehaviorField(frameStart, "frame number image starts with", int, 2);
   %template.addBehaviorField(frameFinish, "frame number image finishes with", int, 1);
   %template.addBehaviorField(switchPointX, "WorldPointX where image must switch frames", float, 75);
}

function CubeImageSwitcher::onBehaviorAdd(%this)
{
		%this.enableUpdateCallback();
}

function CubeImageSwitcher::onUpdate(%this)
{
	if(isObject(%this.image))	
	%this.position = %this.owner.getPosition();
	
	if(%this.position < %this.switchPointX)
	{
		%this.owner.setFrame(%this.frameStart);
	}
	
	if(%this.position > %this.switchPointX)
	{
		%this.owner.setFrame(%this.frameFinish);
	}
}

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
12/10/2009 (3:11 pm)
Edit:

I just found out. I had not called it as an "owner". Thanks.
#2
12/15/2009 (2:26 am)
Okay... this is the second time I've seen a new account put up a reasonable sounding sentence but has a link to a site selling a totally random service (the same service as the first account).

I wouldn't be surprised if this isn't happening in other forums. And I won't be surprised when spam takes over the forums.

I'll post again in the Site Feedback forums, but I'm hoping that this problem is being addressed.
#3
12/15/2009 (2:54 am)
Ugh...spammers. DELETED

Yahoo is becoming the bane of my existence. Every single instance of manual spam and theft in the past month has been from a Yahoo account. What really sucks, is they have started using our own markup tags so their links work...effort geared toward TorquePowered.com
#4
12/15/2009 (6:03 am)
Fortunately, manual spam is expensive compared to the automated junk. At least they aren't being so bold as to create blogs!
#5
12/15/2009 (8:09 am)
SPAM SPAM SPAM.

I never saw the link, what was it for?