#!/usr/bin/perl
use lib '.';
require "pagelib.pl";
header();
head();

$dir = "images/brickfest2002";
if(!opendir(DIR,$dir)) {
    print "Internal error locating images!<br>\n";
}
@files = readdir(DIR);
foreach(@files) { push @images,$1 if(/(\w+\d+)\.jpg/); }
%used = ();

@other = (19,20,21,32,33,36,42,46,49,56,60,63,65,69,87,88,89,90,91,98,99,100,105,136,142,144,145,147,148,150);
@atats = (12,77,13,15,16,31,39,40,45,57,64,66,67,101,102,103,104,119,120,121,122,123,124,125,139,140,141,151,152);
@trench = (3,4,24,26,35,47,68,72,73,80,81,85,92,95,96,97,109,110,115,131,132,143,153);
@inter = (7,8,9,10,27,28,29,43,44,50,51,58,59,70,83,84,93,94,111,112,134,135);
@overall = (1,11,14,18,30,53,55,61,62,82,86,106,114,126,137,138,146,149);
@snowspeeders = (2,38,41,54,78,79,108,118,129,130);
@troops = (5,23,34,52,74,75,76,116);
@atst = (22,107,117,127,128);
@cremesicle = (48,71,133);
@generator = (6,25,113);
@probe = (37);
@snowman = (17);

print "<br>\n";
tabs();
if($params{page} eq "AT-ATs") {
    print qq`
<br>
Of course the inspiration for the entire display was the AT-AT\'s. Their first appearance
together was at the MIT MindFest in 1999, when <a href=\"atat.cgi\">my AT-AT</a> was quite
different \(<a href=\"http://www.brickshelf.com/cgi-bin/gallery.cgi?f=2274\">Shaun\'s</a>
has remained very similar to this day.\) At the time, I had wanted to go with a Hoth-themed
layout, but was overruled, going with an Endor foresty type layout instead. So, determined
to have my way, I turned the tables on that tree-hugger, Shaun, and forced us into creating
the epic Hoth battle scene I so desperately wanted.<br>
<br>
\(Notice that AT-AT\'s are faster than you think! Walking in formation too slowly spelled
doom for one unfortunate stormtrooper!\)
<br><br>
`;
    show_images(@atats);
    
} elsif($params{page} eq "Base") {
    print qq`<br>
The exterior trench is really what made this a difficult landscape to build. In order to
have the trench \"dug in\" to the snow, the remaining snow field\'s ground level had to be
raised <b>up</b>. While this was quite brick-spensive, I\'m rather pleased with the outcome.<br>
<br>
95\% of the trench\'s details were built by myself. However, I again asked for Shaun\'s aid in coming
up with a white Rebel Turret design \(each turning out to be quite costly in white tiles, I might
add!\). Another problem was the fact that the Snowspeeder was quite a popular set. So popular
that by the time I wanted to bulk up my Rebel snow troops to fill out the trench, stores no longer
had Snowspeeder sets remaining. As a result, extra Rebel troops were lent to the display by
<a href=\"http://www.nelug.org\">NELUG</a> members Joe Comeau and Jamie Berard. Thanks guys!
<br><br>
`;
    show_images(@trench);
    print qq`
<br>
The base\'s interior was built according to the set designs for the Empire Strikes Back. I
constructed <a href=\"echobase.cgi\">the Rebel Base</a> about 8 months on and off prior to the
event, using up most of my regular bricks. You can see inside the hangar my <a href=\"xwing.cgi\">X-wing</a>
and <a href=\"snowspeeder.cgi\">Snowspeeder</a> models, both grey to help them stand out against
their overwhelmingly white background setting. And those hangar doors? Do they close? Well, once
upon a time they did \(we got an mpeg video to prove it! ... somewhere). However, after riding in
my car on a 10 hour journey, and being transported back and forth, the doors became jostled enough
to remain fixed in place for the show.
<br><br>
`;
    show_images(@inter);

} elsif($params{page} eq "Snow-Field") {
    print qq`
Snowspeeders were crucial in the making of the scene. Unsatisfied with Lego\'s version
of the model, both Shaun and I stumbled upon an excellent
<a href=\"http://bruce.kus-numa.net/customs/snowspeeder.html\">Snowspeeder design by Bruce Lowell</a>.
We each came up with our own variations on the design, and came up with two Snowspeeders each. Two of
Shaun\'s \(both in white\) were put on the battlefield, while one of <a href=\"snowspeeder.cgi\">my Snowspeeders</a>
\(in grey\) sat in the base, the other one in the fray.<br><br>
`;
    show_images(@snowspeeders);
    print qq`
<br>Another terrific addition to the battle was <a href=\"http://www.brickshelf.com/cgi-bin/gallery.cgi?f=6509\">Shaun\'s AT-ST</a>.
The AT-ST shown here is actually the 2nd version Shaun created of the AT-ST, the previous version also
appearing alongside the AT-AT\'s in the 1999 MindFest display.
<br><br>`;
    show_images(@atst);
    print qq`
<br>Unfortunately, while we remained highly serious about the display, adhering to canon
wherever possible; during the course of the event at BrickFest some of the minifigs got
their own ideas.
<br><br>
`;
    show_images(@cremesicle,@snowman);
    print qq`
<br>A rather last-minute addition to the layout was the power generator I built. I sadly didn\'t
quite have room for it to sit as it \"should\" on the layout, so it was tagged alongside the
layout where there was barely enough room for it to sit. \(Actually, the AT-AT\'s most likely
didn\'t even approach the side of the Rebel Base with the hangar bay, I just thought it made for
the most interesting as a visual model. Shame on me.\)
<br><br>
`;
    show_images(@generator);
    print qq`
<br>The 80-or-so troops \(and a Probe Droid by Shaun\) really made for a rather intimidating
effect on the rebels in the trenches. For all of us involved, it was the largest swath of Imperial
Troops we had seen, and was impressive in its own right. But that wasn\'t enough. On the final day
of the event, we were paid a visit by the legendary BLASTERMAN of <a href=\"http://www.fbtb.net/\">FBTB</a>
fame. Jeff generously donated enough of his
<a href=\"http://www.fbtb.net/jeff/jefforder.asp\">custom made Imperial weapons</a> to outfit all
of our troops. These added the wonderful effect of intimidation by inceneration to the rebels instead
of the intimidation of having one\'s eardrums bursting that we had otherwise with our megaphone-armed
battilion of Imperial soldiers. Thanks Jeff!
<br><br>
`;
    show_images(@probe,@troops);

} elsif($params{page} eq "Other-Shots") {
    print qq`
Here are a bunch of other images of the battle. Some of my favorites here include lots of
minifig eye-level shots, which \(I think\) really add to the impressiveness of the scene.<br><br>
`;
    show_images(@other);

} else {
    print qq`
<font size=+1><b>The Assault on Hoth</b></font><br>
<br>
Determined for my newest version of the <a href=\"atat.cgi\">AT-AT</a> to go out in a \"blaze of glory\" before its dismantling, I began my secret plans to create a re-enactment
of the battle on Hoth. But just 1 AT-AT would never do. So I enlisted the aid of
Shaun Sullivan, who had an <a href=\"http://www.brickshelf.com/cgi-bin/gallery.cgi?f=2274\">AT-AT of his own</a>,
<b>and</b>, as an added bonus, also had <a href=\"http://www.brickshelf.com/cgi-bin/gallery.cgi?f=6509\">his own AT-ST</a>.
<br><br>
With this in mind, I set about constructing a version of the <a href=\"echobase.cgi\">Rebel Base</a>
upon which to lay the scene, using up a whopping 24,000 bricks \(about\). Together with some other details,
the project was completed \(nearly\) in time for <a href=\"http://www.brickfest.com\">BrickFest 2002</a>,
where it made its debut. Combined with the AT-AT\'s, vehicles, troops, and scenery, this made for a display
consisting of roughly 40,000 bricks.<br>
<br>
However, dissapointed with my lack of good pictures from the event, I enlisted more help from several willing
photographers who took pictures of the event, and collected over 150 images seen here. Special
thanks go to Troy Cefaratti, Abe Friedman, Constantine Hannaher, Paul Hartzog, Michael Huffman,
Jake McKee, Joe Meno, Shaun Sullivan, and Calum Tsang, who all let me use their images! \(Note: some
images have been modified in an attempt to remove discoloration, darkness, etc.\)
`;
    show_images(@overall);
    
    print qq`
`;

}
foot();

sub tabs {
    my($page) = $params{page} || 'Overall';
    print "<table border=1 width=100\%><tr>\n";
    foreach('Overall','AT-ATs','Base','Snow-Field','Other-Shots') {
	print "<td align=center>";
	print (($page ne $_) ? "<a href=\"hoth_brickfest.cgi?page=$_\">$_</a>" : "<b>$_</b>");
	print "</td>\n";
    }
    print "</tr></table><br><br>\n";
}

sub show_images {
    my(@pics) = @_;
    my($i) = 0;
    my($p);
    print "<table width=100\%><tr>\n";
    foreach $p (@pics) {
	$_ = $p;
	$_ = "0$_" while(length $_ < 3);
	$_ = "hoth_brickfest_$_";
	next if($used{$_});
	$used{$_} = 1;
	if(!($i++%4)) {
	    print "</tr>\n<tr>\n";
	}
	print "<td align=center><a href=\"$dir/$_.jpg\"><img src=\"$dir/$_\_th.jpg\" border=0></a></td>\n";
    }
    print "</tr></table>\n";
}
