Posted by: icelus
« on: May 14, 2006, 12:23:30 PM »Works on Tutu! Hooray! Thanks, Mr. Sin.
COPY_EXISTING AR1008.ARE OVERRIDE
AR1009.ARE OVERRIDE
PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
/* Doesn't work!!!
PATCH_IF !("%SOURCE_RES%" STRING_COMPARE_CASE "AR1009") BEGIN
// Remove Dezkiel from AR1009 (he's now in AR1010)
READ_LONG 0x54 actOff
FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
READ_ASCII actOff + 0x80 char
PATCH_IF !("%char%" STRING_COMPARE_CASE "DEZKIE") BEGIN
WRITE_LONG actOff + 0x28 0x0 // Disable Dezkiel in AR1009
END
actOff += 0x110
END
END
*/
// Make default transitions autosave; enable travel to AR1010
READ_LONG 0x5c trigOff
FOR (READ_SHORT 0x5a numTrig; numTrig; numTrig -= 0x1) BEGIN
READ_SHORT trigOff + 0x20 type
PATCH_IF (type == 0x2) BEGIN
READ_ASCII trigOff + 0x38 destAre
PATCH_IF !(("%destAre%" STRING_COMPARE_CASE "AR1008") &&
("%destAre%" STRING_COMPARE_CASE "AR1009")) BEGIN
READ_BYTE trigOff + 0x60 flag
WRITE_BYTE trigOff + 0x60 flag | 0x4 // Add party-required flag
END
END
PATCH_IF !("%SOURCE_RES%" STRING_COMPARE_CASE "AR1009") BEGIN
READ_ASCII trigOff name
PATCH_IF !("%name%" STRING_COMPARE_CASE "DOOR1010") BEGIN
WRITE_ASCII trigOff + 0x38 AR1010 #8 // Set destination area to AR1010
END
END
trigOff += 0xc4
END
// Update number of entrances
READ_LONG 0x6c numEntr
WRITE_LONG 0x6c numEntr + 0x1
// Add exit points for travel from AR1008 and AR1009
READ_LONG 0x68 entrOff
entrOff += numEntr * 0x68 // Added as last entrance in file
INSERT_BYTES entrOff 0x68
WRITE_ASCII entrOff EXIT1010 // Entrance name
PATCH_IF !("%SOURCE_RES%" STRING_COMPARE_CASE "AR1008") BEGIN
WRITE_SHORT entrOff + 0x20 842 // Location X
WRITE_SHORT entrOff + 0x22 307 // Location Y
WRITE_LONG entrOff + 0x24 15 // Facing direction
END ELSE BEGIN // AR1009 patch
WRITE_SHORT entrOff + 0x20 697 // Location X
WRITE_SHORT entrOff + 0x22 259 // Location Y
END
READ_LONG 0x54 actOff
PATCH_IF (actOff > entrOff) BEGIN
WRITE_LONG 0x54 actOff + 0x68
END
READ_LONG 0x5c trigOff
PATCH_IF (trigOff > entrOff) BEGIN
WRITE_LONG 0x5c trigOff + 0x68
END
READ_LONG 0x60 sptOff
PATCH_IF (sptOff > entrOff) BEGIN
WRITE_LONG 0x60 sptOff + 0x68
END
READ_LONG 0x68 entrOff
PATCH_IF (entrOff > entrOff) BEGIN
WRITE_LONG 0x68 entrOff + 0x68
END
READ_LONG 0x70 contOff
PATCH_IF !(contOff < entrOff) BEGIN
WRITE_LONG 0x70 contOff + 0x68
END
READ_LONG 0x78 itmOff
PATCH_IF !(itmOff < entrOff) BEGIN
WRITE_LONG 0x78 itmOff + 0x68
END
READ_LONG 0x7c vertOff
PATCH_IF !(vertOff < entrOff) BEGIN
WRITE_LONG 0x7c vertOff + 0x68
END
READ_LONG 0x84 ambOff
PATCH_IF !(ambOff < entrOff) BEGIN
WRITE_LONG 0x84 ambOff + 0x68
END
READ_LONG 0x88 varOff
PATCH_IF !(varOff < entrOff) BEGIN
WRITE_LONG 0x88 varOff + 0x68
END
READ_LONG 0xa0 explOff
PATCH_IF !(explOff < entrOff) BEGIN
WRITE_LONG 0xa0 explOff + 0x68
END
READ_LONG 0xa8 doorOff
PATCH_IF !(doorOff < entrOff) BEGIN
WRITE_LONG 0xa8 doorOff + 0x68
END
READ_LONG 0xb0 animOff
PATCH_IF !(animOff < entrOff) BEGIN
WRITE_LONG 0xb0 animOff + 0x68
END
READ_LONG 0xb8 tobjOff
PATCH_IF !(tobjOff < entrOff) BEGIN
WRITE_LONG 0xb8 tobjOff + 0x68
END
READ_LONG 0xbc musOff
PATCH_IF !(musOff < entrOff) BEGIN
WRITE_LONG 0xbc musOff + 0x68
END
READ_LONG 0xc0 rspnOff
PATCH_IF !(rspnOff < entrOff) BEGIN
WRITE_LONG 0xc0 rspnOff + 0x68
END
READ_LONG 0xc4 mapnOff
READ_LONG 0xc8 numMapn
PATCH_IF (!(mapnOff < entrOff) && numMapn) BEGIN
WRITE_LONG 0xc4 mapnOff + 0x68
END
END
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING AR1009.ARE OVERRIDE
PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
// Remove Dezkiel from AR1009 (he's now in AR1010)
READ_LONG 0x54 actOff
deleteCount = 0x0
FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
READ_ASCII actOff + 0x80 char
PATCH_IF !("%char%" STRING_COMPARE_CASE "DEZKIE") BEGIN
DELETE_BYTES actOff 0x110 // You have been purged.
deleteCount += 0x1 // Have a nice day!
END ELSE actOff += 0x110
END
READ_SHORT 0x58 numAct
WRITE_SHORT 0x58 numAct - deleteCount
READ_LONG 0x54 actOff
PATCH_IF ((actOff > actOff) && deleteCount) BEGIN
WRITE_LONG 0x54 actOff - (deleteCount * 0x110)
END
READ_LONG 0x5c trigOff
PATCH_IF (!(trigOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x5c trigOff - (deleteCount * 0x110)
END
READ_LONG 0x60 sptOff
PATCH_IF (!(sptOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x60 sptOff - (deleteCount * 0x110)
END
READ_LONG 0x68 entrOff
PATCH_IF (!(entrOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x68 entrOff - (deleteCount * 0x110)
END
READ_LONG 0x70 contOff
PATCH_IF (!(contOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x70 contOff - (deleteCount * 0x110)
END
READ_LONG 0x78 itmOff
PATCH_IF (!(itmOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x78 itmOff - (deleteCount * 0x110)
END
READ_LONG 0x7c vertOff
PATCH_IF (!(vertOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x7c vertOff - (deleteCount * 0x110)
END
READ_LONG 0x84 ambOff
PATCH_IF (!(ambOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x84 ambOff - (deleteCount * 0x110)
END
READ_LONG 0x88 varOff
PATCH_IF (!(varOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0x88 varOff - (deleteCount * 0x110)
END
READ_LONG 0xa0 explOff
PATCH_IF (!(explOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xa0 explOff - (deleteCount * 0x110)
END
READ_LONG 0xa8 doorOff
PATCH_IF (!(doorOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xa8 doorOff - (deleteCount * 0x110)
END
READ_LONG 0xb0 animOff
PATCH_IF (!(animOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xb0 animOff - (deleteCount * 0x110)
END
READ_LONG 0xb8 tobjOff
PATCH_IF (!(tobjOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xb8 tobjOff - (deleteCount * 0x110)
END
READ_LONG 0xbc musOff
PATCH_IF (!(musOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xbc musOff - (deleteCount * 0x110)
END
READ_LONG 0xc0 rspnOff
PATCH_IF (!(rspnOff < actOff) && deleteCount) BEGIN
WRITE_LONG 0xc0 rspnOff - (deleteCount * 0x110)
END
READ_LONG 0xc4 mapnOff
READ_LONG 0xc8 numMapn
PATCH_IF (!(mapnOff < actOff) && numMapn && deleteCount) BEGIN
WRITE_LONG 0xc4 mapnOff - (deleteCount * 0x110)
END
END
BUT_ONLY_IF_IT_CHANGES
Oh. But he did show up, right in front of the door to AR1010. :(Fuck. Are you sure the resref is right? Did you ever check in BG1? If it doesn't work in BG2, it may not work in BG1, and I WILL LOOK LIKE A COMPLETE ASS.
Also, for Tutu, would it just be easier to make all the necessary changes to the FW1010.are file and copy it direct to the override? Tutu doesn't include it, so...That would work. The only problems should be the resrefs (screw Tutu), the TIS (screw IE), and possibly teh crash trying to load ambient WAVs from compressed BIFFs (screw Mark D.). You can SAY the rest spawn Strrefs.
Oh. But he did show up, right in front of the door to AR1010.
Also, for Tutu, would it just be easier to make all the necessary changes to the FW1010.are file and copy it direct to the override? Tutu doesn't include it, so...
Also, Dezkiel is indeed showing up in AR1009, at least he's listed as an actor in NI. :(He will be, but he shouldn't show up when the area is loaded (he should just get purged). I decided not to delete the actor struct for obscure reasons (compatibility).
I think I might know what the problem is--the actors. I don't think the RESREFs are present in BG2, so we need to convert them to the Tutu RESREFs...
(DEZKIE --> _DEZKIE, WOLWI --> _WOLFWI, BEARPO --> _BEARPO)
This is what DLTCEP spit out when I loaded the edited FW1010.are file:QuoteBad creature reference 'DEZKIE' in actor header #1 (DEZKIEL [1360.2362])
Bad creature reference 'WOLFWI' in actor header #2 (WINTER WOLF [2313.1590])
Bad creature reference 'WOLFWI' in actor header #3 (WINTER WOLF [2394.1690])
Bad creature reference 'WOLFWI' in actor header #4 (WINTER WOLF [1910.1092])
Bad creature reference 'WOLFWI' in actor header #5 (WINTER WOLF [2181.757])
Bad creature reference 'WOLFWI' in actor header #6 (WINTER WOLF [461.991])
Bad creature reference 'WOLFWI' in actor header #7 (WINTER WOLF [288.298])
Bad creature reference 'WOLFWI' in actor header #8 (WINTER WOLF [1309.704])
Bad creature reference 'WOLFWI' in actor header #9 (WINTER WOLF [1169.677])
Bad creature reference 'BEARPO' in actor header #10 (MOUNTAIN BEAR [1145.2126])
Bad creature reference 'BEARPO' in actor header #11 (MOUNTAIN BEAR [1525.2034])
Bad creature reference 'WOLFWI' in actor header #12 (WINTER WOLF [608.609])
Bad creature reference 'WOLFWI' in actor header #13 (WINTER WOLF [2077.466])
Invalid destination reference 'EXIT1010' for area 'AR1009' (causes crash) in active region #1 (DOOR1009 [926.21])
Missing ambient entry #1 in ambient #1 (CANDLEKEEP CATACOMBS 01 [320.320])
Ambient reference is 'AMB_N20A', ambient counter is 1
Missing ambient entry #1 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15A', ambient counter is 4
Missing ambient entry #2 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15B', ambient counter is 4
Missing ambient entry #3 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15C', ambient counter is 4
Missing ambient entry #4 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15D', ambient counter is 4
Missing ambient entry #1 in ambient #4 (GLOBAL HAUNTS 01 [1728.960])
Ambient reference is 'AMB_M35D', ambient counter is 2
Missing ambient entry #2 in ambient #4 (GLOBAL HAUNTS 01 [1728.960])
Ambient reference is 'AMB_M16X', ambient counter is 2
Bad creature reference 'DEZKIE' in actor header #1 (DEZKIEL [1360.2362])
Bad creature reference 'WOLFWI' in actor header #2 (WINTER WOLF [2313.1590])
Bad creature reference 'WOLFWI' in actor header #3 (WINTER WOLF [2394.1690])
Bad creature reference 'WOLFWI' in actor header #4 (WINTER WOLF [1910.1092])
Bad creature reference 'WOLFWI' in actor header #5 (WINTER WOLF [2181.757])
Bad creature reference 'WOLFWI' in actor header #6 (WINTER WOLF [461.991])
Bad creature reference 'WOLFWI' in actor header #7 (WINTER WOLF [288.298])
Bad creature reference 'WOLFWI' in actor header #8 (WINTER WOLF [1309.704])
Bad creature reference 'WOLFWI' in actor header #9 (WINTER WOLF [1169.677])
Bad creature reference 'BEARPO' in actor header #10 (MOUNTAIN BEAR [1145.2126])
Bad creature reference 'BEARPO' in actor header #11 (MOUNTAIN BEAR [1525.2034])
Bad creature reference 'WOLFWI' in actor header #12 (WINTER WOLF [608.609])
Bad creature reference 'WOLFWI' in actor header #13 (WINTER WOLF [2077.466])
Invalid destination reference 'EXIT1010' for area 'AR1009' (causes crash) in active region #1 (DOOR1009 [926.21])
Missing ambient entry #1 in ambient #1 (CANDLEKEEP CATACOMBS 01 [320.320])
Ambient reference is 'AMB_N20A', ambient counter is 1
Missing ambient entry #1 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15A', ambient counter is 4
Missing ambient entry #2 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15B', ambient counter is 4
Missing ambient entry #3 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15C', ambient counter is 4
Missing ambient entry #4 in ambient #2 (DRIPPING WATER 01 [320.320])
Ambient reference is 'AMB_E15D', ambient counter is 4
Missing ambient entry #1 in ambient #4 (GLOBAL HAUNTS 01 [1728.960])
Ambient reference is 'AMB_M35D', ambient counter is 2
Missing ambient entry #2 in ambient #4 (GLOBAL HAUNTS 01 [1728.960])
Ambient reference is 'AMB_M16X', ambient counter is 2