Jump to content


Photo

Custom items via WeiDu in the game


  • Please log in to reply
9 replies to this topic

#1 Michel

Michel

    Damn. I'm good!

  • Member
  • 1003 posts

Posted 29 October 2002 - 12:32 PM

First i would like to say that i am a total newby to programming or writing a computer language, so please bare with me <_<

I'm trying to have my custom items into the game WITH the items description. At this time i usually make the item via NI and edit the description. Work fine. Then for whatever reason i need to uninstalle BG2 again thus i will lose all the descritions i made. At that point a re-edit the description in the game again via NI. This is a tedious work. So i thought long and hard about and decided that i'd better start using WeiDu to have a program that makes the changes for my with a simple install function.

My main problem is that i need to see an expamle of how to start and and finish something. When someone writes "You do this, you do that and then that" doest work for me.
I'v asked Japeth for advise and he sent me an example.tp2 for an item description tp2 file .

So far I got this:
BACKUP ~backup~
AUTHOR ~michel@rpgtalk.com (http://michel.rpgtalk.com)~
BEGIN ~Shodan's Item Pack V1~

COPY ~shodan/myitem1.itm~ ~override/myitem1.itm~
SAY 8 ~Necklace~
SAY 12 ~Necklace of the Mind~
SAY 80 ~A necklace is a piece of ornamental metal jewelry usually made of silver, gold, platinum, or other precious metals, and adorned with gems.  A necklace is always worn on the neck and can be of any length.~
SAY 84 ~This will be written with an description of the item which i havent made yet :/

COPY ~shodan/myitem2.itm~ ~override/myitem2.itm~
SAY 8 ~Ring~
SAY 12 ~Ring of Cold~
SAY 80 ~A ring is a small band of precious metal that is used as jewelry.  Some rare rings have had enchantments placed upon them that confer various magical abilities.  These rings are highly sought after, especially by those of the adventuring profession.~
SAY 84 ~This will be written with an description of the item which i havent made yet :/

I have INSIDE my MAIN Bg2 folder a dir called "shodan" and a dir called "backup"

I have my 2 custom items IN the *shodan* and *backup* folder.
Is this the correct way of doing it?
If I add a 3rd item to the tp2 file do i do it this way?:
BACKUP ~backup~
AUTHOR ~michel@rpgtalk.com (http://michel.rpgtalk.com)~
BEGIN ~Shodan's Item Pack V1~

COPY ~shodan/myitem1.itm~ ~override/myitem1.itm~
SAY 8 ~Necklace~
SAY 12 ~Necklace of the Mind~
SAY 80 ~A necklace is a piece of ornamental metal jewelry usually made of silver, gold, platinum, or other precious metals, and adorned with gems.  A necklace is always worn on the neck and can be of any length.~
SAY 84 ~This will be written with an description of the item which i havent made yet :/

COPY ~shodan/myitem2.itm~ ~override/myitem2.itm~
SAY 8 ~Ring~
SAY 12 ~Ring of Cold~
SAY 80 ~A ring is a small band of precious metal that is used as jewelry.  Some rare rings have had enchantments placed upon them that confer various magical abilities.  These rings are highly sought after, especially by those of the adventuring profession.~
SAY 84 ~This will be written with an description of the item which i havent made yet :/

COPY ~shodan/myitem3.itm~ ~override/myitem3.itm~
SAY 8 ~Ring~
SAY 12 ~Ring of Health~
SAY 80 ~A ring is a small band of precious metal that is used as jewelry.  Some rare rings have had enchantments placed upon them that confer various magical abilities.  These rings are highly sought after, especially by those of the adventuring profession.~
SAY 84 ~This will be written with an description of the item which i havent made yet :/

My first priority will be the writing of this tp2 file. If i can get this to write like it should, then i'll continue further on. Step by Step.

My ultimate goal would be to create a small *mod* with *some* quests. If i can get that to work, i'll run naked through my hometown :o :o :lol:

#2 japheth

japheth

    Codewalker

  • Member
  • 317 posts

Posted 29 October 2002 - 04:43 PM

I have my 2 custom items IN the *shodan* and *backup* folder.
Is this the correct way of doing it?


You only need your items in your shodan folder. The backup folder is used to keep copies of unmodified items. (ie You modify an ingame item like sw1h01.itm, WeiDU will copy sw1h01.itm to your backup folder before modifying the item)

SAY 84 ~This will be written with an description of the item which i havent made yet :/


You need a tilde at the end of that one.

If I add a 3rd item to the tp2 file do i do it this way?


Yep, that's how you do it. Of course you'd have to add the tilde to the end of that block to. :)

My only question is...have you tried compiling it yet?
Check out BG1Tutu.

#3 weimer

weimer
  • Member
  • 1569 posts

Posted 29 October 2002 - 05:12 PM

Your TP2 file looks fine. Note that you can use symbolic phrases like "NAME" instead of 8 and "DESC" instead of 84 or whatnot. But anyway. Close all your tildes, copy WeiDU.exe to Setup-Example.exe (assuming your TP2 file is called example.tp2) and run Setup-Example.exe. Let us know what happens.

#4 Michel

Michel

    Damn. I'm good!

  • Member
  • 1003 posts

Posted 30 October 2002 - 10:57 AM

You only need your items in your shodan folder. The backup folder is used to keep copies of unmodified items. (ie You modify an ingame item like sw1h01.itm, WeiDU will copy sw1h01.itm to your backup folder before modifying the item)

If i understand correctly what your mean is that when i change an INGAME orginal item (sw1h01.itm) and I upgrade it somehow with +1 fire damage..then i need to place the original INGAME item in the backup folder.
So if the user CLUA's sw1h01.itm in the game it gets MY upgraded item instead?


Yep, that's how you do it. Of course you'd have to add the tilde to the end of that block to.

Ah, my mistake

My only question is...have you tried compiling it yet?

No, i didnt try it yet because...heh...i didnt know how to compile it... :blink:

Your TP2 file looks fine. Note that you can use symbolic phrases like "NAME" instead of 8 and "DESC" instead of 84 or whatnot. But anyway. Close all your tildes, copy WeiDU.exe to Setup-Example.exe (assuming your TP2 file is called example.tp2) and run Setup-Example.exe. Let us know what happens.

I removed the "Installed Kelsey, Valen" and the rest of the mods from the log. I only pasted the part when WeiDu began installing the itempack.


Install Package [Shodan's Item Pack V1]
[Y]es or [N]o? WARNING: unable to open [backup/0/UNINSTALL.0]: Sys_error("backup/0/UNINSTALL.0: No such file or directory")
Will be unable to UNINSTALL later.

Installing [Shodan's Item Pack V1]
Copying 1 file(s) ...
[shodan/helm1.itm] loaded, 354 bytes
Copied [shodan/helm1.itm] to [override/helm1.itm]
Copying 1 file(s) ...
[shodan/bow1.itm] loaded, 506 bytes
Copied [shodan/bow1.itm] to [override/bow1.itm]
Copying 1 file(s) ...
[shodan/staff1.itm] loaded, 370 bytes
Copied [shodan/staff1.itm] to [override/staff1.itm]


2004 characters added to DIALOG.TLK
[dialog.tlk] created, 84420 string entries

SUCCESSFULLY INSTALLED [Shodan's Item Pack V1]

  WeiDU Timings
TOTAL                                    0.734 s
  unmarshal TLK                          0.218 s
  add strings to TLK                     0.188 s
  marshal TLK                            0.140 s
  saving files                           0.078 s
  loading files                          0.063 s
  unmarshal KEY                          0.047 s
  find local string                      0.000 s
    strings to add                       0.000 s
  parsing .TP files                      0.000 s
  parsing .log files                     0.000 s

This is the end of the log weidu made.
I dont know what the error means...
I didnt modify any original items in the game. These are all unique items. So if i understood Japheth correctly then i dont need the backup folder.
Right?

#5 Michel

Michel

    Damn. I'm good!

  • Member
  • 1003 posts

Posted 30 October 2002 - 11:45 AM

Fixed the problem

I didnt specify the correct backup path

I still had: BACKUP ~backup~ while it should have been
BACKUP ~shodan\backup~

Now it works perfectly! :D


I am sooo going to frame this tp2 file :D

One more question.

How do i let WeiDu open a shodan.txt file at the end of the install?

When i looked at Valens tp2 file it mentioned something like this:
VIEW valen\README

If i want WeiDu to open my readme file then the correct path should be:

VIEW shodan\README ?

And this should be at the bottom of the tp2 file?

#6 weimer

weimer
  • Member
  • 1569 posts

Posted 30 October 2002 - 02:33 PM

Congrats. Before you know it you'll be churning out NPC mods. :-)

Something like

AT_INTERACTIVE_EXIT ~VIEW shodan\README.txt~

should work. It doesn't have to be at the end of the TP2 file, but that's not a bad place for it.

#7 Michel

Michel

    Damn. I'm good!

  • Member
  • 1003 posts

Posted 31 October 2002 - 07:37 AM

Thanks!

Right now i am adding my other items to the file.

Next project will be creating my own store. Possibly with all the items i created. Right now i'm searching for information or a tutorial of how to create one.

#8 weimer

weimer
  • Member
  • 1569 posts

Posted 31 October 2002 - 09:50 AM

Make a copy of an existing store, edit it with Near Infinity to include your items (which must be in override at the time), then add the StartStore() action to some dialogue.

#9 Michel

Michel

    Damn. I'm good!

  • Member
  • 1003 posts

Posted 31 October 2002 - 06:12 PM

I created a shop as per your suggestion. I named it "shoshop". I didnt add any new items or changed anything in the file. No custom items added.

I also created a dialogue file with Notepad

SAY ~Here's my crap give me money.~ IF ~~ THEN DO ~StartStore("shoshop",LastTalkedToBy())~ EXIT END
I kept Jcomptons line because i found it humerous :P
I saved it as "shoshop.dlg"

I can open my store via NI but when I open shoshop.dlg via NI it says "Unsupported Version:~Her"

#10 japheth

japheth

    Codewalker

  • Member
  • 317 posts

Posted 01 November 2002 - 09:33 AM

It sounds to me like you just put those lines in notepad and saved the notepad text file as shoshop.dlg. You need to get WeiDU to compile the file before it will be turned into recognizable dialog.

Here's what you need to do:
BEGIN shoshop

IF ~NumTimesTalkedTo(0)~ THEN BEGIN SHOSHOP0
SAY ~Here's my crap give me money.~ 
IF ~~ THEN DO ~StartStore("shoshop",LastTalkedToBy())
SetGlobal("StoreDudeTalkedTo","GLOBAL",1)~ EXIT
END

IF ~Global("StoreDudeTalkedTo","GLOBAL",1)~ THEN BEGIN SHOSHOP1
SAY ~Eh?  Back again for more useless stuff?~
IF ~~ THEN DO ~StartStore("shoshop",LastTalkedToBy())~ EXIT
END

Slap that code in notepad, and when you save it, save it as "shoshop.d".
(Make sure you choose All Files when saving so that Windows doesn't append a .txt extension on the file.)

Move shoshop.d to your root BG2 Directory, and then open up your command prompt. (If you're using WinNT/2000/XP, you can just go to the Run prompt and type "cmd", if it's any other OS, go to the run prompt and type "command")

Change to your BG2 directory by typing:

cd "c:\program files\black isle\bgii - soa".

(Note: You need the quotes around the directory name if your using 95/98/Me.)

Then issue this command:

weidu shoshop.d --tlkout dialog.tlk --out override

WeiDU will compile your dialog, and put it into your override folder.

Then it's simply a matter of assigning that dialog file to a creature in NI, and then spawning the creature via the CLUAConsole:CreateCreature command.
Check out BG1Tutu.