Jump to content


[Weidu] How to make COPY_EXISTING (or whatever) copy some large TIS file to the Override folder


10 replies to this topic

#1 Constantine

  • Members
  • 118 posts
  • Gender:Male

Posted 02 August 2011 - 10:47 AM

How to make COPY_EXISTING copy some large TIS file to the Override folder? In other words, I need to extract some TIS from the biff file to the override and rename it according to my new area file name. Why? Because it makes a huge difference then you download 1 MB or 51 MB mod package thanks to the large TIS file that already exists in the game.
I've found some old discussion on the forum about using COPY_LARGE or some similarly useless advice. Now, is there a working solution?

#2 lynx

  • Modders
  • 1713 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 02 August 2011 - 11:30 AM

Sounds like a wiedu bug (odd limit) or feature request (no COPY_EXISTING_LARGE). For the time being you could extract/delete the file with a manual weidu call in some preparation scripts (like those usually used for music conversion).
GemRB - IE anywhere.
Mages needed! Python tamers needed for iwd2!

#3 the bigg

    The Avatar of F/Ts

  • Modders
  • 2316 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 02 August 2011 - 11:42 AM

You could simply write the old tis name in the wed file.
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#4 Constantine

  • Members
  • 118 posts
  • Gender:Male

Posted 02 August 2011 - 10:33 PM

View Postlynx, on Aug 2 2011, 11:30 PM, said:

Sounds like a wiedu bug (odd limit) or feature request (no COPY_EXISTING_LARGE). For the time being you could extract/delete the file with a manual weidu call in some preparation scripts (like those usually used for music conversion).
I fear this is the only solution so far. Thanks.

View Postthe bigg, on Aug 2 2011, 11:42 PM, said:

You could simply write the old tis name in the wed file.
Yes I tried this but the fact is that either biff containing the TIS file should be uncompressed to the cache/data folder (something you cannot rely upon) or TIS itself should be in the override for this solution to work.

#5 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 03 August 2011 - 09:55 AM

View PostConstantine, on Aug 3 2011, 02:33 AM, said:

Yes I tried this but the fact is that either biff containing the TIS file should be uncompressed to the cache/data folder (something you cannot rely upon) or TIS itself should be in the override for this solution to work.
Right, the game will crash if the referenced resource (like a .tis or .wav) is in a different compressed biff than the .are/.wed files. However, there should be an undocumented DECOMPRESS_BIFF command to work around this - at least, I don't see it in the WeiDU documentation I have but I could've sworn it was put in several WeiDUs ago (see here).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#6 Constantine

  • Members
  • 118 posts
  • Gender:Male

Posted 03 August 2011 - 10:54 AM

View PostMiloch, on Aug 3 2011, 09:55 PM, said:

Right, the game will crash if the referenced resource (like a .tis or .wav) is in a different compressed biff than the .are/.wed files. However, there should be an undocumented DECOMPRESS_BIFF command to work around this - at least, I don't see it in the WeiDU documentation I have but I could've sworn it was put in several WeiDUs ago (see here).
Well, yes, the DECOMPRESS_BIFF command decompressed the biffc, BUT to do so, I needed to manually copy it to the destination folder, it appears it can't be found automatically. Besides that, the uncompressed bif should be in the cache/data folder, not the data folder, otherwise the game crashes. And the cache as I understand can be flushed at any time.

#7 the bigg

    The Avatar of F/Ts

  • Modders
  • 2316 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 03 August 2011 - 02:23 PM

DECOMPRESS_BIFF ~cd3/data/area110a.bif~ ~cd3/data/area140a.bif~ <etc>

This will backup the listed file(s) and overwrite them with an uncompressed copy. This is enough for me to prevent CBIF-related crashes.
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#8 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 03 August 2011 - 03:40 PM

View Postthe bigg, on Aug 3 2011, 06:23 PM, said:

DECOMPRESS_BIFF ~cd3/data/area110a.bif~ ~cd3/data/area140a.bif~ <etc>
I think that worked for me too. As an action (not a patch) it didn't need a separate COPY. If you don't know which .bif it's in or whether it's compressed, the related commands (FILE_IS_IN_COMPRESSED_BIFF, BIFF_IS_COMPRESSED, SOURCE_BIFF) should resolve that.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#9 Constantine

  • Members
  • 118 posts
  • Gender:Male

Posted 03 August 2011 - 10:56 PM

View PostMiloch, on Aug 4 2011, 03:40 AM, said:

View Postthe bigg, on Aug 3 2011, 06:23 PM, said:

DECOMPRESS_BIFF ~cd3/data/area110a.bif~ ~cd3/data/area140a.bif~ <etc>
I think that worked for me too. As an action (not a patch) it didn't need a separate COPY. If you don't know which .bif it's in or whether it's compressed, the related commands (FILE_IS_IN_COMPRESSED_BIFF, BIFF_IS_COMPRESSED, SOURCE_BIFF) should resolve that.
So you assuming area110a.bif is located in the cd3/data/ folder? Will DECOMPRESS_BIFF search for it in the path specified in the baldur.ini?
It's strange, I am sure I've placed the uncompressed bif to the data folder (not cache/data) and the game still crashed. Thanks anyway. I suppose it doesn't matter now, I've fixed the issue like lynx suggested in the second post.

#10 the bigg

    The Avatar of F/Ts

  • Modders
  • 2316 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 04 August 2011 - 11:42 AM

View PostConstantine, on Aug 4 2011, 08:56 AM, said:

So you assuming area110a.bif is located in the cd3/data/ folder? Will DECOMPRESS_BIFF search for it in the path specified in the baldur.ini?
It's strange, I am sure I've placed the uncompressed bif to the data folder (not cache/data) and the game still crashed. Thanks anyway. I suppose it doesn't matter now, I've fixed the issue like lynx suggested in the second post.
WeiDU knows how to look into baldur.ini to find it in another path; however, commands that operate on existing biffs need the full path to the file (as contained in chitin.key).
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#11 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 05 August 2011 - 10:44 PM

This will work. The code is unnecessary long though for a few reasons:
1) SOURCE_BIFF should return the CD# the data/*.bif is in (unless it's in the main data folder).
2) SOURCE_BIFF should be (or have at least) an action usage; it makes little sense as a patch since by principle, WeiDU can't patch humongous files like biffs.
3) There's a lot of ACTION_IF checks and PRINT messages in here that aren't strictly necessary (useful mainly for debugging or information).
ACTION_IF FILE_EXISTS_IN_GAME ~ar1101.tis~ BEGIN
  ACTION_IF NOT FILE_EXISTS ~override/ar1101.tis~ BEGIN
	PRINT ~No ar1101.tis in override, checking BIFF compression ...~
	OUTER_PATCH null BEGIN
	  SOURCE_BIFF sbif ~ar1101.tis~
	  TO_LOWER sbif
	END
	OUTER_TEXT_SPRINT bcd ~~
	ACTION_IF NOT FILE_EXISTS ~%sbif%~ BEGIN
	  ACTION_IF FILE_EXISTS ~cd2/%sbif%~ BEGIN
		OUTER_TEXT_SPRINT bcd ~cd2/~
	  END ELSE BEGIN
		ACTION_IF FILE_EXISTS ~cd3/%sbif%~ BEGIN
		  OUTER_TEXT_SPRINT bcd ~cd3/~
		END ELSE BEGIN
		  ACTION_IF FILE_EXISTS ~cd4/%sbif%~ BEGIN
			OUTER_TEXT_SPRINT bcd ~cd4/~
		  END ELSE BEGIN
			ACTION_IF FILE_EXISTS ~cd5/%sbif%~ BEGIN
			  OUTER_TEXT_SPRINT bcd ~cd5/~
			END
		  END
		END
	  END
	END
	ACTION_IF FILE_IS_IN_COMPRESSED_BIFF ~ar1101.tis~ BEGIN
	  PRINT ~Found ar1101.tis in compressed BIFF %bcd%%sbif%; decompressing ...~
	  DECOMPRESS_BIFF ~%bcd%%sbif%~
	END ELSE BEGIN
	  PRINT ~Found ar1101.tis in uncompressed BIFF %bcd%%sbif%; no action.~
	END
  END ELSE BEGIN
	PRINT ~Found ar1101.tis in override; no action.~
  END
END ELSE BEGIN
  PRINT ~No ar1101.tis in the game; check your filename.~
END
But anyway it beats using external OS-dependent script/batch files etc.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users