Game Development Community

GuiObjectView Problems

by Aaron E · in Torque Game Engine · 05/16/2007 (10:13 am) · 4 replies

Hello All,

I've got a strange problem mounting objects to my players within a GuiObjectView control. My mounted objects seem to randomly decide where they want to mount to my player bodies during character selection. It's very strange and I have no clue how to fix it.

I've searched for references to the problem on the forums but didn't find any solutions. All I found was a similar issue and request for help in the discussion section of this resource . . .

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9617

Jason's question seems to have gone unaswered for over a year, so I'm posting this to a new thread.

The basic setup is this. I have a single guiObjectView control on my main screen. It is empty at startup. The players click one of three buttons to pick which player body they want to select (male human, realm orc, or space orc). Most of the time it works great -- once a button is selected, the model appears in the control, animated by a nice idle .DSQ, with the crossbow mounted in the correct spot. But other times, the crossbow gets placed in all kinds of wierd locations.

Each selector button has a basic script very similar to the following . . .

view.setempty();$pref::Player::Armor = "blue";armorpref.settext("blue");charview.setbitmap("common/ui/spaceorc.jpg");view.setObject("objectName", "starter.fps/data/shapes/player/blue.dts", "", 0);view.loadDSQ("objectName", "starter.fps/data/shapes/player/player_root.dsq");view.setSequence("objectName", "Root", 1);view.mountObject("weapon", "starter.fps/data/shapes/crossbow/weapon.dts", "", "objectName", "mount0", 0);

I've tried variations of the "objectName" references and mount points to solve the problem, but nothing has worked so far.

For anyone who wants to see this odd behaviour in action, check out the following video (in glorious xViD AVI) . . .

www.aaronellis.net/stuff/objectviewmount.avi

In the video, the guiObjectView control is on the left. I have a standard bitmap image of each body on the right, but feel free to ignore it.

If anyone has a solution to this problem, I would love to hear from you. Or if there is a forum post that I've missed which addresses this issue, maybe someone can point me in the right direction. At this point, I'll even take a better search string to plug into the ole GG Google box. :)

Thanks all.

#1
05/21/2007 (8:58 am)
Hi guys,

I'm just giving this the four-day bump.

Thanks.
#2
05/21/2007 (9:45 am)
Try getting rid of parentTrans.setPosition( subOffset ); inside void GuiObjectView::getObjectTransform( MatrixF *mat , S32 index) . had a similar problem during the re-write for tgea.
#3
05/21/2007 (10:18 am)
Kirk,

Sounds good. I'll give it a try. I'll post my results in a few minutes.

Thank you.
#4
05/21/2007 (10:30 am)
Ah. I owe you a ton of thank yous for that little trick. It seems to have worked perfectly.

Thanks again.