Making icons for bricks and bots has always been a hassle, and it always resulted in the icons from each person's set looking slightly off from the others. We have known about the existence of the /doIcon command, but didn't really understand how it worked until Rotondo gave us a clearer explanation today. This guide should be a slightly more comprehensive version of the mini-guide Rotondo posted.
Pre-Step: This must be done before you can create icons for bricks.
Create a folder named
iconShots in the root part of your Blockland directory.
My_Documents\Blockland\iconShots\
For best results, you should also have the resolution set to something that is 4:3 in ratio.
Step 1:
Optionally, you should download
this skybox which fixes the lighting so your icons are lit like the default pre-v21 ones.
Set up a server (singleplayer is fine) that has the brick/bot you want to make an icon of. It would probably be a good idea to set the skybox to white (Or enable the custom skybox, mentioned above) and make the ground completely transparent in the environment options. For best results, set your screen resolution to a 4:3 ratio (non-widescreen), you may have to disable fullscreen for these resolutions to show up.
Step 2:
Do the
/iconInit command, this will set up the environment and your camera for taking the picture. From this point, do not move the camera with your mouse or the ASWD keys.
Step 3:
A: For brick icons
/doIcon brickName
For brickName, you need to take the name for the brick's datablock and remove the "brick" and "data" parts from the name. For example, if I have a brick with it's datablock being named "Brick5x6fData", what I would put in as the brickName would be "5x6f".
B: For bot icons
First, you need to copy and paste this
function into the console (until an update fixes it) for bots to have color in your icon.
Then, you can do
/DoBotIcon brickData botData name
brickData is the name of the brick datablock. For example,
BrickBlockheadBot_HoleSpawnDatabotData is the playerData datablock you gave for the bot. For example,
BlockheadHoleBotname is whatever you call the bot. I'm pretty sure it can be anything.
Once you enter that command, you must take a screenshot manually.
Step 4:
A:
For bricks, you take the file out of the iconShots folder and use an image manipulation program to remove the background.
B:
For bots, you take the screenshot out of your screenshots folder and then use an image manipulation program to remove the background.
Step 5:
Use an image manipulation program to set the canvas of the image to 96x96 pixels. Resize the image as needed to fit on the 96x96 canvas. Ensure that it is centered on whatever you took a picture of, though.
Step 6: Put the icon into your brick/bot add-on and refer to it in the iconFile argument in the brick datablock. For example,
datablock fxDTSBrickData (BrickBlockheadBot_HoleSpawnDa ta)
{
brickFile = "Add-ons/Bot_Hole/4xSpawn.blb";
category = "Special";
subCategory = "Holes";
uiName = "Blockhead Hole";
iconName = "Add-Ons/Bot_Blockhead/icon_blockhead";
bricktype = 2;
cancover = 0;
orientationfix = 1;
indestructable = 1;
isBotHole = 1;
holeBot = "BlockheadHoleBot";
};
Now for a large block of code that you need for bot icons, ignore this if you're just doing brick icons or you don't need your bots to be colored.
First, copy the following into your clipboard. (Ctrl + c)
function serverCmdDoBotIcon( %client, %data )
{
if( !%client.isSuperAdmin )
return;
// make sure the dataBlock exists
if( !isObject( %data ) )
{
error( "Couldn't find" SPC %data );
return 0;
}
// clear old bot icon brick
if( isObject( $botIconBrick ) )
{
$botIconBrick.botHolder.delete();
$botIconBrick.botHolder = 0;
$botIconBrick.hBot.delete();
$botIconBrick.hBot = 0;
$botIconBrick.delete();
$botIconBrick = 0;
}
%pos = "0 10 -1005";
// should probably take into consideration the rotate adjust thing
%rot = "0 0 -1 90";
// create the bot brick
%brick = new fxDTSBrick()
{
position = %pos;
rotation = %rot;
dataBlock = %data;
angleId = 1;
colorId = 5;
colorFxId = 0;
shapeFxId = 0;
isPlanted = 1;
client = %client;
};
// remember the brick we made
$botIconBrick = %brick;
%error = %brick.plant();
%brick.setTrusted(1);
%client.brickGroup.add( %brick );
// make sure the brick is rendering
%brick.scheduleNoQuota( 1000, setRendering, 1 );
// set hBot type since we're doing this out of onplant
%brick.hBotType = %data.holeBot;
// create the static shape that will hold the bot in place, honestly I'm unsure why there are no collision meshes in icon mode
%static = new staticShape()
{
dataBlock = emptyBotHolderShape;
position = vectorAdd( %pos, "0 0 0.225" );
rotation = %rot;
};
missionCleanup.add( %static );
%brick.botHolder = %static;
// spawn the bot
%bot = %brick.spawnHoleBot();
%bot.updateArm(%bot.dataBlock.hWep);
%bot.setWeapon(%bot.dataBlock.hWep);
%bot.stopHoleLoop();
%static.mountObject( %bot, 0 );
return 1;
}
Then enter this into your Blockland console, do not copy and paste it.
eval(getclipboard());
This will fix the bot icon function temporarily, now you may scroll back up to read what you must do next for your icon.
Please post any issues you have with this guide, and I'll attempt to fix them.