Behaviors Not Showing Up
by rennie moffat · in Torque Game Builder · 11/09/2009 (1:01 pm) · 4 replies
Hi there guys, I am just messing around with basic movement behaviors. Studying others and creating my own. I have started a new project and have set up 3 behaviors in the folder, however only one shows. The only clear difference is the one that shows has a copy of it with a .dso extension while the others don't. I am not sure how to give it a .dso extension or even what that is. If anyone has any insight please inform me.
Thanks
Thanks
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.
#2
11/09/2009 (1:15 pm)
hmm ok, that makes sense. Will do, except the two behaviors not showing up are ones from TGB examples. Anyhow, I know I may get my head ripped off for asking this, but I am playing with this code, it has no errors, is complied but is not working. If there is an obvious error I would appreciate an elder jedi (TGB programmer) to point the error of my ways. if(!isObject(Spacer3000Controls))
{
%template = new BehaviorTemplate(Spacer3000Controls);
%template.friendlyName = "Spacer3000 Controls";
%template.behaviorType = "Player Controls";
%template.description = "Spacer3000 Controls";
%template.addBehaviorField(upKey, "Key to bind vertical thrust", keybind, "keyboard up");
%template.addBehaviorField(downKey, "Key to bind vertical thrust", keybind, "keyboard down");
%template.addBehaviorField(rightKey, "Key to bind horizontal thrust", keybind, "keyboard right");
%template.addBehaviorField(leftKey, "Key to bind horizontal thrust", keybind, "keyboard left");
%template.addBehaviorField(horizontalThrust, "Horizontal Thrust force", float, 100.0);
%template.addBehaviorField(verticalThrust, "Vertical Thrust force", float, 100.0);
}
function Spacer3000Controls::onBehaviorAdd(%this)
{
if (!isObject(moveMap))
return;
%this.enableUpdateCallback();
moveMap.bindObj(getWord(%this.upKey, 0), getWord(%this.upKey, 1), "moveUp", %this);
moveMap.bindObj(getWord(%this.downKey, 0), getWord(%this.downKey, 1), "moveDown", %this);
moveMap.bindObj(getWord(%this.rightKey, 0), getWord(%this.rightKey, 1), "moveRight", %this);
moveMap.bindObj(getWord(%this.leftKey, 0), getWord(%this.leftKey, 1), "moveLeft", %this);
%this.up = 0;
%this.down = 0;
%this.right = 0;
%this.left = 0;
}
function Spacer3000Controls::onUpdate(%this)
{
%this.setLinearVelocityX((%this.right - %this.left) * %this.horizontalThrust);
%this.setLinearVelocityY((%this.down - %this.up) * %this.verticalThrust);
}
function Spacer3000Controls::moveUp(%this, %val)
{
%this.up = %val;
}
function Spacer3000Controls::moveDown(%this, %val)
{
%this.down = %val;
}
function Spacer3000Controls::moveLeft(%this, %val)
{
%this.left = %val;
}
function Spacer3000Controls::moveRight(%this, %val)
{
%this.right = %val;
}
#3
If that were true, there would be a .dso file and the behavior would be showing up.
Like I said - console.log will tell you where the error is.
11/09/2009 (1:37 pm)
Quote:it has no errors, is complied
If that were true, there would be a .dso file and the behavior would be showing up.
Quote:If there is an obvious error I would appreciate an elder jedi (TGB programmer) to point the error of my ways.
Like I said - console.log will tell you where the error is.
#4
ANyhow, no worries, just a bit frustrating when it seems legit to me. (ps. the files not compiling are the tank and thruster behaviors from TGB).
no worries. will keep you posted
11/09/2009 (1:47 pm)
there is a .dso file for the code provided.ANyhow, no worries, just a bit frustrating when it seems legit to me. (ps. the files not compiling are the tank and thruster behaviors from TGB).
no worries. will keep you posted
Torque 3D Owner Sherman Pendley