Game Development Community

Loading a character preview in GUI Editor

by gamer · in Torque Game Engine · 03/23/2006 (6:08 pm) · 9 replies

Hi, I want to place a Character inside some container in GUI Editor, then be able to view him in a camera view(rotate,etc), how can this be done? This is a typical setup gui for lot of games, like picking your characters, changing his hair color, things like that.
thanks!

#1
03/23/2006 (6:25 pm)
It's a guiPlayerView or guiObjectView, personally I'd use the latter.
#2
03/23/2006 (6:31 pm)
I didn't see a guiObjectView.. anyway will start with guiPlayerView, thanks
#3
03/23/2006 (6:54 pm)
If you own the lighting kit I'd highly recommend this resource
Torque Lighting Kit - GuiObjectView

If you don't own the lighting kit
GuiObjectView Consolidated


The guiPlayerView works ok but lacks a lot of functionality that is included in the above resources.
#4
03/23/2006 (7:34 pm)
Looks good i will try them out, thanks
#5
03/24/2006 (11:33 am)
I went to the second resource
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9617
and downloaded guiobjectview.cc and guiobjectview.h recompiled it.
and there's a function GUIObjectView.setObject(name,model,skin,lod), but it's not in guiobjectview.h, why?
I found out about this function from the post and console. But from reading the header functions in guiobjectview.h, I can only find loadObject and loadDSQ, definitely not setObject(), searched its parent classes as well... what am I missing?
#6
03/24/2006 (12:19 pm)
It's a Console Method so its meant for the scripting system and not the C++ code so there's no C++ header for it and it's defined using the ConsoleMethod() Macro in GuiObjectView.cc.
#7
03/24/2006 (12:25 pm)
Where are the console methods defined? and also I loadDSQ(), then how would I play one of the animation(eg.wave) from one of these console methods? I played around with setSequence and a few others can't seem to get it working.

thanks
#8
03/24/2006 (12:36 pm)
Quote:
ConsoleMethod() Macro in GuiObjectView.cc.

About Line 42 in my version:

// Script function handling for "setObject"
ConsoleMethod( GuiObjectView, setObject, void, 6, 6, "ObjectView.setObject(name, model, skin, lod)" )
{
	argc;
	GuiObjectView* view = static_cast<GuiObjectView*>( object );
	view->loadObject(argv[2], argv[3], argv[4], "", dAtoi(argv[5]));
	view->setCamera();
}
#9
03/24/2006 (1:35 pm)
I tried
PlayerView.setObject("playerPreview", %model, "","");
PlayerView.loadDSQ("playerPreview", %anim);
PlayerView.setSequence("playerPreview","Root",1);
it works, how do I play other animations like Run. Do I need to define the sequence somewhere?


another question is:
how does ObjectView.add(obj1,...) work? is it for adding multiple objects to the view? If so, how do I instantiate an object from its models and animations?
thanks!