Jump to content


Photo

REPLACE_BCS_BLOCK


  • Please log in to reply
10 replies to this topic

#1 Topaz

Topaz
  • Member
  • 24 posts

Posted 15 February 2004 - 12:35 PM

I want to change some blocks in  vamemi01.bcs. Those blocks are only present in the bcs file added by tactics, not in the biff bcs. If the player has not installed this vamemi01.bcs trough tactics, I just want to copy over the whole bcs file. (Yay! stay true too the weidu philosophy)

How do I 'introduce' the

COPY_EXISTING ~vamemi01.bcs~ ~override/vamemi01.bcs~
REPLACE_BCS_BLOCK ~take.baf~ ~replace.baf~ command

to make sure the file needed to be patched is in the override?

I know of REQUIRE_FILE ~override/file~, but this will end the install if the file ain't there.

So is there something like HAVE_FILE ?

Also since COPY_EXISTING copies from the biff, I guess it is a bit stupid to copy it to the override, especially if the file you want has been placed in the override by a previous mod. Then weidu will give an error since the blocks aren't in the COPY_EXISTING bcs. Is that true?
(most of the info about this came from http://www.shsforums.net/index.p...lace_bcs_block)

#2 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 15 February 2004 - 01:35 PM

COPY ~mymod\myscript.bcs~ ~override~
UNLESS ~tactics.bcs~

COPY_EXISTING ~script.bcs~ ~override~
REPLACE_BCS_BLOCK ~replace.bcs~ ~script.bcs~
IF ~tactics.bcs~
Home of Kitanya, Improved Asylum, more...

Posted Image

#3 Topaz

Topaz
  • Member
  • 24 posts

Posted 15 February 2004 - 04:48 PM

Must...refrain...from asking... trivial stuff (and make it bombastic :)).

(hehe tactics.bcs doesn't exist)

The REAL problem is that vamemi01.bcs is in the tougher vampire part, and that 's optional. So it isn't 100% sure it'll work via IF ~some other file~, I presume.

#4 Idobek

Idobek

    Pocket Plane Gibberling

  • Member
  • 429 posts

Posted 17 February 2004 - 03:35 PM

Look at IF_SIZE_IS or ACTION_IF FILE_SIZE.

#5 MagusWizardo

MagusWizardo

    Don't ask... please don't ask.

  • Member
  • 201 posts

Posted 25 February 2004 - 02:27 AM

Or, ofcourse, ACTION_IF FILE_EXISTS .

#6 Topaz

Topaz
  • Member
  • 24 posts

Posted 25 February 2004 - 03:54 PM

Thanks for the posts on this small matter.

I've did it like this:

ACTION_IF NOT FILE_EXISTS ~override/vamemi01.bcs~
OR ( FILE_SIZE ~override/vamemi01.bcs~ 509 )
THEN BEGIN
COPY ~garl/baf/vamemi01.bcs~ ~override~
END

ACTION_IF FILE_EXISTS ~override/vamemi01.bcs~
AND ( FILE_SIZE ~override/vamemi01.bcs~ => 27001 )
THEN BEGIN
COPY_EXISTING ~vamemi01.bcs~ ~override/vamemi01.bcs~
REPLACE_BCS_BLOCK ~garl/baf/take.baf~ ~garl/baf/rep.baf~
END

For this syntax I got inspired by tactics.tp2. When installing it, weidu says that '=' is near the text. Where do I put '=>'?

Is this a correct use of values? Yeah so I think hmm FILE_SIZE ~override/vamemi01.bcs~ gives a number that can be compared with my specified value. The weidu readme however says that 'Offsets are values'. Can values and their multiplication etc. only be used in a offset context?

#7 Topaz

Topaz
  • Member
  • 24 posts

Posted 09 March 2004 - 01:47 AM

People your research period has ended! :D Can someone please tell me what to do with these equations? thx

#8 Idobek

Idobek

    Pocket Plane Gibberling

  • Member
  • 429 posts

Posted 09 March 2004 - 02:34 AM

I don't think FILE_SIZE takes '=' or '>' or any value expressions. Another way to go might be to look for a variable specific to Tactics in vamemi01.bcs, 'xyxInitialized' will probably do the job. Try this:
COPY_EXISTING ~vamemi01.bcs~ ~override/vamemi01.bcs~

   ACTION_IF NOT FILE_CONTAINS ~override/vamemi01.bcs~ ~xyxInitialized~

   THEN BEGIN

      COPY ~garl/baf/vamemi01.bcs~ ~override~

   END

   ACTION_IF FILE_CONTAINS ~override/vamemi01.bcs~ ~xyxInitialized~

   THEN BEGIN

      REPLACE_BCS_BLOCK ~garl/baf/take.baf~ ~garl/baf/rep.baf~

   END


#9 -topaz-

-topaz-
  • Guest

Posted 09 March 2004 - 02:54 AM

Whaat? You can use variables in tp2's? That is very good news indeed, and makes it pretty straightforward. Tonite i'll try it out. Thank you very much.

#10 FredSRichardson

FredSRichardson

    WeiDU Meddler

  • Member
  • 258 posts

Posted 09 March 2004 - 02:03 PM

Are you using the file size to make sure the file is the correct version? A somewhat better way to do this is using:

FILE_MD5 filename md5sum

In order to use this, you need the md5sum of the version of the file you expect to find. To get this, run the command with "md5sum" set to some bogus number like 0. Then check the log file for the md5sum value WeiDU finds for your file (it's prints this out).
I gotta get rid of this friggin idiotic signature...

#11 Idobek

Idobek

    Pocket Plane Gibberling

  • Member
  • 429 posts

Posted 09 March 2004 - 02:06 PM

To get this, run the command with "md5sum" set to some bogus number like 0. Then check the log file for the md5sum value WeiDU finds for your file (it's prints this out).

Thanks Fred, I've been wondering how to find this.