GUIDE - How to create icons for bricks and bots automatically.

Author Topic: GUIDE - How to create icons for bricks and bots automatically.  (Read 29062 times)


Jasa is a moderator?!?!??!?!?!!

no silly

Rotondo had requested that someone make this guide, and implied he would sticky it.


Jasa is a moderator?!?!??!?!?!!
he says he can look in fail bin


Holy stuff thank you.
Looks like you won't be needing me anymore!


...
* Masterlegodude crouches in a corner while crying

Looks like you won't be needing me anymore!


...
* Masterlegodude crouches in a corner while crying
Nah I'll probably still come to you for icons anyway.

Do Windows 7 has Clipboard?

Do Windows 7 has Clipboard?
Yes, pressing Control+C while having text selected will copy it to the clipboard.

Do this on the white sky before using /iconInit
What resolution should the icon shots be taken in?
Do it in a 4:3 screen resolution because the 1366x768 resolution I use cuts part of the brick off.

Where I put it in the script?

Code: [Select]
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;
}

Just copy that into your clipboard and enter eval(getclipboard()); into your console. This will make Blockland evaluate the entire function temporarily so you can do your icons.

Just copy that into your clipboard
the script as server.cs or what?

the script as server.cs or what?
No. Just copy it with ctrl+c. Entering eval(getclipboard()); essentially allows you to paste the code right into the game while it's running.