Author Topic: AR1010 restoration  (Read 23683 times)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: AR1010 restoration
« Reply #50 on: May 13, 2006, 10:42:31 PM »
OK, I manually made the edits to the ambients and the actors and stuff to the .are and copied it over to the override.  I was able to enter the area without any problems.  Unfortunately the exit to AR1008 isn't there, so I'll need to manually add that.

As for Dezkiel--yeah, he's showing up in AR1009 in both BG1 and Tutu, sorry.  :(

Getting to AR1010 works just fine in BG1, as does the exit.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: AR1010 restoration
« Reply #51 on: May 13, 2006, 11:40:25 PM »
You should just run the AR1010 patch on vanilla BG1, and then convert the result to Tutu (since all the structures should already be in place, you'd just update the resource references).

I'll fix Dezkiel tomorrow.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: AR1010 restoration
« Reply #52 on: May 14, 2006, 12:12:52 AM »
This business should now be fully finished. Give the updated patches a whirl; everything should go smoothly. Unless there's somehow more Dezkiel's than number of actors (impossible), the patch should never fail. The patch works correctly if Dezkiel doesn't exist in the target area (i.e., FotD is already installed).
Code: [Select]
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
« Last Edit: May 14, 2006, 12:14:58 AM by devSin »

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: AR1010 restoration
« Reply #53 on: May 14, 2006, 12:06:24 PM »
Works perfectly on BG1.  :)  Only one Dezkiel, all entrances functional, etc.

I'll start the conversion to Tutu now and test it, as well as get v2 out today to fix this and my horrible store bug.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: AR1010 restoration
« Reply #54 on: May 14, 2006, 12:23:30 PM »
Works on Tutu!  Hooray!  Thanks, Mr. Sin.  :)
<Moongaze> Luckily BWL has a very understanding and friendly admin.

 

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)?: