Author Topic: Problem with 'face/decal' force-download  (Read 1185 times)

Code: [Select]
function downloadDecalPath(%path)
{
for(%file=findFirstFile("Add-Ons/" @ %path @ "/*.png");%file!$="";%file=findNextFile("Add-Ons/" @ %path @ "/*.png"))
{
%obj = datablock DecalData()
{
textureName = %file;
preload = true;
};
%obj.setName("BB_DecalDownload_" @ strReplace(strReplace(strReplace(%file,".png",""),"Add-Ons/",""),"/","_"));
}
}

downloadDecalPath("Face_BlockBastion");
downloadDecalPath("Decal_BlockBastion");

Decal_BlockBastion contains a "testFaec.png" face image file which is correctly sized and everything, but when I do the following, the client does not see the face:
clientGroup.getObject(1).setFaceName("testFaec");





Decal_BlockBastion contains a "testFaec.png" face image file which is correctly sized and everything, but when I do the following, the client does not see the face:
clientGroup.getObject(1).setFaceName("testFaec");

How many people are on your server at the time?
ClientGroup.getObject(1) gets the SECOND client connected.   Make sure thats what you want.   if you want the first and only client, use ClientGroup.getObject(0)

might be better to use something like this instead for testing:
findclientbyname(somebody).setFacename("testFaec");

I tried using both findclientbyname and getting the 2nd object in the clientGroup (2 players were in the server). But none work.

==>echo(isFunction("GameConnection","setFaceName"));
0
==>echo(isFunction("Player","setFaceName"));
1


The problem should have been pretty damn obvious when it threw an unknown command error.

I'm pretty sure decals and faces are now downloaded when you join a server...
Unless of course I have like 50 facepacks that are invisible.

I'm pretty sure decals and faces are now downloaded when you join a server...
Unless of course I have like 50 facepacks that are invisible.
Lol.

Actually,
Code: [Select]
if(isObject(%decal = nametoid("BB_DECAL_"@%this.bb_classui)))
    %this.player.setDecalName(%decal.getName());
Code: [Select]
datablock decalData(BB_DECAL_SCOUT)
{
   textureName = $BB::Path @ "decals/decal-scout";
   preload = true;
};

The decal is never displayed. (the top code is located in GameConnection::spawnPlayer)


I'm pretty sure decals and faces are now downloaded when you join a server...
Unless of course I have like 50 facepacks that are invisible.
I have this one face in my avatar edit menu that I can swear i never downloaded and I cannot find where it is from. I am sure even more people have this because I see about 1/3 of the server wearing it.

Blockland might not allow creation of datablocks from a function call. Does it work if you create the datablock normally, by putting it directly in the file?

If Blockland didn't allow creation of datablocks from function context, Team Deathmatch's spawn bricks would not work.