Jump to content

Guide for Editing Items?


haze

Recommended Posts

Thanks to @critto and @argent77 I was able to get Near Infinity to load on my M2 Macbook Air. I recently installed Item Tweaks mod by @subtledoctor and some of the item descriptions and item abilities didn't update. I want to try to fix them. I opened NI, saw the area to edit "General Description", clicked to edit but it wouldn't let me change anything. Just made an "alert" sound. Also, I didn't see anywhere to change the damage of an item. The throwing dagger is supposed to be 1D5 with the mod, but is still 1D4. There also some other items that need updates, this is just the first one that I am trying.

Link to comment

Weidu is going to be easier for this sort of thing. If you can make a small mod you can just use this code, copied from my item tweaks mod and changed to 1) also apply to thrown daggers, and 2) correctly adjust dagger descriptions:

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  PATCH_IF (~%SOURCE_SIZE%~ > ~0x71~) BEGIN
    READ_BYTE 0x31 prof
    READ_SHORT 0x1c type
    PATCH_IF (%prof% = 96) BEGIN // daggers
      LPF ALTER_ITEM_HEADER INT_VAR header_type=1 dicesize=5 dicenumber=1 END // melee damage
      LPF ALTER_ITEM_HEADER INT_VAR header_type=2 dicesize=5 dicenumber=1 END // thrown damage
      FOR (index = 0x54 ; index >= 0x50 ; index -= 4) BEGIN
        READ_LONG "%index%" "valid"
        PATCH_IF ("%valid%" < 2147483646) AND ("%valid%" >= 0) BEGIN
          READ_STRREF "%index%" "description"
          PATCH_IF (~%description%~ STRING_CONTAINS_REGEXP ~1d4~) = 0 BEGIN // fixed from original
            INNER_PATCH_SAVE new_desc ~%description%~ BEGIN
              REPLACE_TEXTUALLY ~1d4~ ~1d5~
            END
            SAY_EVALUATED "%index%" ~%new_desc%~
          END
        END
      END
    END
  END
BUT_ONLY

.

Edited by subtledoctor
Link to comment

The catch on editing item descriptions is that the field in the item file is just a number - a reference to the master list of strings, over in "dialog.tlk". Unless you edit that file (to add your new string in, or change the text of an existing string), all you can do is choose from the strings that are already there. Which probably doesn't include what you want the item description to be.

And dialog.tlk is one thing that I refuse to touch with Near Infinity. A bad edit on that file can scramble all the text in the game. Best to only interact with it through specific functions that edit it in predictable ways - which, for me, means WeiDU commands like SAY.

Edited by jmerry
Link to comment

I see. That sounds a little more involved than I had anticipated. I have only done modding for Civ III. I thought I could just go in and edit the description, change the damage, and save. @subtledoctor your mod didn't update the descriptions or the throwing dagger. I tried too separate installs. Anyhow, I was going to fix not only the daggers, but also the other item descriptions from Functional Weapon Tweaks since none of them got updated. Maybe I'll just uninstall for now since it looks like the fix is trickier than I had anticipated. Thanks for the info.

Edited by haze
Link to comment
22 hours ago, haze said:

I see. That sounds a little more involved than I had anticipated. I have only done modding for Civ III. I thought I could just go in and edit the description, change the damage, and save. @subtledoctor your mod didn't update the descriptions or the throwing dagger. I tried too separate installs. Anyhow, I was going to fix not only the daggers, but also the other item descriptions from Functional Weapon Tweaks since none of them got updated. Maybe I'll just uninstall for now since it looks like the fix is trickier than I had anticipated. Thanks for the info.

You can check my Item Pack mod for further reference. As subtledoctor said, using weidu for updating text references sounds more daunting than it actually is.

Link to comment
4 hours ago, subtledoctor said:

Well the mod has not been updated yet so reinstalling will not help anything.

EDIT - okay I updated it on Github.

Also those item description changes only work in English, if you are playing in another language the text replacement will not happen.

Thanks. I''l give a try. I tried reinstalling because I thought it was a glitch or mod conflict.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...