Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Excel Add-In to Read/Write 2da files v1.6

Page: 1 of 2
 tk102
04-22-2005, 2:25 AM
#1
v1.6 released (9/27/06)
- Eliminated need for tlbinf32.dll to be present on computer
- Made 2da writing much faster

v1.5 (add-in) released (9/22/05)
- ThisWorkbook changed to ActiveWorkbook
- Distributed as .xla

http://www.starwarsknights.com/tools.php)

Instructions
1. Unzip the .xla file to wherever you like. Open Excel. Choose Tools: Add-Ins.
http://img.photobucket.com/albums/v170/tk102/xla1.jpg)
2. Browse to the .xla file.
http://img.photobucket.com/albums/v170/tk102/xla2.jpg)
3. Make sure the new Add-In is checked and click OK.
http://img.photobucket.com/albums/v170/tk102/xla3.jpg)
4. You can now Read 2DA and Write 2DA files using the File menu.
http://img.photobucket.com/albums/v170/tk102/xla4.jpg)
 Mav
04-22-2005, 2:39 AM
#2
WOW this is definetly going to help with .2da editing, awesome job tk!
 RedHawke
04-22-2005, 2:46 AM
#3
Very, very nice tk! :thumbsup:

This will definately help when doing massive 2da edits. :D
 General Kenobi
04-22-2005, 9:49 AM
#4
Ooh so sweet big T thanks man ! :elephant:

I love using Excel for stuff since I use it for most anything else table related.

I'm gonna play with this when I get home. :) Maybe this will aid me in going forward on a project I'm working on.
 Achilles
04-22-2005, 10:09 AM
#5
Chainz.2da is gonna be lovin' you. Excellent work on this!
 ChAiNz.2da
04-22-2005, 10:17 AM
#6
Originally posted by Achilles
Chainz.2da is gonna be lovin' you. Excellent work on this!
:emodanc:
Ahh....yeah... it's all goooood :D
 Bob Lion54
04-22-2005, 10:34 AM
#7
^^^^^^
Yea, but it was made AFTER the HUGE .2da conversion.

Great tool!!! I think "tk" should stands for "Tool Kreator."
 Keiko
04-22-2005, 10:58 AM
#8
Nice Job Tk!:cool:
 Darkkender
04-22-2005, 12:06 PM
#9
which version of MS excel will this be compatible with TK? Just a slight curiosity as I use an older version and some macros work and others don't. I know I can import them though.
 shosey
04-22-2005, 12:43 PM
#10
sweet! I like it, I like it a lot!
 Lorden Darkblade
04-22-2005, 12:44 PM
#11
Very very useful thing tk :D
Thanks! :p
 SoNico717
04-22-2005, 1:31 PM
#12
Great Job TK102, this is really usefull.

Thanks for sharing this with us :).
 tk102
04-22-2005, 3:19 PM
#13
Gee, I had no idea so many people would use this. I made it just to see if I could since I've been programming Excel macros lately. :p

Darkkender, I think it should work with Excel 97 and later.

The Write function, you'll notice, is significantly slower than KotOR Tool, so if anyone can come up with some optimizations to the macro code, feel free to post them.
 Daiko701
04-22-2005, 7:40 PM
#14
I am recieving an error when trying to run the write function macro as follows:

Microsoft Visual Basic:
------------------------
Run-Time error '53':

File not found: TLBINF32



------------------------

I am using Microsoft office 2000 Premium (Excel) with SR-1. I can open the .2DA files but when I try to write them I recieve the error as mentioned above. My Sys Specs:

Win XP Home SP2
AMD Athalon 2200+ 1.8 GHz
512 MB DDR SDRAM
ATI 9550 128 bit 256 MB (Bios flashed to 9600 Pro 256 MB)
SB Audigy 2 LE 24 bit sound
All Latest updates for all.

I would love to be able to use this tool, yet I do not know why I am experiencing this. Any ideas, suggestions?


Edit*BTW great work on the tool, and thanks. Other than above it is superb.
 Achilles
04-22-2005, 7:46 PM
#15
I'm getting it too (already sent my specs to Tk102), but I'm not too worried about it. Even though you get the error, the macro appears to be saving the changes. All's well that ends well I guess :D
 Jeff
04-22-2005, 7:49 PM
#16
This is sweet TK! Good job, I love all the programs you make. Keep up the good work! :D
 L33T-THX-1138
04-22-2005, 9:24 PM
#17
it seems easy enough to figure out but,i dunno where to get this "excel" from n e help would be much helpful thanks in advance
 General Kenobi
04-22-2005, 9:35 PM
#18
Originally posted by L33T-THX-1138
it seems easy enough to figure out but,i dunno where to get this "excel" from n e help would be much helpful thanks in advance

Microsoft Excel (Usually contained within Microsoft Office) ;)
 tk102
04-22-2005, 11:16 PM
#19
TLBINF32.dll is normally found in your C:\WINDOWS\SYSTEM32 or C:\WINNT\SYSTEM32 folder. Do a search for that file.

If you find it, try this

(from your taskbar)
Start: Run: regsvr32 tlbinf32.dll

If you're getting the error, I wouldn't expect the .2da file to be written correctly.
 tk102
04-22-2005, 11:38 PM
#20
Here is a download link for tlbinf32.dll if you don't have it.

http://www.ezgoal.com/dll_files/tlbinf32.zip)

Unzip the .dll to your System32 folder and do the regsvr32 command as mentioned in the previous post.
 Daiko701
04-23-2005, 4:03 AM
#21
Thank you so much tk102, the tool works great. You provide better support than Microsoft lol. Beauty of a program you have made here. Now it should be easy as 1-2-3 to make all of the mods I use compatible (finally, whew).
 Darkkender
04-23-2005, 9:35 AM
#22
Originally posted by tk102
Darkkender, I think it should work with Excel 97 and later.


:elephant: :elephant: How did you know that was the version I used.:p

I personally like this for 2da's as I've started taking an interest in NWN modding or more in particular getting the hang of how they mod around some of the hardcoded elements. I'm starting to think with the proper usage of scripting we can write our own include files that provide the ability to use custom 2da files. Also I would be interested in figuring out how the game would recognize ".HAK" files and having them in the proper overide system. If we can do this it may take KOTOR I & II modding to a whole new level.
 stoffe
04-23-2005, 10:35 AM
#23
Originally posted by Darkkender
I'm starting to think with the proper usage of scripting we can write our own include files that provide the ability to use custom 2da files.


I doubt this is possible in KotOR beyond altering the 2DA files already used by some scripting functions. Unfortunately the Get2DAString() function in NWN NWScript is not present in the KotOR variant. NWScript has undergone a fair number of changes in the NWN --> KotOR transition.

Originally posted by Darkkender

Also I would be interested in figuring out how the game would recognize ".HAK" files and having them in the proper overide system. If we can do this it may take KOTOR I & II modding to a whole new level.

Unless you are making your own modules, using hakpaks would be of limited use, since they need to be specified for each module that use the content within them.
The hakpak filename has to be set in the Mod_Hak field in the module.ifo file for all modules using it. They don't work on the global scope like the Override folder does.

Provided that the hakpak functionality still remains available in the KotOR engine, that is. I haven't tested it.

(Hakpaks are the preferred means in NWN of storing custom content (models, tilesets etc) associated with specific individual modules. They are essentially just ERF files with a .hak suffix placed in the "hak" folder.)
 tk102
05-03-2005, 2:40 AM
#24
v1.1

Made some small tweaks to the macro to get it to write appearance.2da without crashing. (Thanks for bringing that to my attention Achilles.) It's still takes my PC about 100 seconds to write the whole thing. :rolleyes:

Also added a little progress notification in the status bar of Excel during writing, and a Freeze Panes (for column and row headers) after a Read.
 Xcom
05-03-2005, 5:22 PM
#25
Originally posted by tk102
It's still takes my PC about 100 seconds to write the whole thing. :rolleyes:


I wonder if that's due to the fact that it's a macro, or because it's Visual Basic?
I don't have Excel on this rig, so I can't give it a spin, but I've been working on my own, automatic 2da merger, and it's pretty fast when writing (well, about the same speed as Fred's 2da editor), so I guess it's macro thing.
 tk102
05-03-2005, 7:03 PM
#26
There's probably some tricky technique of creating a hash table in Visual Basic for Applications to determine if values have already been written, but I haven't figured it out yet. :)
 Shimaon
05-03-2005, 7:30 PM
#27
Me love you long time.

This ought to be very useful until we get copy and paste for multiple rows in KT.

^^

Thanks TK!
 tk102
05-04-2005, 12:37 AM
#28
v1.2

Fixes a v1.1 bug regarding **** values that occurred if the first value in the 2da file was a ****. (Thanks Achilles)

@Shimaon: Your welcome, but um, no thanks. :)
 Achilles
05-04-2005, 12:53 AM
#29
Thanks for fixing that! I just read and wrote appearance.2da again and everyone still has their weapons :mob:
 tk102
05-04-2005, 2:40 AM
#30
v1.3

Astrisks are expanded by Excel's Find function, which was resulting in bad writes if the first value wasn't "****".

A potential for bad writing exists if cells contain astrisks (other than "****" which is handled specially). See macro text for details.
 tk102
08-15-2005, 11:34 PM
#31
v1.4 released

Fixed a bug that was causing "Object Variable Not Set" in the Write2da function.
 General Kenobi
08-15-2005, 11:37 PM
#32
TK can you post up a linkie to your site??? I lost my favs in my 2000 to 2003 upgrade.

Thanks a million for this one I'm gonna experiment with it on a new mod i'm working on :D

:ben:
General Kenobi
 tk102
08-16-2005, 12:00 AM
#33
I don't really have a site other than starwarsknights.com unless you count my KeyTweak (http://webpages.charter.net/krumsick) site. :)
 Langy
08-16-2005, 4:20 PM
#34
v1.4 released (8/25/05)

Wow! It's a release from the future! That's absolutely amazing, man!

In all seriousness, this macro kicks major ass. KOTOR Tool is horrible for editing 2DAs in any major way, and being able to edit them in Excel is amazingly useful.
 cry_of_paine
08-20-2005, 1:31 AM
#35
This is exactly what I was looking for. I did have to make one slight fix though. I put the routine into my personal.xls file, so that it's always available. So then the "ThisWorkbook" that you used to write the file gave me errors. I just changed that to "ActiveWorkbook" though, and it ran perfectly. I even gave it custom buttons on my toolbar to run it. You might think about doing all that and package it as an xla add-in (I'd tell you how if I could remember).

Edit tk102: Thanks for the fix and good idea about the .xla -- now I'll have to see how that works. :)
 tk102
09-22-2005, 6:29 PM
#36
v1.5 Released (Excel Add-In)

- Now uses ActiveWorkbook rather ThisWorkbook in macro (as per above)
- Distributed as an Excel Add-In (.xla) rather than a Module (.bas) file.

Instructions
1. Unzip the .xla file to wherever you like. Open Excel. Choose Tools: Add-Ins.
http://img.photobucket.com/albums/v170/tk102/xla1.jpg)
2. Browse to the .xla file.
http://img.photobucket.com/albums/v170/tk102/xla2.jpg)
3. Make sure the new Add-In is checked and click OK.
http://img.photobucket.com/albums/v170/tk102/xla3.jpg)
4. You can now Read 2DA and Write 2DA files using the File menu.
http://img.photobucket.com/albums/v170/tk102/xla4.jpg)
 Fred Tetra
09-23-2005, 12:34 AM
#37
v1.5 Released (Excel Add-In)

- Now uses ActiveWorkbook rather ThisWorkbook in macro (as per above)
- Distributed as an Excel Add-In (.xla) rather than a Module (.bas) file.


Excellent work!!!

I was going to try setting it up as an XLA; thanks for saving me the time! :D
 tk102
09-23-2005, 9:19 AM
#38
Ooh Fred. That's a bad pun. :tsk:
 Darkkender
09-23-2005, 2:27 PM
#39
But a deserving Pun. :p
 tk102
09-27-2006, 4:30 PM
#40
v1.6 released (9/27/06)
- Eliminated need for tlbinf32.dll to be present on computer
- Made 2da writing much faster
 Ferc Kast
12-28-2007, 10:15 PM
#41
For some reason, it won't allow me to write my 2da file at all from Excel. Could it be that I have 3 2da files open at the same time?
 Gavroche
02-20-2008, 2:14 AM
#42
Yep! I had a quick question about this add-in, is there any chance that it would be compatible with OpenOffice Calc? I guess I could just use the GFF<->XML conversion utilities (as far as I remember, .2da are gff files, aren't they?) and then open the .xml with OpenOffice... Anyway, I'm wondering.


<edit />Nope, it seems the GFF<->XML tool won't work with .2da. Well, now I hope somebody will come up with an answer "^^
 Darkkender
02-20-2008, 10:13 AM
#43
2da files are 2da files. 2da stands for "Two Dimensional Array". GFF files are a generic file format that handle a variety of different ingame objects such as characters, doors, waypoints, items, placeables, encounters, & more. GFF stands for "Generic File Format". This macro download simply converts the 2da file into an excel spreadsheet since a 2da is a simple spreadsheet. Meanwhile your GFF files are a more complex structure based file with nodes and subnodes withing the structures.
 tk102
02-20-2008, 2:23 PM
#44
@Gavroche: stoffe asked the same thing about Open Office support. At some point I should try out Open Office and take a look at what macro support is offered. Unfortunately, the XLA isn't handled as-is.
 Ray Jones
02-20-2008, 2:30 PM
#45
Open Office has macro support, some own Open Office Basic and Python based AFAIK.
 Gavroche
02-20-2008, 2:30 PM
#46
@Darkkender: Ok, thanks for the informations. Quite interesting, though it's no good news for me "^^

@tk102: Yes, I just tried and got kicked out by OOCalc :p Thanks anyway for the answer.
 JCarter426
05-31-2008, 4:38 PM
#47
Hmm...I'm guessing it doesn't work with Excel '07. Or if it does, then I fail miserably. :p
 Master Zionosis
06-03-2008, 6:21 PM
#48
Hmm...I'm guessing it doesn't work with Excel '07. Or if it does, then I fail miserably. :p


I've come to the conclusion that it does not work, after about half an hour of trying, shame... Maybe tk will release an update... But then again, maybe not... lol.
 Master Bacon
08-05-2008, 4:38 PM
#49
Is there a manual or a how to merge two 2da files with Tk102's ingenious mod? Or am I in the wrong place?
 ChAiNz.2da
08-06-2008, 5:53 AM
#50
Is there a manual or a how to merge two 2da files with Tk102's ingenious mod? Or am I in the wrong place?

For merging purposes, stoffe's 2DA Converter/Merger Tool (http://www.starwarsknights.com/tools.php#gmt) might be an easier solution for you :)
Page: 1 of 2