Revised script to generate Imperial Era tree

This commit is contained in:
Miguel Zapico 2008-01-11 23:44:04 +00:00
parent 2162cf743e
commit 825d4fd638
4 changed files with 23 additions and 21 deletions

View file

@ -13,15 +13,15 @@
<p><a href="tree_race.html">Race</a></p>
<ul>
<li><a href='tree_dwarf.html'>Dwarves</a>
<li><a href='tree_frost elf.html'>Frost elves</a>
<li><a href='tree_elf.html'>Elves</a>
<li><a href='tree_goblin.html'>Goblins</a>
<li><a href='tree_issaelfr.html'>Frost elves</a>
<li><a href='tree_human.html'>Humans</a>
<li><a href='tree_lavinian.html'>Lavinians</a>&nbsp
<li><a href='tree_magni.html'>Magni</a>&nbsp
<li><a href='tree_marauder.html'>Marauders</a>&nbsp
<li><a href='tree_mechanical.html'>Mechanical</a>
<li><a href='tree_minuti.html'>Minuti</a>&nbsp
<li><a href='tree_nemidian.html'>Nemidians</a>&nbsp
<li><a href='tree_orc.html'>Orcs</a>
<li><a href='tree_shide.html'>Shide</a>
<li><a href='tree_sidhe.html'>Sidhe</a>
<li><a href='tree_undead.html'>Undead</a>
</ul>
</p>
@ -29,8 +29,8 @@
<ul>
<li><a href='tree_imper-arendians.html'>Arendians</a>&nbsp
<li><a href='tree_imper-cavernei.html'>Cavernei</a>&nbsp
<li><a href='tree_imper-frost_elves.html'>Frost elves</a>&nbsp
<li><a href='tree_imper-gentes_orcorum.html'>Gentes orcorum</a>&nbsp
<li><a href='tree_imper-issaelfr.html'>Frost elves</a>&nbsp
<li><a href='tree_imper-orcei_gladiatores.html'>Orcei Gladitores</a>&nbsp
<li><a href='tree_imper-lavinian_legion.html'>Lavinian legion</a>&nbsp
<li><a href='tree_imper-marauders.html'>Marauders</a>&nbsp
<li><a href='tree_imper-sidhe.html'>Shide</a>&nbsp

View file

@ -13,8 +13,8 @@
<p>
<a href='#arendians'>Arendians</a>&nbsp
<a href='#cavernei'>Cavernei</a>&nbsp
<a href='#frost_elves'>Frost elves</a>&nbsp
<a href='#gentes_orcorum'>Gentes orcorum</a>&nbsp
<a href='#issaelfr'>Frost elves</a>&nbsp
<a href='#orcei_gladiatores'>Orcei Gladitores</a>&nbsp
<a href='#lavinian_legion'>Lavinian legion</a>&nbsp
<a href='#marauders'>Marauders</a>&nbsp
<a href='#sidhe'>Shide</a>&nbsp

View file

@ -12,13 +12,14 @@
<p><a href="index.html">Back to start</a></p>
<p>
<a href='#dwarf'>Dwarves</a>&nbsp
<a href='#frost elf'>Frost Elves</a>&nbsp
<a href='#goblin'>Goblins</a>&nbsp
<a href='#issaelfr'>Frost Elves</a>&nbsp
<a href='#human'>Humans</a>&nbsp
<a href='#lavinian'>Lavinians</a>&nbsp
<a href='#magni'>Magni</a>&nbsp
<a href='#marauder'>Marauders</a>&nbsp
<a href='#mechanical'>Mechanical</a>&nbsp
<a href='#minuti'>Minuti</a>&nbsp
<a href='#nemidian'>Nemidians</a>&nbsp
<a href='#orc'>Orcs</a>&nbsp
<a href='#sidhe'>Sidhe</a>&nbsp
<a href='#undead'>Undead</a>&nbsp
</p>

View file

@ -30,9 +30,9 @@
my $html_gen = 1;
# This option will determine if the html files translations are generated, and it will create the folders
# based on the contents of the po folder of Wesnoth
my $translate = 1;
my $translate = 0;
# If translating, this option will try to use the source code instead of the compiled files
my $source = 1;
my $source = 0;
# If translating, and not from the source, remove the comment on the following line
#use Locale::Maketext::Gettext;
# This option will determine if the attack images are copied, and the images units are copied and colorized
@ -40,9 +40,9 @@ my $images = 1;
# This option will determine if the html report on made animations is generated
my $animations = 1;
# This is the version number that will appear on the unit trees
my $version = '1.3.13+svn';
my $version = '1.3.13';
# These option will try to process the user made Eras
my $ime = 0; # Imperial Era
my $ime = 1; # Imperial Era
my $exe = 0; # Extended Era
my $eom = 0; # Era of Myths
# If the script is run on Windows, set this option to 1
@ -115,7 +115,7 @@ close UNITS;
# Extended Era
if ($exe) {
$i=300; $version = 'x.31 (unstable)';
$i=300; $version = 'x.32 (unstable)';
($html, %unit_id, @adv, %spaces, %adv_from, %units, %units_id, %adv, %factions, %attacks, %att_id, %races) = ();
$unit_id{AdvanceTo} = 'AdvanceTo';
$link_back = '../';
@ -155,7 +155,7 @@ if ($exe) {
# Imperial Era
if ($ime) {
$i=600; $version = '0.16.5';
$i=600; $version = '0.17';
($html, %unit_id, @adv, %spaces, %adv_from, %units, %units_id, %adv, %factions, %attacks, %att_id, %races) = ();
$unit_id{AdvanceTo} = 'AdvanceTo';
$link_back = '';
@ -186,7 +186,7 @@ if ($ime) {
# Era of Myths
if ($eom) {
$i=900; $version = 'Beta 8';
$i=900; $version = 'Gamma 5';
($html, %unit_id, @adv, %spaces, %adv_from, %units, %units_id, %adv, %factions, %attacks, %att_id, %races) = ();
$unit_id{AdvanceTo} = 'AdvanceTo';
$link_back = '';
@ -390,6 +390,7 @@ sub ProcessUnit {
$unit{abilities} =~ s/\s$//; # Fix the extra space in the abilities
$unit{name} =~ s/^.+?"(.+)"$/$1/; # Fix the name
if ($unit{id}) {
$unit{image} =~ s/^"/"units\// unless $unit{image}=~/^"units/;
print UNITS "$i\t$unit{id}\t$unit{race}\t$unit{hitpoints}\t$unit{movement_type}\t$unit{movement}\t$unit{experience}";
print UNITS "\t$unit{level}\t$unit{alignment}\t$unit{image}\t$unit{cost}\t$unit{usage}\t$unit{abilities}\t$unit{name}\n";
$unit{image} = $unit{image2} if $unit{image2};
@ -436,7 +437,7 @@ sub GenerateTree {
if ($html_gen) {
my $era_file = shift;
print "Starting the generation of unit trees\n";
copy('units.css',"$html_dir/units.css");
copy('templates/units.css',"$html_dir/units.css");
# Load HTML templates
open (HTML, "templates/tree_header$era_file.html") or die "Couldn't open header: $!\n";
my @header = <HTML>;
@ -607,7 +608,7 @@ sub CopyImages {
my @stats = split /\t/;
(my $image = $stats[9]);
$image =~ s/"//g;
system ("$colorizer $data_dir/images/$image $html_dir/$unit_folder$image");
system ("$colorizer $data_dir/images/$image $html_dir/$unit_folder$image") unless (! -e "$data_dir/images/$image");
$image =~ s/.png/+female.png/;
system ("$colorizer $data_dir/images/$image $html_dir/$unit_folder$image") unless (! -e "$data_dir/images/$image");
}