Author Topic: Tool Request  (Read 1978 times)

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 814
  • Dreaming of a red Xmas
    • The Gibberlings Three
Tool Request
« on: September 13, 2006, 06:15:50 PM »
I'd like to see a new option in the Tools section: a way to detect mis-indexed effects in spells and items. I.e. if there are 4 global effects, making sure that the first ability starts at an index of 4, that the next ability accounts for the previous ability's effects, etc., etc. If these indices are not correct, it causes hard crashes on OS X and no shortage of hair pulling for the COPY_EXISTING_REGEXP crowd. devSin's posted some WeiDU code that can catch this; I had written one as well:

Code: [Select]
// index checker
COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
                          ~^.+\.itm$~ ~override~
  PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.spl$" = 0) BEGIN
    SET "abil_length" = 0x28
  END ELSE BEGIN
    SET "abil_length" = 0x38
  END
  READ_LONG  0x64 "abil_off" ELSE 0
  READ_SHORT 0x68 "abil_num" ELSE 0
  READ_SHORT 0x70 "fx_num"   ELSE 0
  FOR (index = 0; index < abil_num; index = index + 1) BEGIN
    READ_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
    PATCH_IF ("%fx_num%" = "%abil_fx_idx%") BEGIN
      READ_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "abil_fx_num"
      SET "fx_num" = ("%fx_num%" + "%abil_fx_num%")
    END ELSE BEGIN
      PATCH_PRINT "~%SOURCE_FILE%~ has index error on ability ~%index2%~"
    END
  END
  BUT_ONLY_IF_IT_CHANGES
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

 

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