Skip to content

Using WeiDU, DLTCEP, and NI (Offsets) for custom Strrefs, and D Files.

Hi,

I'm trying to fix all the custom strings in my mod as well as minimize the differences in code between BGEE and BG2EE.
There are a few areas where I've had to use STRING_SET and I'm trying to remove them all. Below is an example of how I've tried to use offsets in NI to set the strings of certain files I want in both games, and I'm not too sure if I have it right:
COPY ~Bladesinger/Spells/embs1.spl~ ~override~ ~override/embs1.spl~ SAY 0x8 @124 ~override/embs1.spl~ SAY 0x50 @125
COPY ~Bladesinger/Spells/embs1g.spl~ ~override~ ~override/embs1g.spl~ SAY 0x8 @126 ~override/embs1g.spl~ SAY 0x50 @127
COPY ~Bladesinger/Spells/embs2.spl~ ~override~ ~override/embs2.spl~ SAY 0x8 @132 ~override/embs2.spl~ SAY 0x50 @133
COPY ~Bladesinger/Spells/embs2g.spl~ ~override~ ~override/embs2g.spl~ SAY 0x8 @134 ~override/embs2g.spl~ SAY 0x50 @135
COPY ~Bladesinger/Spells/embs3.spl~ ~override~ ~override/embs3.spl~ SAY 0x8 @128 ~override/embs3.spl~ SAY 0x50 @129
COPY ~Bladesinger/Spells/embs3g.spl~ ~override~ ~override/embs3g.spl~ SAY 0x8 @130 ~override/embs3g.spl~ SAY 0x50 @131

In addition to spell names/descriptions like above, and custom display strings on items, I'd also like to use this method for "Item Usability [319]", which I've gotten a little creative with. For example, I've got items that are restrictive to certain class/kit, race, and gender combos- but with strrefs in the field "special" that say things such as "IMOEN" or "Red Wizard of Thay." (This is because it's very easy to make a Sarevok only item, but not so much for Imoen apparently. And despite not adding a Red Wizard of Thay kit, I thought it'd be nice to have some roleplay items for Lawful Evil wizards, whether they be Edwin or not.)
I was hoping someone with more experience in NI than myself could tell me which line equates to the field "special" in DLTCEP, it doesn't seem as intuitive as the offsets for display string.

I'm also trying to make a few custom dialogs and this has been the most vexing problem I've had since transitioning from just DLTCEP to WeiDU.
I had a (very simple) sentient item and a cespenar mod working perfectly. Now when the item dialogue is viewed in NI or DLTCEP, it shows me the correct conversation that was working before, the strrefs all match up to what is supposed to be displayed, but in game I only have a few lines working and a bunch of lines displayed as some of my custom item descriptions. I'm about to do a fresh install to fix any problems in my dialog.tlk, but how do I fix these custom dialogs when they appear to be correct in the editors? If I use the offsets for the states and responses, would I just type SAY and the string I want? Or is there more to it due to "Response:" and "Flags: ( Text associated(0) )"?
And what about D Files? I don't know if this is the solution to my problem or not. I know how to compile them, but not so much how to write them. What program is best for the .txt you start with?

Comments

  • GrammarsaladGrammarsalad Member Posts: 2,582
    For items you might want something like:

    COPY ~path/item.itm~ ~override~ // SAY NAME1 ~General Name~ // unidentified name for items OR spell name SAY NAME2 ~Identified Name~ // identified name for items; not used for spells SAY UNIDENTIFIED_DESC ~Unidentified Description~ // unidentified description for items, spell description for spells SAY DESC ~Identified Description~ // identified description for items, unused for spells

    Note: Copy/pasted from here:
    http://forums.pocketplane.net/index.php/topic,630.0.html
    That tutorial is a bit outdated, however. Use the one here to make a kit.

    Also, this place should be your best friend:
    http://gibberlings3.net/iesdp/index.htm

    My wife is pacing. I'll try to read/answer the rest of your post sometime later.
  • GrammarsaladGrammarsalad Member Posts: 2,582
    Sorry, that is for items. For spells it's:

    COPY ~MyMod/MySpell.spl~ ~override~ SAY NAME1 ~General Name~ // unidentified name for items OR spell name SAY NAME2 ~Identified Name~ // identified name for items; not used for spells SAY UNIDENTIFIED_DESC ~Unidentified Description~ // unidentified description for items, spell description for spells SAY DESC ~Identified Description~ // identified description for items, unused for spells

    Same link
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    edited August 2015
    @Grammarsalad Thanks, but items aren't the problem, I've got tons of custom items in game already and those don't even require offsets. And using the same method as item names/descriptions with the addition of offsets from NI, I set spell names and descriptions. What I mentioned about items was specifically the OPcode to display a string. Rather than setting that string in DLTCEP, you can use a NI offset to set the string to something custom.
    What I cant figure out is how to do this with OPcode 319 Item Usability, because that involves string references too but comes up as unknown in NI.
    COPY ~Bladesinger/ITM/emsw1h06.itm~ ~override~ // Flaming Burst Long Sword +1
    SAY NAME1 ~~
    SAY NAME2 @104
    SAY UNIDENTIFIED_DESC ~~
    SAY DESC @105

    COPY ~Bladesinger/Spells/embs1.spl~ ~override~
    SAY 0x8 @124
    SAY 0x50 @125

    COPY ~Bladesinger/Spells/emcdblsr.spl~ ~override~
    SAY 0x15e @213
  • GrammarsaladGrammarsalad Member Posts: 2,582

    I am not at my computer, and the IESDP doesn't have anything on 319. When you say, "the opcode to display a string", you mean 139, yes? According to IESDP, you are looking for 0x0014
    http://gibberlings3.net/iesdp/file_formats/ie_formats/eff_v1.htm
    Your examples show spl's however, so I'm not sure that I understand what you are looking for.

    How do you want your text to display in game ? As something that happens if an opponent gets hit with your spell? For that you would use 139.

    Anyway, find here the spl file format

    http://gibberlings3.net/iesdp/file_formats/ie_formats/spl_v1.htm

    As for adding dialogs, you really, really need to do that using weidu to avoid messing up dialog.tlk. are you compiling your d files, or doing it some other way?
  • GrammarsaladGrammarsalad Member Posts: 2,582
    I write all dialogs in a text editor-specifically context-rather than NI or DLTCEP. Same with scripts. After writing them, how do you get them "in game"?
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    @Grammarsalad I'm using ConTEXT for my WeiDU .tp2, .tra, and all custom strings. DLTCEP for creating custom items and spells, which I've got down pat- there's no problem there. And NI for looking up offsets.
    Some items/spells of mine use "Text: Display String [139]," I'm not having a problem with this either. Op code 139 has a field for the string reference and if you look up the offset in NI, you can easily use SAY ("offset") @("#").
    The only thing I'm having a problem with, other than my custom dialogs, is finding the offset equivalent of the Op 139 string field with Op code 319 (the field "special" in DLTCEP). If I have an item using Op code 319 and there's a custom string in the special field, the item will say only usable by that custom string. At the moment, I have to use STRING_SET and then type in the strref into DLTCEP to get this to work. I just want to find the offset for this Op code like I've done with display string.
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    #319 (0x319) Usability: Item Usability
    Parameter #1: IDS Entry
    Parameter #2: IDS File
    Description:
    This effect restricts the item to creature(s) matching the object identifiers. The string to display when an invalid creature attempts to use the item is held in 0x2c.
    Known values for 'IDS File' are:
    2 EA.ids
    3 General.ids
    4 Race.ids
    5 Class.ids
    6 Specific.ids
    7 Gender.ids
    8 Align.ids
    9 Kit.ids
    10 Actor's name
    11 Actor's scripting name (8 maximum in resource field)
    If 'IDS File' is set to 10, the item is restricted to characters with the name specified by the strref held in parameter1.
    If 'IDS File' is set to 11, the item is restricted to characters with the death variable specified by the resource field.

    http://gibberlings3.net/iesdp/opcodes/bgee.htm
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    But that doesn't answer my question, as it's not about IDS, or the invalid creature, but the valid one.
  • GrammarsaladGrammarsalad Member Posts: 2,582
    Huh, I must have been looking in the BG2 section...

    Hmm, can you upload one that you use STRING_SET to change? I can probably figure it out if I can poke it a few times.
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    STRING_SET 553 @97 //Red Wizard of Thay
  • GrammarsaladGrammarsalad Member Posts: 2,582
    Can you upload the actual file?
  • GrammarsaladGrammarsalad Member Posts: 2,582
    Interesting...
  • WhiteAgnusWhiteAgnus Member Posts: 112
    edited August 2015
    29 02 = 0x229 = 553 ;)

    Look in the unknown line... (I think you're using an outdated version of NI, because the 319 Opcode is not Unknown... ;) Grep the newest snapshot here: https://github.com/Argent77/NearInfinity/releases)

  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    @WhiteAgnus Thanks! I knew that 553 in hex was 229, but the 29 02 makes no sense to me. But at least now I'm sure it's the 0x36e offset for this item.

    @Grammarsalad can't upload a .itm file, but seems like the "special" field for Opcode 319 is the last unknown line in NI.

    My only problems now are custom dialogs/writing D files, but I'll worry about that later.
  • WhiteAgnusWhiteAgnus Member Posts: 112
    Get the newest version of NI, like I said in the edit... ;)

    Attached you can find a screenshot of BOLT07.itm Effect 0 with Opcode #319... ;)
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    Ah, I'm only on v1.33. Idk why I thought this was the newest one. Thanks again.
Sign In or Register to comment.