Borrowing code from City RPG's stats file, i'm trying to have the player's Blockhead appear on the main menu and layered above jes00's
wallpaper add-on, which, the GUI used for the wallpaper is called MM_Wallpaper, for reference
The problem is that the player model is stuck being layered below the wallpaper, which i can fix by typing
MainMenuGui.pushToBack(MM_BlockheadDisplay); into the console, but having that in my CS file doesn't work
Then the player model itself is just m.dts with no player prefs applied

But i don't know how to execute the code in a way that would fix it up and keep the model consistent with the player's settings like in the appearance menu
The GUI
new GuiObjectView(MM_BlockheadDisplay)
{
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 100";
extent = "800 800";
minExtent = "8 4";
enabled = "1";
visible = "1";
clipToParent = "1";
cameraZRot = "-7.5";
forceFOV = "35";
lightDirection = "0.125 0.5 0.25";
lightColor = "0.875 0.875 0.875 1";
ambientColor = "0.35 0.35 0.35 1";
};
client.cs
exec("./ui/MM_Blockhead.gui");
MainMenuGui.add(MM_BlockheadDisplay);
MainMenuGui.pushToBack(MM_BlockheadDisplay);
MainMenuGui.pushToBack(MM_AuthBar);
MM_BlockheadDisplay.setEmpty();
MM_BlockheadDisplay.dynamicObject = "MM_Blockhead_Object";
MM_BlockheadDisplay.setObject(MM_BlockheadDisplay.dynamicObject, "base/data/shapes/player/m.dts", "", 0);
function MM_Blockhead::adjustAvatar(%gui)
{
MM_BlockheadDisplay.setSequence(MM_BlockheadDisplay.dynamicObject, 0, "headup", 0);
MM_BlockheadDisplay.setOrbitDist(7.5);
MM_BlockheadDisplay.setCameraRot(0, 0, 3);
if(MM_BlockheadDisplay.parts > 0)
{
%gui.hideAllNodes();
%gui.adjustAvatarNodes();
%gui.adjustAvatarColors();
}
else
{
%gui.applyDefaultPrefs();
}
}
function MM_Blockhead::adjustAvatarColors(%gui)
{
if(MM_BlockheadDisplay.parts > 0)
{
MM_BlockheadDisplay.setNodeColor(MM_BlockheadDisplay.dynamicObject, "headskin", $pref::Avatar::HeadColor);
for(%i = 0; %i < MM_BlockheadDisplay.parts; %i++)
{
%color = MM_BlockheadDisplay.color[%i];
if(%color $= "skin")
{
%color = $pref::Avatar::HeadColor;
}
MM_BlockheadDisplay.setNodeColor(MM_BlockheadDisplay.dynamicObject, MM_BlockheadDisplay.part[%i], %color);
}
}
}
function MM_Blockhead::adjustAvatarNodes(%gui)
{
MM_BlockheadDisplay.unHideNode(MM_BlockheadDisplay.dynamicObject, "headskin");
if(MM_BlockheadDisplay.parts > 0)
{
for(%i = 0; %i < MM_BlockheadDisplay.parts; %i++)
{
MM_BlockheadDisplay.unHideNode(MM_BlockheadDisplay.dynamicObject, MM_BlockheadDisplay.part[%i]);
}
}
MM_BlockheadDisplay.setIflFrame(MM_BlockheadDisplay.dynamicObject, "face", getIflFrame("face", $Pref::Avatar::FaceName));
MM_BlockheadDisplay.setIflFrame(MM_BlockheadDisplay.dynamicObject, "decal", getIflFrame("decal", MM_BlockheadDisplay.decal));
}
function MM_Blockhead::applyDefaultPrefs(%gui)
{
%gui.hideAllNodes();
%nodeCount = 0;
%node[%nodeCount++] = "headSkin" TAB "1 1 0 1";
%node[%nodeCount++] = "chest" TAB "1 1 1 1";
%node[%nodeCount++] = "LArm" TAB "1 1 1 1";
%node[%nodeCount++] = "RArm" TAB "1 1 1 1";
%node[%nodeCount++] = "LHand" TAB "1 1 0 1";
%node[%nodeCount++] = "RHand" TAB "1 1 0 1";
%node[%nodeCount++] = "pants" TAB "0 0 0.8 1";
%node[%nodeCount++] = "LShoe" TAB "0.2 0.2 0.2 1";
%node[%nodeCount++] = "RShoe" TAB "0.2 0.2 0.2 1";
for(%i = 1; %i <= %nodeCount; %i++)
{
MM_BlockheadDisplay.unHideNode(MM_BlockheadDisplay.dynamicObject, getField(%node[%i], 0));
MM_BlockheadDisplay.setNodeColor(MM_BlockheadDisplay.dynamicObject, getField(%node[%i], 0), getField(%node[%i], 1));
}
MM_BlockheadDisplay.setIflFrame(MM_BlockheadDisplay.dynamicObject, "face", 0);
MM_BlockheadDisplay.setIflFrame(MM_BlockheadDisplay.dynamicObject, "decal", 0);
}
function MM_Blockhead::hideAllNodes(%gui)
{
%nodeCount = 0;
%node[%nodeCount++] = "plume";
%node[%nodeCount++] = "triPlume";
%node[%nodeCount++] = "septPlume";
%node[%nodeCount++] = "Visor";
%node[%nodeCount++] = "helmet";
%node[%nodeCount++] = "pointyHelmet";
%node[%nodeCount++] = "flareHelmet";
%node[%nodeCount++] = "scoutHat";
%node[%nodeCount++] = "bicorn";
%node[%nodeCount++] = "copHat";
%node[%nodeCount++] = "knitHat";
%node[%nodeCount++] = "chest";
%node[%nodeCount++] = "femchest";
%node[%nodeCount++] = "pants";
%node[%nodeCount++] = "skirtHip";
%node[%nodeCount++] = "armor";
%node[%nodeCount++] = "bucket";
%node[%nodeCount++] = "cape";
%node[%nodeCount++] = "pack";
%node[%nodeCount++] = "quiver";
%node[%nodeCount++] = "tank";
%node[%nodeCount++] = "epaulets";
%node[%nodeCount++] = "epauletsRankA";
%node[%nodeCount++] = "epauletsRankB";
%node[%nodeCount++] = "epauletsRankC";
%node[%nodeCount++] = "epauletsRankD";
%node[%nodeCount++] = "ShoulderPads";
%node[%nodeCount++] = "LArm";
%node[%nodeCount++] = "LArmSlim";
%node[%nodeCount++] = "LHand";
%node[%nodeCount++] = "LHook";
%node[%nodeCount++] = "RArm";
%node[%nodeCount++] = "RArmSlim";
%node[%nodeCount++] = "RHand";
%node[%nodeCount++] = "RHook";
%node[%nodeCount++] = "pants";
%node[%nodeCount++] = "skirtHip";
%node[%nodeCount++] = "LShoe";
%node[%nodeCount++] = "LPeg";
%node[%nodeCount++] = "RShoe";
%node[%nodeCount++] = "RPeg";
%node[%nodeCount++] = "SkirtTrimLeft";
%node[%nodeCount++] = "SkirtTrimRight";
%node[%nodeCount++] = "LSki";
%node[%nodeCount++] = "RSki";
for(%i = 1; %i <= %nodeCount; %i++)
{
MM_BlockheadDisplay.hideNode(MM_BlockheadDisplay.dynamicObject, %node[%i]);
}
}
function getIflFrame(%node, %name)
{
%file = "base/data/shapes/player/" @ %node @ ".ifl";
if(isFile(%file))
{
%name = stripTrailingSpaces(fileBase(%name));
if(%name !$= "")
{
%fo = new FileObject() {};
%fo.openForRead(%file);
%hasFound = false;
%lineNum = 0;
while(!%fo.isEOF())
{
%line = %fo.readLine();
%thisDecal = stripTrailingSpaces(fileBase(%line));
if(%thisDecal $= %name)
{
%hasFound = true;
break;
}
else
{
%lineNum++;
}
}
%fo.close();
%fo.delete();
if(%hasFound)
{
return %lineNum;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
else
{
echo("\c2getIflFrame(\"" @ %node @ "\", \"" @ %name @ "\") : You did not supply a proper IFL file name to read from.");
return 0;
}
}
Iban made a post explaining what those scripts do if you need that for reference
https://forum.blockland.us/index.php?topic=148190.msg3473367#msg3473367Also, the decals are broken, but that's because getIflFrame has the directory of
base/data/shapes/player/, but if the player is using any face or torso decal that isn't the base ones, the directory becomes
base/data/shapes/player/Add-Ons/Face_Default/smileyBlonde and
base/data/shapes/player/Add-Ons/Decal_Hoodie/Hoodie, which of course are not the correct directories for those decals
But i don't know how to fix that either