Jump to content

icewind dale and bg2


squiros

Recommended Posts

i am trying to move icewindale in bg2 to bgt. specifically, i'm just starting at the starting area ar1006. i moved the ARE files, creature files, area script, creature scripts and corresponding WED file and TIS file. the game crashes when i try to move to area - no load bar at all.

 

what is the TIS file exactly?

DLTCP can't show me the minimap, which i believe is related to why bgt crashes when i move to it. how do i fix this?

what else am i missing? how do i get this working?

 

any help would be greatly appreciated.

Link to comment

Hoowee... you can't really do that, at least not without a whole lot of work. You might be interested in this IWDinBG2 which is the effort to do this already.

 

TIS is a tileset (the big map), MOS is a minimap... you're probably also missing the search/height/light maps (.bmp files), item (.itm) files on creatures, probably a whole bunch of other stuff.

Link to comment

neverending journey did this for most of iwd. i simply wanted to finish it and add the expansions. (actually, i don't like the additions and want to create a faithful copy while i'm at it).

 

i also want to add this mod to the current bgt - which i think is less work than adding bgt to iwdinbg2.

 

the items on creatures shouldn't cause it to crash - many malformed item references simply lead to blank equipment spots. further, all items are actually already referenced, interestingly.

 

the bitmaps helped, thx for the advice miloch. now the game loads area, but crashes immediately after the load bar completes.

 

i don't mind the whole lot of work - i just want it to work.

Link to comment

Have you tried installing IWDinBG2 on BGT? I don't see any real reason why it wouldn't work, since all the BG2 references should be the same in BGT.

 

The other problem is you'll need the animations (.bam files) for all the creatures, as well as all the animations referenced in the area file. In the case of ar1006, those animations should be present in BG2, but a lot won't be (hence why we have Infinity Animations to add them). Also, if you don't change all the file references, you're overwriting vanilla BG2 content (ar1006 is Jysstev's estate in BG2). Also, the area will crash if the entrances/exits to other areas do not exist, in this case IWD's ar1000, ar1015. There'll probably be a lot of other issues, most of which should be documented in the IWDinBG2 forum.

Link to comment

i am trying to move icewindale in bg2 to bgt. specifically, i'm just starting at the starting area ar1006. i moved the ARE files, creature files, area script, creature scripts and corresponding WED file and TIS file. the game crashes when i try to move to area - no load bar at all.

You also need to know that Icewind Dale uses a modified Baldur's Gate engine. Major script differences also make just moving areas into the BG2 engine a major task.

 

Your best bet, as Miloch says, is the Icewind Dale in BG2 project in development here. Things are quiet at the moment, but I'm sure DavidW will return and it'll get active again. Until then another set of eyes looking for bugs is more than welcome.

Link to comment

not to mention that after IWDinBG2 gets stable and working it'll be much easier to port into BGT as all the hard work has already been done. of course you'll need to ask permission to do that I'm sure.

Link to comment

copying the files from iwdinbg2 doesn't work - the game crashes. this makes me think that iwdinbg2 modifies the engine as well in order to facilitate area import. using the bg2 exe runs iwdinbg2 okay in some parts, crashes in others. using iwdinbg2 exe runs okay everywhere, so iwdinbg2 is using a modified exe somehow.

 

i prefix all files and their references with IR* to avoid overwriting anything.

 

i don't mind rewriting each and every script of every creature in iwd+x. including movies, custscenes, etc. speaking of each and every creature - i realize modding the dialog.tlk and references will become a project as well.

 

neverending journey has a lot of animations from iwd - i could 'borrow' those for now. custom animations is quite a ways away. i'm simply looking to have an area load, at this point. i notice that some of the offsets in the area are different for everyone - both the real iwd, the iwdinbg2 and neverending journey's. what is curious is that they are the same version number, does anyone know what the significance of the offsets are or how to figure out the correct ones to use?

 

i don't mind a large undertaking. i'm not simply being defiant, i fear that the incompatibilities of iwdinbg2 to bgt will have to be tackled anyway, which is what i'm attempting. does anyone know what specifically makes the conversion tedious?

 

i appreciate the help, regardless. if anyone has any suggestions, i would love to hear it.

Link to comment

it works! the area loads! woooooot!! the creatures load, wearing correct gear. the fireplace works. the area and door work, using the gold bg2 icons instead of the pretty iwd.

 

the are files are completely independent - in an attempt to isolate the problem, i loaded a known working wed/tis combo and it worked perfectly, with a fireplace mysteriously coming out of the ground. so the are files can be directly exported, it seems.

the wed files were incorrect - the dimensions were wrong at 23 x 18 and therefore the tileset was completely misaligned (as shown my ietme) which caused the crash. brute forcing the dimensions to 20 x 15 made the wed file correct. ietme converts the wed file to something NI and bg2 can't read, so i had to re-export the wed from original (ietme needs the wed to convert the tis because the tis file doesn't load - completely wrong format, i believe, even if NI shows it working. ietme converts this). since i reimported the wed from stock (thank you davidw for iwdinbg2), the offsets should be working as intended for bg2. appending the music files seems too much, i'll get to that later.

 

the dialog offsets are completely wrong, as expected. will simply import dialog.tlk from iwd and append it to the current dialog.tlk and update every dialog by adding the offset. the dialog choices and effects are correct, so the referenced dialogs IRhildreth.dlg and others are working. IR = icewindale resource.

 

thanks for the help everyone.

Link to comment

do keep in mind that in some cases you are required to maintain an 8 or even 6 character filename. You'll have to develop some sort of method to not accidentally cause more than one file to be renamed with the same name.

 

As far as the dialog.tlk goes. you can traify it and then treat it like any other .tra file and have the dialogs point to entries into it. On the outside chance that any strings in the BG2 dialog tlk matches those will be used, else appended to the end. Course that would all be using weidu, if you are doing some other method... disregard my ramblings

Link to comment

thanks plainab, you probably saved me 2 months debugging just now.

 

is there any way to get weidu to add 86342 to all strrefs inside a dialog file? with 60 actions, 100 replies all needing an updated strref, this could be a while.

Link to comment
is there any way to get weidu to add 86342 to all strrefs inside a dialog file?
You don't need to. Open up IESDP and read up on the file structure of each file type. wherever there is a strref entry, copy the file and instead of doing a WRITE_whatever do SAY offset @tra # if you don't change the output #s of the traified dialog.tlk then the existing strref value @ the offset will equal the tra #

 

After you've pulled your FROM game files over to the TO game in a temporary holding directory....

Quick example with an item:

from IESDP: 0x0008 4 (dword) Unidentified Name (strref)

 

COPY ~TempConvert~ ~override~
PATCH_IF (~%SOURCE_FILE%~ STRING_EQUAL_CASE ~.*\.itm~) BEGIN
READ_LONG 0x8 strref //unidentified name entry
SAY 0x8 @%strref%
//do other strref entries &/or other conversion required modifications
END
BUT_ONLY

 

at least that's how I'd consider doing it. course you may want to test with one file first to see whether it does work as intended.

Link to comment

would you mind showing me how to make weidu implement that? i have no idea where to start and the documentation assumes you already know what's going on.

http://www.weidu.org...ADME-WeiDU.html

doesn't say how a tp2 file is implemented - just that it can be. or if there's a better place to read up on it i'm more than happy to get into it.

 

dialog files don't have static addresses to string references like items. is there a way to do it for dialog files?

i ended up writing sweidux : squirrel's weidu extender. it opens the d file and parses it, adding the offset. instead of overwriting foo.d it creates test.out. (was debugging).

d.txt

Link to comment

Go down to section 8 in the weidu readme. it describes (most) available commands and such for the .tp2 file.

 

a tp2 file is merely a series of text commands that are interpreted by the weidu.exe. nice thing is that when weidu.exe is renamed into setup-mymod.exe it will automatically use mymod.tp2 in the same directory OR setup-mymod.tp2 found inside mymod directory.

 

If you require a more simple explanation, at minimum you need a text file that has

BACKUP ~mymod/backup~
AUTHOR ~how you want to be reached~

BEGIN ~Component name~
//list of tp2 actions such as the example posted earlier

save with tp2 extension. Use notepad, notepadd ++, context, or some other pure text editor. nothing that will add junk like MS Word etc...

 

 

note: I work with Windows. What works here may not work on other platforms, but maybe it'll give you ideas...

dialog files (at install time to use the player's native language):

put a copy of weidu & directory & 2 batch files & a tp2 in the FROM game directory and launch the batch file from the higher level install process.

Lets assume for now that you are gonna name the process as IWD2BGT-DialogGet

copied to FROM directory:

weidu.exe

setup-IWD2BGT-DialogGet.tp2

IWD2BGT.bat

IWD2BGT-DialogGet.bat

IWD2BGT-DialogGet (directory)

 

you would launch the IWD2BGT.bat first.

it's contents:

weidu setup-IWD2BGT-DialogGet.tp2 --yes

 

the corresponding .tp2 would have

BACKUP ~backup~ //note this will be in top level of FROM game directory
AUTHOR ~~

BEGIN ~Dialog Fetch Process~
COPY_EXISTING_REGEXP ~.*\.dlg~ ~override~
SPRINT file ~%SOURCE_FILE%~
INNER_ACTION BEGIN
APPEND ~IWD2BGT-DialogGet.bat~ ~weidu %file% --text --out IWD2BGT-DialogGet~
END
BUT_ONLY

AT_NOW ~IWD2BGT-DialogGet.bat~

this builds the bat file with the necessary command line for each .d file corresponding to each dialog file to be printed with the text string rather than the dialog tlk string reference # and then runs it putting the resultant .d file for each inside the directory IWD2BGT-DialogGet

 

 

Go back to the higher level install process and have that directory transferred to the TO game. Then when you are ready for dialog files you can run COMPILE ~IWD2BGT-DialogGet~ from a tp2 there in the TO game and the entire directory will be compiled with any strings not matching anything in the existing dialog.tlk being added to the end.

of course you may find that there are triggers and actions to be adjusted but you can build the corrections portion as you find that out...

 

the problem I find with conversions is that they don't do this. It's wouldn't be that hard to pull the users dialog.tlk into a tra file for use with any strings not part of dialog files.

 

what you may find problematic are journal entries in both scripts and dialogs. These won't be converted to text and they don't have a specific offset. There is a way around it, but it isn't pretty... But first, get everything else working... then tackle that problem.

Link to comment

the other option for dialog files...

 

is to try this as a tp2 action and use it in conjunction with the .tra created from the dialog.tlk of the FROM game.

 

COPY_EXISTING_REGEXP ~.*\.dlg~ override
READ_LONG 0x0008 statenum  //4 (dword)  Number of states
READ_LONG 0x000c stateoff  //4 (dword)  Offset of state table from start of file
READ_LONG 0x0010 transnum  //4 (dword)  Number of transitions
READ_LONG 0x0014 transoff  //4 (dword)  Offset of transition table from start of file
READ_LONG 0x0018 strigoff  //4 (dword)  Offset of state trigger table from start of file
READ_LONG 0x001c strignum  //4 (dword)  Number of state triggers
READ_LONG 0x0020 ttrigoff  //4 (dword)  Offset of transition trigger table from start of file
READ_LONG 0x0024 ttrignum  //4 (dword)  Number of transition triggers
READ_LONG 0x0028 actoff	//4 (dword)  Offset of action table from start of file
READ_LONG 0x002c actnum	//4 (dword)  Number of actions
//get state string refs & replace with .tra pointers
FOR (index = 0; index < %statenum%; index += 1) BEGIN
 SET stateblock = (%stateoff% + (%index% * 0x10))  //stateblock is 0x10 bytes in length
 READ_LONG %stateblock% + 0x0000 actor_text		//4 (strref)  Actor response text (i.e. what the non-player character says to the party)
 SAY %stateblock% + 0x0000 @%actor_text%
END
FOR (index2 = 0; index2 < %transnum%; index2 += 1) BEGIN
 SET transblock = (%transoff% + (%index% * 0x20))  //transblock is 0x20 bytes in length
 READ_LONG %transblock% + 0x0000 flags			 //4 (dword)  Flags:
 PATCH_IF (%flags% BAND 0b000000001) BEGIN		 //bit 0: 1=Associated text, 0=no associated text
  READ_LONG %transblock% + 0x0004 transtext		//4 (strref)  If flags bit 0 was set, this is the text associated with the transition (i.e. what the player character says)
  SAY %transblock% + 0x0004 @%transtext%
 END
 PATCH_IF (%flags% BAND 0b000010000) BEGIN		 //bit 4: 1=Journal entry, 0=no journal entry
  READ_LONG %transblock% + 0x0008 journaltext	  //4 (strref)  If flags bit 4 was set, this is the text that goes into your journal after you have spoken.
  SAY %transblock% + 0x0008 @%journaltext%
 END
END
BUT_ONLY

but this is just theory. I've not actually tried it. shoot I've not actually tried any of it. tho most of it should be plausible based on experience of how things do work and behave.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...