Jump to content


Photo

Antiweidu.pl script


  • Please log in to reply
4 replies to this topic

#1 Malatar

Malatar
  • Member
  • 27 posts

Posted 12 January 2012 - 09:52 PM

A perl script I just bashed out that might be useful for some folks... I had an old megamod installation in one directory and no idea how I'd made it...

It takes a weidu.log of a BG2 installation and creates a batch file that you can run to create that same installation on a fresh BG2 setup if all the mods are extracted and ready to install. Some selections you'll still have to enter manually, like romance cheat letters in BG2 Tweaks, but it still freed up a lot of time on my various mega-mod testing. I love the BWP, but I don't always like the subcomponent choices in the .bat file and modifiying it takes a lot of time for me. (I sure miss the BWS!)

Just copy and paste after this


open(F,"weidu.log") || die ("Cannot open weidu.log file\n");
open(G,">antiweidu.bat") || die ("Cannot open antiweidu.bat output file\n");
$lastmod="";
while ($input=<F>) {
if ($input=~m/^\/\//) { next; } #Remove commented lines
@spline=split("~",$input);
if($spline[1]=~m/\w\/\w/) {
@spline2=split("/",$spline[1]);
$spline[1]=$spline2[1];
}

@spline2=split(/\/\//,$spline[2]);
$nums=$spline2[0];
@spline2=split(/\s+/,$nums);
$firstnum=$spline2[1];
$firstnum=~s/#//;
$secondnum=$spline2[2];
$secondnum=~s/#//;

@spline2=split(/\./,$spline[1]);
$modname=$spline2[0] . ".exe";
if($modname!~m/^setup-/i) {
$modname = "setup-" . $modname;
}


if ($modname ne $lastmod) {
print G $outputline , "\n";
$outputline = "$modname -- language $firstnum --skip-at-view --force-install-list $secondnum";
$lastmod=$modname;
} else {
#same mod name as last one so just append the new number
$outputline = $outputline . " $secondnum";
}
}
print G $outputline , "\n"; # Print out the very last mod
close(G);
close(F);

#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 13 January 2012 - 06:33 PM

If this works, this is pretty cool. Might want to upload and post it under Modding Tools.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 Azazello

Azazello

    The Anti-Spammer

  • Staff
  • 1914 posts

Posted 14 January 2012 - 02:45 AM

Can we see a sample of the output of the script? (No, I won't run it myself and see for myself...) I thought WeiDu already had a command structure to do this exact thing.

And...you can call your script whatever you like...but "Antiweidu" is rather, hmm, presumptuous.

In fact, I thought this was going to be a spam thread, based on the name.

"I gladly simp for jastey" -- Aza
==========================================================
"You ever notice that "What the hell?!" is the answer to just about everything?"
==========================================================

"Girls are like phones, they like to be held and talked too, but if you press the wrong button, you will be disconnected!" DJ Nikodemus
================================================================
Community Contributions
* Level 1 NPCs * gMinion: expanded TP2 for MegaInstalls * PSM (PSQM): expanded scripts for Melanthium * Shar Nadal (DSotSC-BGT) revision * non-detectable Cloak of Non-Detection ?? * Weimer's-Tactics: revised TP2 for MegaInstalls * a directory of Mega-Installation Guides *

   
   
   


#4 dabus

dabus
  • Member
  • 1982 posts

Posted 14 January 2012 - 02:47 AM

I'm pretty sure that the concept generally works, used it after I messed up my manual install about 3 years ago and didn't want to bother to read the whole PDF again. The only thing that's missing is putting files back into place (like some bcs/bam-files). I'm not sure how those "left out hotfixes" are harming the installation, but I guess they are needed - otherwise they wouldn't be in the batch-file, will they?

If I remind it correctly, some mods that tweak a lot of files are installed being "split" into a few segments, so it will not run out of memory. Although I did, it would still eat up about 800 Megs of my 1 GB and pretty much stall my system. Could be other issues like too much to do while doing its thing (CPU+HD-wise), but still a little concern.

Also be sure that the install-order is not changed if you want to reinstall a few months later. Otherwise some errors that may be fixed by putting mod X in before mod Y are still present for you.

Edited by dabus, 14 January 2012 - 02:48 AM.

THINK! - It's not illegal.

#5 Malatar

Malatar
  • Member
  • 27 posts

Posted 16 January 2012 - 10:20 AM

Here's an example of a weidu.log and the .bat file output the script produces. (Can't upload a .bat, so I renamed it to .txt)

Sorry if you didn't like the name, feel free to call it whatever you like. Mr. Weimer gave everyone an amazing tool in weidu, and I didn't mean to upset anyone. I'm a physicist, and I actually picture the name in my head as weidu.log^-1, but that's not a happy filename.

I found the script useful for setting up different "default" installs in the absence of Big World Setup, and I can recreate them later by just unpacking the new versions of mods into a clean install directory and running the batch file.

Attached Files