Pocket Plane Group
Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Andyr on September 30, 2004, 12:48:33 PM
-
I have not used this command before.
I am looking at the WeiDU ReadMe:
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:
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:
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:
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. :)
-
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.
-
I see. Well, let's see what happens. :)
-
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.
-
Can I blank out a line using REPLACE_TEXTUALLY, though, eg REPLACE_TEXTUALLY ~Kill("ppdra2")~ ~~ without messing up the script?
-
If you for some reason cannot, you can always set some nonsense variable to 0 or something else equally harmless.
-
I'll give it a go, then, and see whast WeiDU tells me in return.
-
umm... what is the point of COMPILE_BAF_TO_BCS? i just put
COMPILE ~override/awblah.baf~
and that always seems to work.
-
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.
-
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
-
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
-
thanks. i've been trying to figure out how to do this for a while now.
-
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~
-
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.
-
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.
-
DLTCEP may be pulling the original file from the .bif files. How are you opening the file in the program?
-
i click on load file on the bottom left of the script screen and select dplayer3.bcs
-
You'll probably need to press "Load external script" and browse for the file in your override folder.
-
argh. not too much work, but still, argh. alright. i'll check that now........
heh, it's not there.....
-
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~
-
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~
-
Andyr, did the REPLACE_TEXTUALLY ~Kill("ppdra2")~ ~~ work?
-
Didn't use it in the end, give it a shot. :)
-
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.
-
You could just replace the next line with itself.
eg REPLACE TEXTUALLY
~a
b~
~c
b~
Or something.
-
actually, REPLACE_TEXTUALLY ~foo~ ~~ works. i just tested it. it gets rid of the line entirely and moves the END up a line. very nice