Author Topic: How does ObjectView.mountObject() work?  (Read 1308 times)

Could someone help me figure out how ObjectView.mountObject() work?
This is for a avatar preview in a GUI, I am trying to mount a hat on that Avatar.

From a avatar_preview.dump(); it gave me: ObjectView.mountObject(name,model,skin,parentName,nodeName,lod)

What is each one?

Whatever I try to put in there has given me
Code: [Select]
Error: Unable to load:
Thanks
« Last Edit: June 14, 2012, 12:24:36 AM by Munkey »

Code: [Select]
new GuiObjectView(avatarPreview);

function loadAvatar()
{
avatarPreview.forceFOV = 18;
avatarPreview.setOrbitDist(6);
avatarPreview.lightDirection = "0 0.2 0.2";

avatarPreview.setObject("","base/data/shapes/player/m.dts","",100);
avatarPreview.unHideNode("","scoutHat");
avatarPreview.setNodeColor("","scoutHat","1 0 0 1");
avatarPreview.setIFLFrame("", "face", "Add-Ons/Face_Default/memeDesu.png");
avatarPreview.setIFLFrame("", "decal", "Add-Ons/Decal_Default/Space-New.png");
}

That should pretty much explain how to use those to you.

Code: [Select]
new GuiObjectView(avatarPreview);

function loadAvatar()
{
avatarPreview.forceFOV = 18;
avatarPreview.setOrbitDist(6);
avatarPreview.lightDirection = "0 0.2 0.2";

avatarPreview.setObject("","base/data/shapes/player/m.dts","",100);
avatarPreview.unHideNode("","scoutHat");
avatarPreview.setNodeColor("","scoutHat","1 0 0 1");
avatarPreview.setIFLFrame("", "face", "Add-Ons/Face_Default/memeDesu.png");
avatarPreview.setIFLFrame("", "decal", "Add-Ons/Decal_Default/Space-New.png");
}

That should pretty much explain how to use those to you.

I don't see you describing mountObject anywhere.

I don't see you describing mountObject anywhere.

Most helpful reply 2012.

I don't see you describing mountObject anywhere.
Okay he didn't spoonfeed, but he gave an indirect solution. I have never worked with GuiObjectViews, and going solely from the OP and Slick's post:
ObjectView.mountObject("hat","file for hat","","","headSkin",100)

Because:
"hat" is just a name of the object
"file for hat" is something you have to fill in, it's the filepath to your hat.
the first "" is unneeded because retail uses node coloring.
the second "" is the player object's name
"headskin" was unclear to me, but I'm certain it's the node you're mounting to.
"100" is the level of detail.

Thanks guys! At the moment it is giving me the error of being unable to find the node "headskin" but that is much better than an empty error. I will mess around with this and see if I can figure it out.

EDIT: Well, according to this function headSkin is not a node. I tried a couple of numbers and they didn't work either. Anyone have an idea of what is a node?

DOUBLE EDIT: Actually, $headSlot worked, but now the player is gone and only the hat is there.
« Last Edit: June 14, 2012, 01:44:27 PM by Munkey »

Try showing all the player nodes after mounting the hat.

Try showing all the player nodes after mounting the hat.
Doing this gives me an error of it not being able to find the object to unhide the nodes. It appears it replaces the player object before or something?

Quote
1:23 PM - Mr. Wallet: for all I know, avatarpreview can only render one object at once and what you're trying to do is literally impossible

This would explain why it gets replaced by the hat, so I guess that it is impossible. Thanks for the help everyone, I guess I will just show previews of the hats.

I don't see you describing mountObject anywhere.
I didn't describe it because you don't need to use it to manipulate the model at all. I explained how to add a hat to a model, and I also gave usage examples of all the other functions in case they are needed.

He means mounting hat models that aren't part of the default player model.

oh, and another thing you might try doing:
ObjectView.dump();

might lead to some insight?

He already did that.

how the forget did i not see that the first time?


never mind me