Author Topic: REPLACE_BCS_BLOCK  (Read 5055 times)

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
REPLACE_BCS_BLOCK
« on: September 30, 2004, 12:48:33 PM »
I have not used this command before.

I am looking at the WeiDU ReadMe:

Quote
REPLACE_BCS_BLOCK oldFile newFile

If the current file is a BCS file, the segment of it corresponding to oldFile is replaced with the contents of newFile. oldFile and newFile may be BCS or BAF files. If they are BAF files they will not get the benefit of AUTO_TRA.

So am I right in thinking I could do something like:

Code: [Select]
COPY_EXISTING ~ppjon.bcs~ ~override/ppjon.bcs~
DECOMPILE_BCS_TO_BAF
REPLACE_BCS_BLOCK ~mymod/a.baf~ ~mymod/b.baf~
COMPILE_BAF_TO_BCS

Where a.baf is this block of his script:

Code: [Select]
IF
Global("AsylumPlot","GLOBAL",54)
HPLT(Myself,20)
THEN
RESPONSE #100
DialogInterrupt(TRUE)
SetInterrupt(FALSE)
Unlock("Door11")
OpenDoor("Door11")
OpenDoor("Door01")
ForceSpell("ppdra2",WIZARD_TRUE_SIGHT)
Kill("ppnalj2")
Kill("ppaph2")
Kill("ppdra2")
Kill("ppwanev2")
Kill("pptiax2")
SetInterrupt(TRUE)
SetGlobal("AsylumPlot","GLOBAL",55)
StartDialogueNoSet(Player1)
END

And b.baf is:

Code: [Select]
IF
Global("AsylumPlot","GLOBAL",54)
HPLT(Myself,20)
THEN
RESPONSE #100
DialogInterrupt(TRUE)
SetInterrupt(FALSE)
Unlock("Door11")
OpenDoor("Door11")
OpenDoor("Door01")
ForceSpell("ppdra2",WIZARD_TRUE_SIGHT)
SetInterrupt(TRUE)
SetGlobal("AsylumPlot","GLOBAL",55)
StartDialogueNoSet(Player1)
END

Essentially, I want to stop everyone dying in the Asylum. :)
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 859
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: REPLACE_BCS_BLOCK
« Reply #1 on: September 30, 2004, 12:53:46 PM »
It'll work, though you don't need the DE/COMPILE commands. My one gripe about REPLACE_BCS_BLOCK is that it's too easy to not get a match. In this case since it's incrementing a variable, I would just use an EXTEND_TOP and add the contents of b.baf. This will ensure your block gets executed and not the existing one.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: REPLACE_BCS_BLOCK
« Reply #2 on: September 30, 2004, 12:58:28 PM »
I see. Well, let's see what happens. :)
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: REPLACE_BCS_BLOCK
« Reply #3 on: September 30, 2004, 12:59:32 PM »
I'd use (DE)COMPILE and REPLACE_TEXTUALLY to address only the lines you need changing. EXTEND_TOP with a similar block is messy, and while maybe not in this case, it's more prone to breaking other stuff.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: REPLACE_BCS_BLOCK
« Reply #4 on: September 30, 2004, 01:18:23 PM »
Can I blank out a line using REPLACE_TEXTUALLY, though, eg REPLACE_TEXTUALLY ~Kill("ppdra2")~ ~~ without messing up the script?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: REPLACE_BCS_BLOCK
« Reply #5 on: September 30, 2004, 01:29:49 PM »
If you for some reason cannot, you can always set some nonsense variable to 0 or something else equally harmless.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: REPLACE_BCS_BLOCK
« Reply #6 on: September 30, 2004, 07:27:14 PM »
I'll give it a go, then, and see whast WeiDU tells me in return.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #7 on: October 02, 2004, 04:02:32 AM »
umm... what is the point of COMPILE_BAF_TO_BCS? i just put
COMPILE ~override/awblah.baf~

and that always seems to work.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: REPLACE_BCS_BLOCK
« Reply #8 on: October 02, 2004, 05:26:47 AM »
The usage is completely different. COMPILE_BAF_TO_BCS is part of a patching sequence. For example:

COPY_EXISTING ~baldur.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~OnCreation()~ ~True()~
COMPILE_BAF_TO_BCS

This code would replace every occurance of "OnCreation()" in baldur.bcs with "True()". The logic is that WeiDU decompiles the script, you replace the line in the BAF source, then it's recompiled. This avoids having to use lots of nasty BCS code in the REPLACE_TEXTUALLY statement.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #9 on: October 02, 2004, 11:37:14 AM »
ah, that makes sense.
umm.... how would i add to baldur.bcs? would it be like this

DECOMPILE_BCS_TO_BAF ~override/baldur.bcs~
EXTEND_BOTTOM ~IF
Globlal(klfdjlkfdijd)
THEN
.........
COMPILE_BAF_TO_BCS

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: REPLACE_BCS_BLOCK
« Reply #10 on: October 02, 2004, 11:44:37 AM »
ah, that makes sense.
umm.... how would i add to baldur.bcs? would it be like this

DECOMPILE_BCS_TO_BAF ~override/baldur.bcs~
EXTEND_BOTTOM ~IF
Globlal(klfdjlkfdijd)
THEN
.........
COMPILE_BAF_TO_BCS

If all you want to do is ADD a new block to baldur.bcs then just slap your new block in a baf (say Foo.baf) and then:

EXTEND_BOTTOM ~baldur.bcs~ ~directory/foo.baf~

You only need to DECOMPILE_BSC_TO_BAF and vice-versa if you are doing clever tricks to replace stuff already in baldur.bcs
"You alone can make my song take flight..."

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #11 on: October 02, 2004, 11:46:38 AM »
thanks. i've been trying to figure out how to do this for a while now.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #12 on: October 02, 2004, 09:13:03 PM »
heh, it says i'm offline but i'm not. that's weird. anyways, wouldn't it need too look like this

EXTEND_BOTTOM ~override/baldur.bcs~ ~script/blah.baf~

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: REPLACE_BCS_BLOCK
« Reply #13 on: October 02, 2004, 09:23:02 PM »
heh, it says i'm offline but i'm not. that's weird. anyways, wouldn't it need too look like this

Look in your account settings.  Somewhere you clicked to hide your online presence.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #14 on: October 03, 2004, 01:42:36 AM »
oh yeah, didn't realize it would do that. i was just tired of seeing my name at the bottom of the screen. like i didn't know that i was online....

anyways, i used the extend_bottom and it seemed to work, but when i go in w/ dltcep the script isn't changed.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: REPLACE_BCS_BLOCK
« Reply #15 on: October 03, 2004, 02:02:55 AM »
DLTCEP may be pulling the original file from the .bif files.  How are you opening the file in the program?
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #16 on: October 03, 2004, 02:04:55 AM »
i click on load file on the bottom left of the script screen and select dplayer3.bcs

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: REPLACE_BCS_BLOCK
« Reply #17 on: October 03, 2004, 02:12:28 AM »
You'll probably need to press "Load external script" and browse for the file in your override folder.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #18 on: October 03, 2004, 02:14:25 AM »
argh. not too much work, but still, argh. alright. i'll check that now........

heh, it's not there.....

Offline Rastor

  • Planewalker
  • *****
  • Posts: 271
  • Author of the book, "Being a Jerk for Dummies"
    • RPG Dungeon
Re: REPLACE_BCS_BLOCK
« Reply #19 on: October 03, 2004, 01:38:34 PM »
Quote
EXTEND_BOTTOM ~override/baldur.bcs~ ~script/blah.baf~

Did you use that?  If so, then it won't work.  It needs to be EXTEND_BOTTOM ~baldur.bcs~ ~script/blah.baf~

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #20 on: October 03, 2004, 05:21:28 PM »
ahhh... that got it. what i actually did was this:

EXTEND_BOTTOM ~baldur.bcs~ ~blah.baf~

instead of

EXTEND_BOTTOM ~baldur.bcs~ ~blah/blah.baf~

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #21 on: October 12, 2004, 06:34:39 PM »
Andyr, did the REPLACE_TEXTUALLY ~Kill("ppdra2")~ ~~ work?

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: REPLACE_BCS_BLOCK
« Reply #22 on: October 13, 2004, 08:03:13 PM »
Didn't use it in the end, give it a shot. :)
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Awake

  • Enigma
  • Planewalker
  • *****
  • Posts: 56
  • Gender: Male
  • The Raven
    • Black Wyrm Lair Forums
Re: REPLACE_BCS_BLOCK
« Reply #23 on: October 13, 2004, 08:25:33 PM »
heh, none of it's working for me unfortunately. i tried a space in there though, it's not working. i guess i'll have to keep trying, i do need this to work, i think.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: REPLACE_BCS_BLOCK
« Reply #24 on: October 13, 2004, 08:42:26 PM »
You could just replace the next line with itself.

eg REPLACE TEXTUALLY
~a
b~

~c
b~

Or something.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: