jastey Posted October 8, 2016 Share Posted October 8, 2016 Why doesn't this code add the area script to the area. I am using it for SoD, v.2.3.67.3 In the tp2, there is the definition of the function: /* DavidW's code for unifying the area script patching. */ DEFINE_ACTION_FUNCTION extend_area_script STR_VAR area="" top="" bottom="" BEGIN // find the area script from the area file COPY_EXISTING "%area%.are" override READ_ASCII 0x94 script BUT_ONLY // if it doesn't exist, give it a default name ACTION_IF "%script%" STRING_EQUAL "" BEGIN OUTER_INNER_PATCH_SAVE script "%area%" BEGIN REPLACE_TEXTUALLY "FW" "_AR" // TUTU naming conventions END END // extend the script ACTION_IF "%top%" STRING_COMPARE "" BEGIN EXTEND_TOP "%script%.bcs" "%top%" EVALUATE_BUFFER END ACTION_IF "%bottom%" STRING_COMPARE "" BEGIN EXTEND_BOTTOM "%script%.bcs" "%bottom%" EVALUATE_BUFFER END END And for patching the area and script, I use: LAF extend_area_script STR_VAR area="%BaldursGate_DocksLowLantern_D1%" top="bg1re/bartus/c#bart_ar0133.baf" END The file c#bart_ar0133.baf is existent. The installation gives no error messages. But the area script does not get patched to teh area AR0133. Can anyone tell me why? Link to comment
argent77 Posted October 8, 2016 Share Posted October 8, 2016 In unmodded BG1EE there is no area script assigned to AR0133.ARE. And the function "extend_area_script" doesn't appear to assign the script on its own.So you probably have to assign it manually, or expand DavidW's code like this: /* DavidW's code for unifying the area script patching. */ DEFINE_ACTION_FUNCTION extend_area_script STR_VAR area="" top="" bottom="" BEGIN // find the area script from the area file COPY_EXISTING "%area%.are" override READ_ASCII 0x94 script BUT_ONLY // if it doesn't exist, give it a default name ACTION_IF "%script%" STRING_EQUAL "" BEGIN OUTER_INNER_PATCH_SAVE script "%area%" BEGIN REPLACE_TEXTUALLY "FW" "_AR" // TUTU naming conventions END // added: assign area script if needed COPY_EXISTING "%area%.are" override WRITE_ASCIIE 0x94 ~%script%~ #8 END // extend the script ACTION_IF "%top%" STRING_COMPARE "" BEGIN EXTEND_TOP "%script%.bcs" "%top%" EVALUATE_BUFFER END ACTION_IF "%bottom%" STRING_COMPARE "" BEGIN EXTEND_BOTTOM "%script%.bcs" "%bottom%" EVALUATE_BUFFER END END Link to comment
jastey Posted October 9, 2016 Author Share Posted October 9, 2016 This solved the problem. Thank you! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.