GuiObjectView's mountObject

Author Topic: GuiObjectView's mountObject  (Read 1434 times)

I'm trying to use the following function:
GuiObjectView::mountObject(%this, %name, %model, %skin, %parentName, %nodeName, %detailLevel)

This is what I'm doing as a test:
Code: [Select]
function objViewTest()
{
if(isObject(objViewTest))
objViewTest.delete();

%this = new GuiObjectView(objViewTest)
{
position = "600 200";
extent = "300 600";

lightColor = "1 1 1 1";
lightAmbient = "0.5 0.5 0.5 1";
lightDirection = "0 0.707 -0.707";
orbitDiststance = "2";
};

MainMenuGui.add(%this);
%this.createBlockhead(-1, 1);
  %this.schedule(0, "setOrbitDist", 5.5);
  %this.schedule(0, "setCameraRot", 0.22, 0.5, 2.8);

  %this.schedule(1500, "mountObject", "", "Add-Ons/Gamemode_Jailbreak/datablocks/hats/TV/TV.dts", "", "", "head", 100);
}

The createBlockhead function is from Blockland Glass, it just loads the object like this:
%this.setObject("", "base/data/shapes/player/m.dts", "", 100); and sets the avatar.

The last line of my test function is where mountObject gets used, I've tried entering nothing for %lod as well as 100. It's possible I'm just not using the correct %nodeName, but using things like "head" or "rfoot" crashes me. Everything else gives an error.

If you want to try this out just have Glass on your client and run this code at the main menu. I tried out a few different models but maybe someone else knows how to use this?

I believe the player model might need to be assigned a name with that first arg, and then use that name for the %parentName for the hat.

Try setting the first arg to the shape name, and the second arg to either "head" or $headslot

It seems like giving it a name just makes it crash? I wish this thing would give me errors instead of just quitting.