Author Topic: Misindexed item in Tactics v23  (Read 2455 times)

Offline Gorilym

  • hyperbolic strawman
  • Planewalker
  • *****
  • Posts: 165
  • Gender: Male
    • MacEasyTutu
Misindexed item in Tactics v23
« on: September 30, 2006, 09:46:29 AM »
The item 'solasna5.itm' (The Bloodbane +5 throwing spear) is currently misindexed, which will cause the 'Red Badge poison-based encounter' to crash on OS X (as soon as its wielder attacks with it) and could cause compatibility issues with other mods. (re: similar issues with ItemUpgrade items & the D0QuestPack) As it doesn't look like Weimer has time to update Tactics, does anyone else feel up to fixing this item?

edit: ugly typo
« Last Edit: September 30, 2006, 10:02:17 AM by Gorilym »

die hohe Gästin Nythrun

  • Guest
Re: Misindexed item in Tactics v23
« Reply #1 on: September 30, 2006, 11:15:45 PM »
Temporary patch (copy this and save as a .tp2) until someone with the inclination is authorized to update tactics :)
Code: [Select]
BACKUP ~tactics2/backup/tacticbk~
AUTHOR ~Whoops!~

BEGIN ~Patch defective index only?~
SUBCOMPONENT ~Patch Bloodbane in Tactics directory?~
REQUIRE_FILE ~tactics2/redbadge/solasna5.itm~
  ~Tactics directory not located, check file paths before trying again.~
  MKDIR ~tactics2/backup/tacticbk~ // create backup directory
  COPY ~tactics2/redbadge/solasna5.itm~ ~tactics2/redbadge~
  PATCH_IF (SOURCE_SIZE=0x352) BEGIN
    READ_SHORT 0xca "fbo"
    PATCH_IF "%fbo%"=0x06 BEGIN
      WRITE_SHORT 0xca 0x09
    END ELSE BEGIN
      PATCH_PRINT ~Bloodbane is already modified somehow, uninstall this mod~
    END  // PATCH_IF to rewrite index
  END ELSE BEGIN
    PATCH_PRINT ~Bloodbane is already modified somehow, uninstall this mod~
  END // PATCH_IF filesize check
  BUT_ONLY_IF_IT_CHANGES

BEGIN ~Also patch redundant portrait icon with incorrect timing?~
SUBCOMPONENT ~Patch Bloodbane in Tactics directory?~
  MKDIR ~tactics2/backup/tacticbk~ // create backup directory
  COPY ~tactics2/redbadge/solasna5.itm~ ~tactics2/redbadge~
  PATCH_IF (SOURCE_SIZE=0x352) BEGIN
    WRITE_SHORT  0x0090 0x03 // feature count for 1st ext. header
    WRITE_SHORT  0x00c8 0x03 // feature count for 2nd ext. header
    WRITE_SHORT  0x00ca 0x08 // feature index for 2nd ext. header
    WRITE_SHORT  0x01d2 0x0c // opcode
    WRITE_LONG   0x01da 0x200000 // damage type: poison, fixed
    WRITE_BYTE   0x01de 0x01 // timing mode: instant
    WRITE_BYTE   0x01dF 0x01 // dispel/not bypass
    WRITE_LONG   0x01e0 0x00 // duration
    WRITE_SHORT  0x0292 0x0c // opcode
    WRITE_LONG   0x029a 0x200000 // damage type: poison, fixed
    WRITE_BYTE   0x029e 0x01 // timing mode: instant
    WRITE_BYTE   0x029F 0x01 // dispel/not bypass
    WRITE_LONG   0x02a0 0x00 // duration
    DELETE_BYTES 0x0202 0x30 // poison portrait icon effect
    DELETE_BYTES 0x02c2 0x30 // poison portrait icon effect
  END ELSE BEGIN
    PATCH_PRINT ~Bloodbane is already modified somehow, uninstall this mod~
  END // PATCH_IF filesize check
  BUT_ONLY_IF_IT_CHANGES
 
BEGIN ~Correct installation if Redbadge is already installed?~
  ACTION_IF FILE_EXISTS_IN_GAME ~solasna5.itm~ THEN BEGIN
    COPY ~tactics2/redbadge/solasna5.itm~ ~override~
    END ELSE BEGIN
      PRINT ~Redbadge doesn't appear to be installed, skipping override patch.~
    END // ACTION_IF FILE_EXISTS_IN_GAME

Offline Gorilym

  • hyperbolic strawman
  • Planewalker
  • *****
  • Posts: 165
  • Gender: Male
    • MacEasyTutu
Re: Misindexed item in Tactics v23
« Reply #2 on: October 01, 2006, 12:02:51 PM »
Much obliged, Nythrun - your code is working smoothly in testing. :)

One minor note - the tactics mod directory is named 'tactics', not 'tactics2' (in my local copy at least).

die kranke Gästin Nythrun

  • Guest
Re: Misindexed item in Tactics v23
« Reply #3 on: October 01, 2006, 09:03:03 PM »
I'm working from a really ancient Windows version of tactics...sorry about that.

Probably should have also mentioned that this will wipe out the identified description (I wasn't sure how much code this forum allows one to post, so I cut corners to save on file size.)  The second block really should be rewritten to
Code: [Select]
BEGIN ~Correct installation if Redbadge is already installed?~
  ACTION_IF FILE_EXISTS_IN_GAME ~solasna5.itm~ THEN BEGIN
    COPY_EXISTING ~solasna5.itm~ ~override~
    PATCH_IF (SOURCE_SIZE=0x352) BEGIN
      WRITE_SHORT  0x0090 0x03 // feature count for 1st ext. header
      WRITE_SHORT  0x00c8 0x03 // feature count for 2nd ext. header
      WRITE_SHORT  0x00ca 0x08 // feature index for 2nd ext. header
      WRITE_SHORT  0x01d2 0x0c // opcode
      WRITE_LONG   0x01da 0x200000 // damage type: poison, fixed
      WRITE_BYTE   0x01de 0x01 // timing mode: instant
      WRITE_BYTE   0x01dF 0x01 // dispel/not bypass
      WRITE_LONG   0x01e0 0x00 // duration
      WRITE_SHORT  0x0292 0x0c // opcode
      WRITE_LONG   0x029a 0x200000 // damage type: poison, fixed
      WRITE_BYTE   0x029e 0x01 // timing mode: instant
      WRITE_BYTE   0x029F 0x01 // dispel/not bypass
      WRITE_LONG   0x02a0 0x00 // duration
      DELETE_BYTES 0x0202 0x30 // poison portrait icon effect
      DELETE_BYTES 0x02c2 0x30 // poison portrait icon effect
    END ELSE BEGIN
      PRINT ~Bloodbane appears to already be modified, cancelling patch.~
    END // PATCH_IF filesize check
  END ELSE BEGIN
    PRINT ~Redbadge doesn't appear to be installed, skipping override patch.~
  END // ACTION_IF FILE_EXISTS_IN_GAME


Also, http://forums.gibberlings3.net/index.php?showtopic=7842 might possibly be of interest :)

Offline Gorilym

  • hyperbolic strawman
  • Planewalker
  • *****
  • Posts: 165
  • Gender: Male
    • MacEasyTutu
Re: Misindexed item in Tactics v23
« Reply #4 on: October 02, 2006, 03:10:19 PM »
Didn't notice a problem with the description, but in my testing I first uninstalled Redbadge, did the in-tactics-dir fix, and then reinstalled Redbadge. I'm guessing that the in-override-dir fix would have had that effect though.

Quote
Also, http://forums.gibberlings3.net/index.php?showtopic=7842 might possibly be of interest :)

Right, I used a similar spl/itm indexchecker (by CamDawg) to actually confirm that the issue was index-related in the first place.:)

 

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