Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Warehouse 23 > Warehouse 23 Digital

Reply
 
Thread Tools Display Modes
Old 10-15-2009, 07:46 AM   #1
Jeffr0
 
Jeffr0's Avatar
 
Join Date: Mar 2005
Location: Harrisonburg VA
Default Comprehensive e23 Index

Brett requested a comprehensive index for the Spaceships series on another thread... and realizing that the PDF indexes would let you cut and paste to text files, I decided to write a short perl script to generate a comprehensive index. As this code would be useful for other PDF series as well, I'm posting it here.

Here is the code:

Code:
use strict;
use warnings;

my $previous;
my @stuff;

while (my $file = shift) {
    die "Need a proper file name" unless $file =~ /(\w+)/;
    my $f = $1;

    open FILE, "< $file"
        or die "Cannot find file $file: $file";
    
    while (my $line = <FILE>) {
        chomp($line);
        #print ":: $line\n";

        #do not insert a space into the line if the last
        #one ended with a dash
        $previous .= ' ' if $previous && $previous =~ /[^-]$/;
        $previous .= $line;

        #if the line ends in a period, insert book
        #references and remember that complete line
        if ($line =~ /\.$/){
            $previous =~ s/( \d)/ $f$1/g;
            $previous =~ s/\222/'/g;
            push (@stuff, $previous);
            #print "|" . $previous . "|\n";
            $previous = '';
        }
    }
}

foreach my $line (sort @stuff) {
    print "$line\n";
}
To produce an index with it, install perl on your box if necessary and create a folder for your text files. Put the above code into a textfile called indexer.pl. Name each text file with the book designator that you want to use. (Example: I.txt, II.txt, III.txt, IV.txt....) From a command line type "perl indexer.pl I.txt II.txt III.txt IV.txt V.txt" and it will print a comprehensive index. [Note, this example is written without shorthand because windows does not automatically glob filename arguments the way I think unix does and I did not yet want to waste time figuring out the correct cross plant-form user friendly approach to this issue, so my code just stupidly goes through the list of file names it receives as arguments.]

It seems to work pretty well. The only issue that I see is for cases where the same entry appears in more than one book. You would want to change those to be a single line with the line numbers concatenated together. Also... some may prefer not to have the volume designator with every single page number.

The next step would be for someone to take the text generated by this code and lay it out in a word processor... and maybe save it as a PDF for other people to use. But as that gets into copyright issues and so forth, I will leave that to others to worry about.

It took me an hour and a half to write this code and describe my solution here.

PS I am currently looking for work. I am an expert .Net platform database application developer with 8 years experience... and I enjoy tinkering with Perl on the side. Contact me via private messages here if you know of any opportunities that might be a good fit for me. I'd like to try working from home, perhaps, but I'm also willing to move. Thanks!
__________________
Jeffro's Space Gaming Blog
Microgames, Monster Games, and Role Playing Games
Jeffr0 is offline   Reply With Quote
Old 10-15-2009, 08:16 AM   #2
Jeffr0
 
Jeffr0's Avatar
 
Join Date: Mar 2005
Location: Harrisonburg VA
Default Re: Comprehensive e23 Index

Here is some sample output combining the indexes of Spaceships volume 1 to 5:

Code:
Target size and weapons, IV 35.
Tarot-class light carrier, IV 26.
Tasks, I 50-54; command, I 50-51; communication, I 53-54; damage control, I 54; engineering, I 51-52; gunnery, I 53; navigation, I 52; NPC, I 54; piloting, I 53; pre-battle, I 51; sensory, I 52-53.
Teleport projector, I 18.
Thor-class fleet carrier, IV 20.
Thrust rating (TR), III 24; calculating, III 25, III 29, III 33; gravity, III 33-34; using, III 28, III 29.
Thrust, fractional, III 28.
Thunderbird cargo lighters, II 19.
Tiger-class frigate, III 18.
Time dilation and travel, V 11.
Time spent on tasks, V 31.
Titan-class heavy space-transport vehicles, II 8.
Total energy conversion, I 20, I 23.
Towing, I 15, I 66; tractor beams, I 66.
Tractor and Graviton Beam Table, III 39.
Tractor beams in combat, III 33.
Trade, classifications, II 36; factories and, II 33; liner operations, II 34-35; slower-than-light interstellar, II 41; speculative, II 35-39; tramp spaceship operations, II 35; see also Cargo, Freight, Passengers, Spaceports.
Tramp freighter, I 6-7.
Tramp freighters, II 5-7.
Tramp spaceship operations, II 35, II 45.
Transfer orbits, V 8.
Transport fees, II 31.
Travel time, I 38-39.
Travel, I 36-38; distances, I 36; Solar System, I 37; transfer orbits, I 38.
Trinity-class heavy cruiser, III 12.
Tsunami-class strike cruiser, III 13.
Tungusku-class drop ship, IV 18.
__________________
Jeffro's Space Gaming Blog
Microgames, Monster Games, and Role Playing Games

Last edited by Jeffr0; 10-15-2009 at 08:20 AM.
Jeffr0 is offline   Reply With Quote
Old 10-15-2009, 08:45 AM   #3
Jeffr0
 
Jeffr0's Avatar
 
Join Date: Mar 2005
Location: Harrisonburg VA
Default Re: Comprehensive e23 Index

Here's an example index produced by combining Martial Arts ("MA"), Supers ("S"), and Psionic Powers ("PP"):

Code:
Wild Talent ability, PP 46, PP 80.
Wild Talent advantage, MA 49.
Wild advantages and disadvantages, S 22.
Wildcard powers, S 41.
Wildcard skills for styles, MA 60.
Wildcard skills, S 23, S 36-37, S 41, S 66, S 111; supporting cast and, S 66.
Wing Chun style, MA 20, MA 162, MA 203-204.
Wireless technique, PP 32.
Women in the martial arts, MA 20.
Wong Fei-Hung, MA 22.
Wong Kei-Ying, MA 22.
Working class supers, S 136.
World-shaking supers, S 14.
Wounds tables, MA 138-139.
Wrench (Limb) technique, MA 82, MA 116.
Wrench Spine technique, MA 82.
Wrenching Journey technique, PP 70.
(I had wanted to do something combining the core books of Basic Set and Powers with other key books, but not all sample files on e23 contain indexes.)
__________________
Jeffro's Space Gaming Blog
Microgames, Monster Games, and Role Playing Games
Jeffr0 is offline   Reply With Quote
Old 10-16-2009, 11:28 PM   #4
Vampire-X
 
Join Date: Apr 2007
Location: Omaha, NE
Default Re: Comprehensive e23 Index

Quote:
Originally Posted by Jeffr0 View Post
From a command line type "perl indexer.pl I.txt II.txt III.txt IV.txt V.txt" and it will print a comprehensive index. [Note, this example is written without shorthand because windows does not automatically glob filename arguments the way I think unix does and I did not yet want to waste time figuring out the correct cross plant-form user friendly approach to this issue, so my code just stupidly goes through the list of file names it receives as arguments.]
I am not sure if this is the solution to what you are talking about but I just created a index.bat file in the directory with my text files and put the command line in there.

Mine currently reads:
Code:
perl indexer.pl SS1.txt SS2.txt SS3.txt SS4.txt SS5.txt > Index.txt
That runs the script and puts the output in the file Index.txt. I did the bat file because I know I will forget the command line and this way I can just edit it when I do a new index.
__________________
Lee
Vampire-X is offline   Reply With Quote
Reply

Tags
index

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:56 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.