(Though no idea exactly when.
)
And since you say it requires ToB, Vlad's suggestion appears to be a shorter solution code-wise. (I haven't been thinking on its realisation though.) However, I appreciate a lot that you test my code, because it will confirm that it works. (This is universal code, which can be made working with BG1, SoA, ToB and can deal with any number of area links.)
I'll try to make it work tonight and will post back with results. 
/* ALL area links, including the ones FROM the new area as well as all links you want to add from other areas */
SET "my-northlink" = 0 // How many north links you'll add from your NEW area
SET "my-westlink" = 2 // How many west links you'll add from your NEW area
SET "my-southlink" = 2 // How many south links you'll add from your NEW area
SET "my-eastlink" = 2 // How many east links you'll add from your NEW area
SET "ext-northlink" = 2 // How many total north links you'll add from other EXISTING areas
SET "ext-westlink" = 1 // How many total west links you'll add from other EXISTING areas
SET "ext-southlink" = 2 // How many total south links you'll add from other EXISTING areas
SET "ext-eastlink" = 2 // How many total east links you'll add from other EXISTING areasWRITE_ASCII "%area-section-end%" ~AZ1000~ // Your area's filename
WRITE_ASCII "%area-section-end%" + 0x8 ~AZ1000~
WRITE_ASCII "%area-section-end%" + 0x10 ~AZ1000~
WRITE_LONG "%area-section-end%" + 0x34 10 // Icon index
WRITE_LONG "%area-section-end%" + 0x38 1292 // X coordinate on the worldmap
WRITE_LONG "%area-section-end%" + 0x3C 402 // Y coordinate on the worldmap
SAY "%area-section-end%" + 0x40 ~Kula~ // Worldmap caption of your areaPATCH_IF(
/* Specify the list of EXISTING areas you want links FROM */
// You can use the commented template below to include a new area. Substitute ARXXXX with the area filename.
/* ("%area-resref%" STRING_EQUAL "ARXXXX") OR */
("%area-resref%" STRING_EQUAL "AR0020") OR /* City Gates */
("%area-resref%" STRING_EQUAL "AR2000") /* Trademeet */)
BEGIN
...
ENDREAD_LONG ("%northlink-offset%" + 4) "north-count"
WRITE_LONG ("%northlink-offset%" + 4) ("%north-count%" + 1)
"north-position" = "%link-offset%" + 216 * ("%north-current%" + "%north-count%")
INNER_PATCH_SAVE str "%str%" BEGIN
FOR (j=8 * "%north-current%" + 2; j<=8*("%link-count%" - "%new-link-count%") + 6; j+=2) BEGIN
READ_SHORT j "temp"
WRITE_SHORT j ("%temp%" + 1)
END
END
"actual-north" = "%actual-north%" + 1// You can specify conditions if you want. Here we won't add west link from City Gates to the new area.
PATCH_IF !("%area-resref%" STRING_EQUAL "AR0020") BEGIN
READ_LONG ("%northlink-offset%" + 12) "west-count"
WRITE_LONG ("%northlink-offset%" + 12) ("%west-count%" + 1)
"west-position" = "%link-offset%" + 216 * ("%west-current%" + "%west-count%")
INNER_PATCH_SAVE str "%str%" BEGIN
FOR (j=8 * "%west-current%" + 8; j<=8*("%link-count%" - "%new-link-count%") + 6; j+=2) BEGIN
READ_SHORT j "temp"
WRITE_SHORT j ("%temp%" + 1)
END
END
"actual-west" = "%actual-west%" + 1
END ELSE "west-position" = 0
// This is where you specify the structure of inserted links that come from EXISTING areas to your new area
/* In this example, we only have City Gates and Trademeet */
PATCH_IF (("%area-resref%" STRING_EQUAL "AR0020") OR
("%area-resref%" STRING_EQUAL "AR2000"))
BEGIN
// Travel time factor. You don't need PATCH_IF if you use the same time multiplier for all areas.
PATCH_IF ("%area-resref%" STRING_EQUAL "AR2000") BEGIN
SET "travel" = 1 // Journey (or a trip?) takes 4 hours to Trademeet from your new area
END ELSE BEGIN
SET "travel" = 5 // Otherwise 20 hours
END
// North link
PATCH_IF ("north-position") BEGIN
INNER_PATCH "%str%" BEGIN READ_SHORT (8 * "%north-current%") "shift" END
SET "new-position" = "%north-position%" + (216 * shift)
INSERT_BYTES "%new-position%" 216
WRITE_LONG "%new-position%" ("%area-count%" - 1)
WRITE_ASCII ("%new-position%" + 4) ~ExitSE~ // Entrance in new area. Non-existing entrance causes the game to crash.
WRITE_LONG ("%new-position%"+ 0x24) travel // Travel time factor
WRITE_LONG ("%new-position%"+ 0x28) 4
/* WRITE_ASCII ("%new-position%"+ 0x2C) ~ARXXXX~ */ // Filename of random encounter area
/* WRITE_LONG ("%new-position%"+ 0x54) 50 */ // Probability of random encounter
"actual-north" = "%actual-north%" + 1
END
// East link
...
// South link
...
// West linkQuote from: Baronius on August 30, 2006, 02:39:26 AM
So the earliest chapter you can visit that area is the 6th. That time, the player will have visited most wilderness areas, so there is no reason to add links from all those areas I listed. Trademeet and City Gates should have a link to Kula, but it would be illogical to provide a direct path from every wilderness area, as the adventurers reach many areas by passing already explored places. To sum up, the player will still be able to visit Kula practically from any other area, while you won't have redundant code in your TP2.
Quote
Anything that needs to be changed on this?