Game Development Community

Problem with 3D Arrow Resource

by Donnie Hutson Jr · in Torque Game Engine · 04/02/2009 (9:27 pm) · 3 replies

Hey guys, I did everything like ya said and add the autoload stuff, replace $aimTarget = 0; in the server/game.cs file with
$aimTarget = Waypoint01; which is what I named the target I want the arrow to point to. In the console it says the arrow is loaded but I get
an error saying that there is unknown command setRotation????
Any Ideas as to what would cause this??? I have TGE 1.5.2
Thanks in advance for any help............

3d arrow resource http://www.garagegames.com/community/blogs/view/16675

I forgot, also even though it says its loading the arrow, it doesn't display at all on screen.......

Also could you explain what this means

direction.setObject("gb","mod/data/shapes/direction/arrow.dts","","");

What is "gb"???? The rest I know about.......

About the author

Army at 17, proud papa and husband of the most amazing woman I have ever met!! Electrical Engineer by trade, Computer geek by night. Still learning and loving every minute.


#1
04/04/2009 (1:13 am)
Double check that you've got a version of the GuiObjectView resource in place that has the setRotation method, setRotation wasn't added to all of them. And just so you know, the "gb" is simply a name.

EDIT: the resource worked fine for me in my test.
#2
04/04/2009 (9:28 pm)
Thanks Michael, You wouldn't by chance have the setRotation method in your guiObjectView.cc or .h would ya. Ive searched all over the forums for one that does to no aval yet. If you had the GuiObjectView.cc and GuiObjectView.h files for me to download that would be great too, or if you want too, you could send them via email to me.......Just let me know if you would......
#3
04/07/2009 (8:28 am)
For anyone else thats having this problem........

to get setRotation console method working first:

add this to guiobjectview.h before setCamera()

void setRotation( const F32 x, const F32 z ); // <- add this
void setCamera();

and at guiobjectview.cc add this before guiobjectview::setcamera

void GuiObjectView::setRotation( const F32 x, const F32 z )
{
mCameraRot.x = x;
mCameraRot.z = z;
}

and add this also so that the setrotation can be called from the script

// Script function handling for "setRotation"
ConsoleMethod( GuiObjectView, setRotation, void, 4, 4, "ObjectView.setRotation(x,z)" ) {
argc;
GuiObjectView* view = static_cast<GuiObjectView*>( object );
view->setRotation( dAtof(argv[2]), dAtof(argv[3]) );
}

just like that. hope it helps