PATCH_IF (%patched% < 5) THEN BEGIN FOR(x=0; x<%count% - 1; x=x+1) BEGIN READ_2DA_ENTRY_FORMER ~#_script_table~ x 1 "old_script" READ_2DA_ENTRY_FORMER ~#_script_table~ x 2 "new_script" PATCH_IF (("%Override%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN SET patched = %patched% + 1 SPRINT "Override" "%new_script%" END PATCH_IF (("%Class%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN SET patched = %patched% + 1 SPRINT "Class" "%new_script%" END PATCH_IF (("%Race%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN SET patched = %patched% + 1 SPRINT "Race" "%new_script%" END PATCH_IF (("%General%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN SET patched = %patched% + 1 SPRINT "General" "%new_script%" END PATCH_IF (("%Default%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN SET patched = %patched% + 1 SPRINT "Default" "%new_script%" END PATCH_IF (%patched% > 4) THEN BEGIN SET x = %count% - 1 //if all slots accounted for, stop checks and move on to next CRE file END END
The loop header here should look like this:
FOR(x=0; x<%count%; x=x+1) BEGINotherwise the last line in BPSCRIPT.2DA will be skipped and last script will be left unchanged.
I also have a small request to whoever manages BP now.
This script block
// But these won't work with them, so they need to be yanked like bad teeth! COPY_EXISTING ~DROTH.cre~ ~override~ WRITE_ASCII 0x250 ~BPMAGE3~ BUT_ONLY_IF_IT_CHANGESwill overwrite BG1 creature script without checking whether it already has custom scripts assigned. I can workaround all other script changes BP makes, but not this one. Can I request to change it to something like this?
COPY_EXISTING ~DROTH.cre~ ~override~ READ_ASCII 0x250 "Class" PATCH_IF (("%Class%" STRING_COMPARE_CASE "INITDLG") = 0) BEGIN WRITE_ASCII 0x250 ~BPMAGE3~ END BUT_ONLY_IF_IT_CHANGES
See, I even did the work for ya. B)