Jump to content


Photo

Making a weidu mod with your custom item


8 replies to this topic

#1 Anton

Anton
  • Member
  • 4 posts

Posted 04 February 2013 - 11:06 AM

Real modders probably think only brain dead people would need a tut for this, but having just figured this out for myself, I want to help elevate my fellow dead-brains.

 

I will make this as short and unintimidating as possible.

 

Why you want to do this:

So you can put your custom items in any installation without stomping all over the game's dialog and text system.

Or, to share your item.

 

What you need:

1) Your custom .itm file. I still prefer Infinity Engine Editor Pro for making items and spells.  You'll probably need to download and register the comdlg32.ocx file to get IEEP to work on modern systems. Google it.

 

2) Text editor.  Notepad is fine for this. (but the recommended one for Weidu modding is ConTEXT with Weidu syntax highlighters.  google it.)

 

3) Weidu.exe file.  Download the latest version.

 

Your mod will consist of a total of 4 files, but you only need to write 2 of them.  We will make them one by one.  Replace all instances of "mymod" or "myitem" with the name of your mod or item.

 

1) mymod.tp2

This file will have 11 commands, divided into three parts.  You can copy and paste the code below and modify it for your own use.

 

//My Item Mod

//Part 1 (header section)
BACKUP ~mymod/backup~
AUTHOR ~myemail~
LANGUAGE ~English~ ~mymod/english~ ~mymod/english/english.tra~
BEGIN ~MyMod~

//Part 2 (add item to game)
COPY ~mymod/myitem.itm~ ~override/myitem.itm~
  SAY NAME1 @1
  SAY NAME2 @2
  SAY UNIDENTIFIED_DESC @3
  SAY DESC @4

//Part 3 (add item to an existing creature, in this case the shadow dragon, Thaxll'ssillyia)
COPY_EXISTING ~SHADRA01.cre~ ~override/SHADRA01.cre~
  ADD_CRE_ITEM ~myitem.itm~ #0 #0 #0 ~NONE~ ~inv11~

 

If you have another item to add, simply duplicate part 2 and 3 for each item, but keep incrementing the numbers in the SAY commands (@5,@6,@7,@8 for second item, etc)


Now you may be wondering what those '@2' thingies are.  They are references to our next file:

 

2) english.tra

This file has the text for our item, listed using the reference numbers we used in the tp2 file above.

The four text fields we need are, in order:

unidentified name

identified name

unidentified description

identified description

 

text is contained in ~~ instead of the usual ""

 

here's an example:

////////////////////////////////////////////////
//Awesomesword
////////////////////////////////////////////////
@1=~Long Sword~
@2=~Awesomesword +3~

@3=~These swords are usually referred to as doubled-edged swords, war swords, or military swords.  In many cases, the long sword has a single-edged blade. There is no single version of the long sword; the design and length vary from culture to culture, and may vary within the same culture depending on the era.  Among the most common characteristics of all long swords is their length, which ranges from 35 inches to 47 inches.  In the latter case, the blade is known to take up 40 inches of the total length.  Most long swords have a double-edged blade and a sharp point at the tip.  Despite the tip, the long sword is designed for slashing, not thrusting.

STATISTICS:

Damage:  1D8
Damage type:  slashing
Weight: 4
Speed Factor: 5
Proficiency Type: Long Sword
Type:  1-handed
Requires: 6 Strength
Not Usable By:
 Druid
 Cleric
 Mage
~

@4=~Awesomesword

<some text describing your item>

STATISTICS:

Equipped Abilities:
 awesome

Combat Abilities:
 awesomeness: 10% chance to do some awesome shit.

THAC0: +3 bonus
Damage: 1D8, +1 Magical
Damage type: slashing
Weight: 2
Speed Factor: 2
Proficiency Type: Long Sword
Type: 1-handed
Requires: 11 Strength
Not usable by:
 Druid
 Mage
 Beast Master~

OK, guess what? Your "coding" is over!  All that's left is to put your mod into a nice package:

 

1) Copy weidu.exe and rename it 'setup-mymod.exe'. Put it in the same folder as your tp2 file.

2) Make a new folder called 'mymod' and put your .itm file in there.

3) Make a folder inside the mymod folder called 'English' and put your .tra file in there.

4) make a zip archive with your exe, .tp2, and mymod folder

 

And you're done!

Look at the weidu readme to learn how to do more stuff.


Edited by Anton, 04 February 2013 - 11:07 AM.


#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6339 posts

Posted 04 February 2013 - 02:01 PM

Well, I wouldn't think only brain-dead people need a tutorial for this but I could've sworn I wrote one just like it. That was some time ago though, and is probably well-buried, so it doesn't hurt having multiple tutorials, and you are pretty much spot-on with what you need to do WeiDU-wise.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"My definition of an intellectual is someone who can listen to the William Tell Overture without thinking of the Lone Ranger." -Billy Connolly


#3 -Guest-

-Guest-
  • Guest

Posted 13 June 2013 - 08:11 AM

I have followed these steps exactly and although it appears to run without error nothing actually happens--the item is not in the override folder. Have I somehow missed a step not listed here?

#4 The Imp

The Imp

    Not good, see EVIL is better. You LIVE.

  • Member
  • 3902 posts

Posted 13 June 2013 - 09:00 AM

I have followed these steps exactly and although it appears to run without error nothing actually happens--the item is not in the override folder. Have I somehow missed a step not listed here?

 

 

Well, do you have an .itm file in the "mymod" folder ? And to help with this, I suggest that you upload that and the other files in your mod too... in a .zip archive to this forum, or mediafire and give us the link.


Edited by The Imp, 13 June 2013 - 09:40 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 -Pecca-

-Pecca-
  • Guest

Posted 11 August 2013 - 01:12 AM

Hello. Thanks for this tutorial. I have only a question about how do I create a tooltip string (like when a weapon is both melee and ranged and I want that to be shown in item abilities). Is it something like "SAY TOOLTIP"?



#6 -Saradas-

-Saradas-
  • Guest

Posted 05 September 2013 - 03:59 AM

This is very useful, thank you. I finished a mod including many new spells and scrolls and need some help. The descriptions about .itm files are very well explained, I don't understand how to correctly add .spl files though.

I want the spell file to read the description of the related scroll in the sections SAY NAME2 and SAY DESC.

 

Spell files only need those two fields of description, sharing the same .tlk strings with the scroll .itm file: name of spell, description of spell.

How can i do?

thanks



#7 Mike1072

Mike1072
  • Member
  • 521 posts

Posted 05 September 2013 - 03:03 PM

Hello. Thanks for this tutorial. I have only a question about how do I create a tooltip string (like when a weapon is both melee and ranged and I want that to be shown in item abilities). Is it something like "SAY TOOLTIP"?
The tooltip information is not stored in the .itm file. You need to append to the file tooltip.2da.

Note: modders have written functions and macros that make this process easier (there are some issues that occur when other mods drastically alter the file), but for now I'll just explain how you would handle the basic scenario without hiding any of the details.

The format of each row in tooltip.2da is the item resource (name of item file minus the .itm extension) followed by a number of string references from dialog.tlk indicating which strings should be displayed when the appropriate item ability is hovered over (your item could have multiple melee, ranged, and/or magical abilities).

A standard throwing axe has a ranged ability and a melee ability. This is what its entry in tooltip.2da looks like:
AX1H04 15527 15529 -1
These tooltip strrefs correspond to the strings ~Thrown~ and ~Melee~. The -1 is just padding since the item only has 2 abilities.

The tricky part of appending to this file is that you need to get your tooltip strings into dialog.tlk so you can find out what numbers to use.

If you had a throwing axe item named MIAXTHR.ITM and you wanted to give it tooltips for its ranged and melee ability, you could do so like this:
OUTER_SET ability1strref = RESOLVE_STR_REF (~Super Throwing Mode~)
OUTER_SET ability2strref = RESOLVE_STR_REF (~Melee Madness~)
APPEND ~tooltip.2da~ ~MIAXTHR    %ability1strref%    %ability2strref%    -1~
The first two lines add your tooltip strings to dialog.tlk and store the strref in a variable. The third line appends to tooltip.2da, substituting in the values of the variables for the first and second column strrefs.

 
This is very useful, thank you. I finished a mod including many new spells and scrolls and need some help. The descriptions about .itm files are very well explained, I don't understand how to correctly add .spl files though.
I want the spell file to read the description of the related scroll in the sections SAY NAME2 and SAY DESC.

Spell files only need those two fields of description, sharing the same .tlk strings with the scroll .itm file: name of spell, description of spell.
How can i do?
thanks
Do it the exact same way. If the strings for the name of your spell and the name of your scroll are exactly the same, WeiDU will assign them the same string reference. If you are using a .tra file, you just need one string for the spell name and one for the spell description, then you reference both those tra references (@numbers) when you are copying over the spell and the scroll.

Here's an example from Spell Revisions. Note that the spell file needs the name and description in the unidentified fields while the scroll file needs it in the identified fields (like other magical items do).
COPY ~spell_rev/spwi3##/spwi304.spl~ ~override~ // Fireball
  SAY NAME1 @507 SAY UNIDENTIFIED_DESC @508
COPY ~spell_rev/spwi3##/scrl1g.itm~ ~override~
  SAY NAME2 @507 SAY IDENTIFIED_DESC @508
In case you're wondering, the unidentified name of the scroll was already set to ~Scroll~ in the .itm file. Because the string ~Scroll~ definitely already exists in everyone's game, it is safe to hardcode the dialog.tlk reference for it (7222) into the file.

Edited by Mike1072, 06 September 2013 - 12:58 AM.


#8 -Saradas-

-Saradas-
  • Guest

Posted 05 September 2013 - 10:03 PM

Thank you so much for the quick answer, Mike1072. Now everything is clear about this.

I can use DLTCEP fairly well but I'm still a complete noob with Weidu, so every help is very appreciated! :)

back to modding :D



#9 -Pecca-

-Pecca-
  • Guest

Posted 19 October 2013 - 12:15 AM

Thank you Mike1072. I used existing strings, but is handy to know.





Reply to this topic