View Full Version : Civ4 XML Editor


General Tso
Apr 07, 2008, 11:42 AM
This is an XML editor for Civ4 that is extremely easy to use. It should cut the amount of time you spend editing XML files dramatically. It sorts the data from the xml file and makes it easier to read. You just have to click on a given item to bring up a dialog box that allows you to edit it.

Once you open the editor, try clicking on the Help button for some ideas on how to use it.

The version is now 1.13 - To use it, just download it, open the folder, and click on the "Civ4 XML Editor" shortcut.

Improvements in 1.13:
The editor now does a much better job of loading files that have been named differently than the ones that came with the game. If you're editing a mod with non standard file names you shouldn't have to use the "Type" button. You probably won't need the "Type" button at all, but I left there just in case.

Other recent improvements:
The editor now loads an XML file if one is passed to it when it opens. That means you can now make Civ4 XML Editor your delault program for xml files and double clicking on a file will open it within the editor. If you want to move your Civ4 XML Editor program folder, it would be best to do it before making it the default program for your xml files. It's a Windows thing.
You can also use the "Send To" option in the Windows right click menu to load files. To make the "Send To" option work, you will need to drag a shortcut of the editor into your SendTo folder.
Added support for negative numbers. (I don't know how I missed that one.)
Added Clone and Delete to the Class List. These commands can be used to quickly add or remove items like units or buildings in the game. You will still have to edit some values in it's Element List to finish the item, but the editor makes that easy.
Added new edit options to the Element List: Add, Clone, and Delete.
Added "Show Edit Help" option - when it's active the various edit options are displayed for each element.
Added option for larger text box when editing text.
Added some code to handle different types of file encoding.
Added the ability to search within the class list and the element list.


Download here:
Civ4 XML Editor Download (http://forums.civfanatics.com/downloads.php?do=file&id=9412)


You can check out the screen shots below to see what the editor looks like.

Ambreville
Apr 08, 2008, 07:06 AM
I've never used an xml editor before. How do I get it to run though? I have the pyw file installed along with the Python interpreter... I can't seem to be able to open your application.

General Tso
Apr 08, 2008, 07:24 AM
The program should open when you double click on it's icon (Civ4 XML Editor.pyw). What happens when you click on it? Do you get any messages?

Ambreville
Apr 08, 2008, 07:41 AM
There's no icon that I can see on my desktop.

General Tso
Apr 08, 2008, 07:43 AM
There is a simple text file included with the program that explains how the program works. Since the information in that file is pretty basic, I thought I would give a better description on how get started here.

1. Use the load button to load an XML file. XML\Units\Civ4UnitInfos.xml would be a good one to start with.

2 The left side box now contains a list of all the units in the game. They are displayed as UNIT_LION, UNIT_BEAR, ..... etc. You can change the current unit by clicking on this list.

3. The right side box contains a list of the elements for the selected unit. Any data element can be edited by clicking on it. This brings up a dialog box which allows you to quickly change the value. There are four kinds of dialog boxes. Integer, Floating Point, Boolean, and Text.

4. When you are finished, click on the save button. This will bring up a dialog box that allows you to save the file.

Ambreville
Apr 08, 2008, 07:44 AM
What load button? Don't you have to launch the application first to get a "load button"?

Ambreville
Apr 08, 2008, 07:46 AM
Does it work for BtS, by the way?

General Tso
Apr 08, 2008, 07:51 AM
When you download the program there should have been two files located inside a zip file. Unzip these to your desktop. One file is a short text file with some information about the program, it's called "Civ4 XML Editor Help.txt". The other file is the program itself, it's called "Civ4 XML Editor.pyw". This program doesn't need to be installed, just double click on it and it should run, but you do need to install the Python interpreter before running the program.

General Tso
Apr 08, 2008, 07:53 AM
1. Yes it works with BTS. I havn't tried it with the other versions of Civ4, but it should work with them also.

2. The load button is located within the the program. The directions above should become clear once you open the program. I'll try to post a screen shot tonight if I get a chance. That might make things a little clearer. The computer I'm on right now doesn't have any software to reduce a screen shot down to a manageable size.

Ambreville
Apr 08, 2008, 07:55 AM
Nothing happens when I double-click on the pyw file. In what folder should that file be installed?

I installed the Python interpreter in the Programs File folder.

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

EDIT -- I placed the pyw file on my desktop. Doesn't launch from there either.

Ambreville
Apr 08, 2008, 07:57 AM
The pyw file is listed as "Python File (no console)" in the directory. Is there another application needed here?

General Tso
Apr 08, 2008, 08:23 AM
If Python was installed properly then the Python interpreter should automatically run the program when you double click on the icon.
If you don't mind taking a moment to try something, we might be able to find the problem.
Go to Start menu \ Programs \ Python 2.5 \ IDLE (Python GUI)
This should open IDLE which is the default Python editor.
Use the file menu in IDLE to open "Civ4 XML Editor.pyw" - you will have to move to the folder where it is located first.
With the IDLE window active press F5 (function key). This will cause the program to run. IDLE will also open a second window (other than the program window) - look at this window and see if there are any error messages.
Let me know what happens and I'll try and straighten it out.

Ambreville
Apr 08, 2008, 08:37 AM
When I hit F5, the editor returns the following error msg:

Traceback (most recent call last):
File "C:\Documents and Settings\Administrator\Desktop\Civ4 XML Editor.pyw", line 9, in <module>
from win32ui import CreateFileDialog
ImportError: No module named win32ui

General Tso
Apr 08, 2008, 08:42 AM
Thanks Ambreville,
I think I see the problem now, I'm using some third party software that must include that module. Let me try and find a solution and I'll post an updated version.

Ambreville
Apr 08, 2008, 08:43 AM
Thanks for your time. TTFN.

ClassicThunder
Apr 08, 2008, 09:02 PM
General Tso try this out Py2exe.org (http://www.py2exe.org/).

It's pretty easy and prevents people from having to download stuff onto their computer to use your app. A big turn off for man such as myself.

ClassicThunder

Jesus Civs
Apr 09, 2008, 06:32 AM
General Tso try this out Py2exe.org (http://www.py2exe.org/).

It's pretty easy and prevents people from having to download stuff onto their computer to use your app. A big turn off for man such as myself.

ClassicThunder

Can you elaborate?

General Tso
Apr 09, 2008, 11:07 AM
Thanks for the info ClassicThunder, I should have a new and improved version up shortly.

ClassicThunder
Apr 09, 2008, 02:57 PM
@General Tso

No problem I'm glad to help.

@Jesus Civs

That script can compile another python script into an easily distributable .exe. Unfortunately its a little messy but you no longer need to have the python translator. Only the .net framework

Jerrymander
Apr 09, 2008, 02:58 PM
Use notepad.

newbs.

Commander Bello
Apr 10, 2008, 04:18 AM
@ General Tso:
Downloaded and run a quick test. Everything seems to work just fine.

Thanks for your efforts and :goodjob:

Edit:
@Jerrymander:
Your posting was neither helpful nor very polite towards the creator of that program. As long as you cannot contribute to any improvement, it would be nice of you to abstain from such postings in the future.

Jesus Civs
Apr 10, 2008, 04:21 AM
Use notepad.

newbs.

What do you mean by using notepad? I tried both options above and its all Pete Tong.

Commander Bello
Apr 10, 2008, 04:29 AM
What do you mean by using notepad? I tried both options above and its all Pete Tong.
Did you download the updated version 1.03 from the initial posting?

For me it worked to extract it to the place where I wanted it to be and then just to run this little nice program.
The load/save/change/help buttons are on the right side, but are easy to find, and it shows you and allows you to easily change the values of a given .xml-file.

Jesus Civs
Apr 10, 2008, 05:29 AM
Did you download the updated version 1.03 from the initial posting?

For me it worked to extract it to the place where I wanted it to be and then just to run this little nice program.
The load/save/change/help buttons are on the right side, but are easy to find, and it shows you and allows you to easily change the values of a given .xml-file.

Ah, ok, I'll try it again when I get home.

Can someone post a screenshot for future downloaders?

General Tso
Apr 10, 2008, 06:57 AM
Commander Bello,
Thank you for the kind words. I hope you can get some use out of the editor.

Jesus Civs,
I'll try to post a screenshot tonight, the computer I'm on right now doesn't have any software for reducing the size of a picture. I'll try to give an an example for now. If you load the Civ4UnitInfos.xml file into the editor, you would end up with a list of units on the left side and a compact list of the data for the selected unit on the right. You can quickly select different units then scroll through the data for that unit and change it. With notepad you have to do a lot more searching.

Jesus Civs
Apr 14, 2008, 03:31 PM
Hi

I downloaded v 1.03 but nothing happens and the log file says the following:

Traceback (most recent call last):
File "Civ4 XML Editor v103.py", line 10, in <module>
File "win32ui.pyc", line 12, in <module>
File "win32ui.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

Any ideas what I can do?

Thanks.

General Tso
Apr 15, 2008, 07:29 AM
Jesus Civs,
It looks like the program is having a problem loading a library file needed by the dialog boxes that are used to load and save files. I have only tested this program on Vista and XP, are you using an older version of windows?

Jesus Civs
Apr 18, 2008, 09:44 AM
Jesus Civs,
It looks like the program is having a problem loading a library file needed by the dialog boxes that are used to load and save files. I have only tested this program on Vista and XP, are you using an older version of windows?

I'm using XP with SP2 and all that jazz.

Is it just a case of downloading those dlls? What directory should I save them in?

General Tso
Apr 19, 2008, 08:19 AM
Jesus Civs,
If the win32ui.pyd file is missing from the program folder that would cause that error message to be displayed. Is the file win32ui.pyd in the program folder?
If that file is missing, try downloading the program again.

Is anybody else having any problems getting the editor to run? I'll be uploading a new version soon - it has several major improvements. If a lot of people are having problems in getting the program to run, then I'd better concentrate on fixing that first. :rolleyes:

General Tso
Apr 19, 2008, 03:15 PM
I just posted a new version (v107f).

New things for v107:
1. Added the ability to search within the class list and the element list.
2. The editor now remembers it's window size and file path between uses.
3. The element list now tries to stay centered on the current element when the user clicks on a different item in the class list. This makes it easier to
cycle thru different class entries and change a given element value in each one. (Like cycling thru a bunch of units and changing their "iMove" value.)
4. Improved graphics. Removed some graphical glitches and small bugs.

I'd be interested in any feedback regarding the editor.

Jesus Civs
Apr 19, 2008, 04:19 PM
Jesus Civs,
If the win32ui.pyd file is missing from the program folder that would cause that error message to be displayed. Is the file win32ui.pyd in the program folder?
If that file is missing, try downloading the program again.


Hi, the file is there alright (see attached screenshot which shows the unzipped directory). I downloaded the newer version, but still the same.

I'm still getting the same error message.

Any more ideas? Thanks btw for helping!

General Tso
Apr 19, 2008, 06:14 PM
Jesus Civs,
I'm glad to help. I noticed in your screenshot that you have 2 "Civ4 XML Editor v107f" directories. That's different then my computer (I only have 1). This might have the shortcut confused. Try double clicking on the program file itself. Thats "Civ4 XML Editor v107f.exe". Let me know what happens.

General Tso
Apr 20, 2008, 11:49 AM
Jesus Civs,
I just noticed another problem. In the picture below I have your screen shot and my own window open at the same time. There are 2 thing that are incorrect in your screen shot. First the program file (Civ4 XML Editor.exe, size = 48KB) doesn't have the .exe extension like it should. Second there is another file(Civ4 XML Editor.exe, size = 1KB) that shouldn't even be there! (And why is it listed as a text file?) I'd recommend downloing the program again and making sure that your new folder looks like my picture below. Then double click on the 48KB file "Civ4 XML Editor.exe". Please let me know what happens, hopefully this will solve your problem.

Jesus Civs
Apr 21, 2008, 04:03 AM
Jesus Civs,
I just noticed another problem. In the picture below I have your screen shot and my own window open at the same time. There are 2 thing that are incorrect in your screen shot. First the program file (Civ4 XML Editor.exe, size = 48KB) doesn't have the .exe extension like it should. Second there is another file(Civ4 XML Editor.exe, size = 1KB) that shouldn't even be there! (And why is it listed as a text file?) I'd recommend downloing the program again and making sure that your new folder looks like my picture below. Then double click on the 48KB file "Civ4 XML Editor.exe". Please let me know what happens, hopefully this will solve your problem.

Ok, I'll remove the text file. That was generated automatically when I ran the 48k exe file. It's the log file I think.

Cheers. Will provide more feedback later when I get home.

Jesus Civs
Apr 21, 2008, 03:50 PM
Hi again,

I tried all those ideas you mentioned but no avail. I downloaded a fresh copy and no luck.

When I deleted the text file "Civ4 XML Editor v 107f.exe" it reappeared once I ran the application again, and this is the file that is producing the following message:

Traceback (most recent call last):
File "Civ4 XML Editor v107f.py", line 10, in <module>
File "win32ui.pyc", line 12, in <module>
File "win32ui.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.


Does anyone else have/had the same problem?

Zebra 9
May 01, 2008, 06:21 PM
Nice. If I'm understanding correctly this is python based, so I was thinking that I could use the code to read XML file for my MOD Maker/World Builder. So could you PM me the original source? :thumbsup:

General Tso
May 02, 2008, 06:52 AM
Zebra 9,
I'm working on an improved version of the program that allows the user to clone and delete parts of the XML file. When I upload that I'll also include the source code (hopefully within the next week).
I'm also trying to find the solution to a problem that some users are having when trying to run the program in windows XP. The above post by Jesus Civs explains the problem. I would like to fix that before uploading the next version. Does anybody have any ideas on what could be causing it? I'm using Py2exe to convert the python program to an executable. I think py2exe is assuming that there will be a certian dll file on the user's computer, but it's not on all computers.

Zebra 9
May 02, 2008, 07:25 PM
Ok, thanks.

GarretSidzaka
May 04, 2008, 01:36 PM
cool editor!! remember to also add it to the CFC file database :)

one feature i would like is support for keyboard arrows

General Tso
May 05, 2008, 06:55 AM
GarretSidzaka,
Thanks for the good idea concerning the file database. As mentioned above I'll be uploading a new version soon. I'll place that one in the database.

The keyboard arrows work OK for me. What kind of problems are you having?

GFO_Anubis
May 06, 2008, 06:09 AM
Nice program! runs fine on my computer.. could save some time when editing XML.. are you planing on makeing it able to create new elements in the near future.. would make it a nice tool to have when reskining units or createing new...

GarretSidzaka
May 07, 2008, 02:55 PM
GarretSidzaka,
Thanks for the good idea concerning the file database. As mentioned above I'll be uploading a new version soon. I'll place that one in the database.

The keyboard arrows work OK for me. What kind of problems are you having?

i wasnt able to scroll with the arrow keys while in the program. i just checked its still doing it for me, but the PgUP and PgDN still work

General Tso
May 08, 2008, 07:38 AM
Is it possible that the NumLock key is on? Sorry, if you already checked this, I just wanted to make sure.

Zebra 9
May 09, 2008, 07:12 PM
Zebra 9,
I'm working on an improved version of the program that allows the user to clone and delete parts of the XML file. When I upload that I'll also include the source code (hopefully within the next week).
I'm also trying to find the solution to a problem that some users are having when trying to run the program in windows XP. The above post by Jesus Civs explains the problem. I would like to fix that before uploading the next version. Does anybody have any ideas on what could be causing it? I'm using Py2exe to convert the python program to an executable. I think py2exe is assuming that there will be a certian dll file on the user's computer, but it's not on all computers.
I think your right about the assumed dll. If you want we could try converting it to an exe on a windows XP system to see if it works then.

If needed, I have an XP system with python 2.5, win32, py2exe, and am willing to download additional python addons and compile this for you.;)

General Tso
May 10, 2008, 09:51 AM
Thanks for the offer Zebra 9, but I already tried that and it didn't work. If you would like to give it a shot anyway, I'll be uploading the source code with a new version in the near future. I guess it's always possible that a different computer might provide different results. All I ask is that you don't change the source code in any way.


For the record, I have compiled the program on two computers - one Vista and one XP. I have attempted to run the program on 6 computers - one Vista and five XP. It runs fine on all but one computer, and that computer just had a fresh install of XP (along with all of the updates). It looks like the editor requires a DLL file that doesn't come with XP, but get installed by some other piece of software at a later time.


Once I release the source code. Another possible solution would be to have people that are experiencing the problem download the Python interperter and just run the source code. If somebody wants to try it I'll provide the link and instructions.

General Tso
May 10, 2008, 04:04 PM
I just posted a new version of the editor. The link, along with a description are located in the first post of this thread.

GarretSidzaka
May 10, 2008, 04:12 PM
grabbing it now :)

GarretSidzaka
May 10, 2008, 04:15 PM
thanks, now it works great :goodjob: im gonna try to use it now to finish up my mod :clap:

Balderstrom
May 11, 2008, 02:29 PM
Just download SysInternals File Monitor, run that, then run the compiled editor, watch the File Monitor display: it will list which dll's are being accessed.
It's probably the vb6 runtime dll's.

Zebra 9
May 12, 2008, 07:15 PM
Huh, thats strange, well I'm DLing. Is alright with you if I use the xml reading code to read XML files for my MOD Maker? I will give you full credit for the reader code.

General Tso
May 12, 2008, 09:57 PM
Sure, no problem.

Fujisan
May 13, 2008, 08:31 AM
Well, I have the same problem as Jesus Civs. :(

The programm shows an error and write the following lines in the log file:
Traceback (most recent call last):
File "Civ4 XML Editor v109.py", line 15, in <module>
File "win32ui.pyc", line 12, in <module>
File "win32ui.pyc", line 10, in __load
ImportError: DLL load failed: 指定されたモジュールが見つかりません。

May be it happens because I use Japanese Windows OS? I switched the default language for non-unicode programms to English, but it didn't help... :confused:

General Tso
May 13, 2008, 08:52 AM
While I have an idea what is causing the problem, I can't find any information on how to fix it.

There is a way to possibly get around the problem. If you or JesusCivs would like to try it, I'd be interested in hearing what happens.

First you need to download and install the Python interpreter. It's located at: http://www.python.org/download/releases/2.5.2/. Most people will want the version labeled "For x86 processors". Then double click on the Civ4 XML Editor v109.pyw icon. It's located in the "Source Files" folder located within the "Civ4 XML Editor v109" folder.

If anybody tries this please let us know what happens, it would be a big help for other people experiencing the same problem.

Fujisan,
I don't think that the "default language for non-unicode programs" setting would cause this problem. Since you're using the Japanese version of Windows, I'd also be interested in hearing how the editor handles the encoding within your XML files.

Headlock
May 13, 2008, 12:20 PM
Use notepad.

newbs.

lol!

i use notepad++ myself. Ill give this a shot though.

hdk

General Tso
May 13, 2008, 05:43 PM
Headlock,
Let me know what you think of the editor. I prefer using my editor for Civ4 files over notepad++, but then I'm probably a little biased.

Fujisan
May 16, 2008, 12:51 PM
First you need to download and install the Python interpreter. It's located at: http://www.python.org/download/releases/2.5.2/. Most people will want the version labeled "For x86 processors". Then double click on the Civ4 XML Editor v109.pyw icon. It's located in the "Source Files" folder located within the "Civ4 XML Editor v109" folder.

If anybody tries this please let us know what happens, it would be a big help for other people experiencing the same problem.


Ok. I did as you wrote. And "EditorGlobals.pyc" (9KB) appeared in the "Source Files" folder.

But the Editor still does not work. :(

I wonder, does this problem relate somehow with XML-errors on non-english Windows (http://forums.civfanatics.com/showthread.php?t=256116), about which I reported in the Civ4 BTS - Bug Reports?

General Tso
May 16, 2008, 01:44 PM
Fujisan,
Thanks for trying that.
It probably doesn't have anything to do with the XML-errors issue, since the program fails before it attempts to load an XML file. You would have to run the program from within the Python editor to get the actual error message.

General Tso
May 16, 2008, 01:58 PM
GarretSidzaka,
I think I now see what you where talking about concerning the keyboard arrows. There was no keyboard command to edit an item once the arrow keys where used to select it. I am working on a new version and the Enter key can be used to edit an object in the Element List.

The next version will also have the ability to clone and delete items in the Class List. That means you can do things like add a new unit to the game by just pressing the insert key when you have a similar unit selected. You will still have to edit some items in it's Element List to finish the unit, but the editor makes that easy.

Yakk
May 16, 2008, 03:18 PM
Any way to delete elements?

Zebra 9
May 16, 2008, 07:43 PM
If you want the error messages without using the python console just addsys.stderr = open("errors.txt", "w")then have him send errors.txt to you.

General Tso
May 17, 2008, 10:42 AM
Zebra 9,
Thanks for the info. I kind of thought something like that might be available, but I was to lazy to look it up.:rolleyes: I'll add that line to future versions of the program.

Yakk,
Yes, an element can be deleted if it is in a list (such as the "UniqeNames" list for a great general). Use the "Show Edit Help" option to see what is available. I didn't make other items deleteable because that would make the file unreadable by Civ4 (I think). If you run across something that can't be deleted, but you think it should, let me know and I'll look into it.

Yakk
May 17, 2008, 11:04 PM
By "elements" I mean nodes like entire units.

Not delete components of a unit. That would cause problems. :)

Being able to copy a unit (or set of units) from one file to another, or delete some units in a file, makes creating modular XML modifications much easier.

General Tso
May 18, 2008, 09:04 AM
I just added that feature to the version I'm working on now. I'll test it for a little bit, and if everything works OK, I'll upload it shortly.

General Tso
May 18, 2008, 11:28 AM
I just uploaded a new version. Improvements include the ability to clone and delete objects in the Class List. These commands can be used to quickly add or remove items like units or buildings in the game.

deanej
May 25, 2008, 08:53 AM
Could it be possible to add support for integer values that aren't between 0 and 100? Also, how do you clone/delete objects in the class list? There's no right click menu. The ability to use more XML files (anything that doesn't use type tags) and to rearrange items in the class list (needed for CivilizationInfos and LeaderHeadInfos).

General Tso
May 25, 2008, 01:07 PM
You can enter larger integer values by clicking on the "Entry Box" button when the edit integer dialog box is up.

To clone and delete items in the class list, use the insert and delete keys.

The editor already recognizes all of the stanard XML files in the game and you can use the type button to look at any other files.

You can see more info about these things by clicking on the help button.

deanej
May 26, 2008, 09:27 PM
Negative values, however, do not seem to be supported. At least it didn't work when I tried. The text box didn't accept the minus sign.

Yakk
May 27, 2008, 08:38 AM
Try entering in a value near 2^32? :)

General Tso
May 27, 2008, 01:15 PM
Negative values, however, do not seem to be supported. At least it didn't work when I tried. The text box didn't accept the minus sign.


Thanks for pointing that out, I can't believe that I never noticed that. :blush:

I'll come out with a fix sometime in the near future.

chimaerarouge
May 31, 2008, 03:30 PM
I recently had issues with starting this program. It took some digging but I discovered that I did not have the mfc71.dll file installed. As soon as I got it off a google search and dropped it in my windows/system folder, the program started right up.

*edit* Just to clarify I was experiencing the same error messages that others in this thread were mentioning.

General Tso
Jun 01, 2008, 07:27 AM
Thanks for the info chimaerarouge, I'll be interested in seeing if this helps anyone else. I hope to upload a new version of the program today. I'll include that file in the program folder so people can try that fix if they want to.

General Tso
Jun 01, 2008, 10:14 AM
I just uploaded a new version on the editor. It now supports negative numbers, and the help text has be improved.

I also included the mfc71.dll file that chimaererouge mentioned. It's in the program folder. I'm hoping that the program will just look for it there, and this will fix the problem. If anybody that was experiencing the startup problem tries this version, I'd be interested in hearing about the results.

General Tso
Jun 08, 2008, 10:30 AM
I just uploaded a new version - 1.12.

Improvements in 1.12:
The editor now loads an XML file if one is passed to it when it opens. That means you can now make Civ4 XML Editor your delault program for xml files and double clicking on a file will open it within the editor. If you want to move your Civ4 XML Editor program folder, it would be best to do it before making it the default program for your xml files. It's a Windows thing.
You can also use the "Send To" option in the Windows right click menu to load files. To make the "Send To" option work, you will need to drag a shortcut of the editor into your SendTo folder.

Dancing Hoskuld
Jun 24, 2008, 08:57 PM
Hi, I just tried to open the xml in the ExoticAnimal Mod using this editor. It won't open them. Something truncates the name of the file after I select them using the LOAD button.

"ExoticAnimals-0.3_CIV4ArtDefines_Unit.xml" becomes "icAnimals-0.3_CIV4ArtDefines_Uni" which the editor can't find.

General Tso
Jun 25, 2008, 08:01 AM
From your description I'm guessing the editor opened the file with no problems. It just doesn't know how the sort the data because the file has a non standard name. There is nothing wrong with it having a non standard name, you just have to tell the editor how to sort the data using the "Type" button. After clicking on the "Type" button, enter the class type for that file (probably "UnitArtInfo") then click accept. That should make everything display properly.

You can also get some more information about the "Type" button by clicking on the "Help" button.

The editor should of came up with a message box indicating that it couldn't find a "icAnimals-0.3_CIV4ArtDefines_Uni" class, and that you should click on the "Type" button to enter a class type. Is it possible that the message is behind your main window for some reason? If so there will be two buttons with the editor icon in your taskbar.

General Tso
Jun 25, 2008, 03:29 PM
I just loaded a new version - 1.13.

The editor now does a much better job of loading files that have been named differently than the ones that came with the game. If you're editing a mod with non standard file names you shouldn't have to use the "Type" button. You probably won't need the "Type" button at all, but I left there just in case.

sangeli
Jun 27, 2008, 07:08 PM
With v 1.09 I had trouble editting the unit info file in RTW. Does v 1.13 address the problem?

General Tso
Jun 28, 2008, 07:59 AM
The file uses non standard characters (at least for the USA and some other countries), but doesn't have an encoding statement. This causes problems when loading the file. I'll see if I can change some code to make it work without causing other problems - if so I'll upload an updated version sometime in the near future.

If you want to get it to work right away, try this:
Backup the file then, open the file in notepad (yuk!) and change the first line from this <?xml version="1.0"?> to this <?xml version="1.0" encoding="ISO-8859-1"?>. The file should then work OK in the Civ4 XML Editor.

Balderstrom
Jun 28, 2008, 09:23 PM
I noticed something odd with the unit file too, MetaPad was choking on it - first time I've seen something like that. I had to open it with ConTEXT editor.

Though it may of been an issue with my font, when I changed MetaPad to "Arial" it was loadable, though I hate non monospaced fonts for code.

timboobaa
Jul 01, 2008, 08:34 AM
General Tso,
would this program work for viewing customised models in game?
I've been reskinning some customised models which i downloaded from this site, and I'd like to see them inside the actual game, but i don't have a clue about programming language or hard stuff like that? I read a tutorial about it here but it did my brain in.

General Tso
Jul 02, 2008, 06:35 AM
General Tso,

would this program work for viewing customised models in game?

I've been reskinning some customised models which i downloaded from this site, and I'd like to see them inside the actual game, but i don't have a clue about programming language or hard stuff like that? I read a tutorial about it here but it did my brain in.

If I understand your question correctly - no you can't view models with this software. This program will only view the xml data for a given item.

timboobaa
Jul 02, 2008, 06:50 AM
If I understand your question correctly - no you can't view models with this software. This program will only view the xml data for a given item.

That's not exactly what i meant to say - I obviously use the Nif viewer and Max to view models. But then I need to see them in action, in a mod, in the actual game, to see if they work with their animations etc.

So I think what I meant to say was, with this tool, could you edit the xml data to add new units to a Civ, thereby adding your unit (including its' custom model/skin) to a mod. Then you could go into a game to see your unit in action.
Err, hope that kind of makes sense

General Tso
Jul 03, 2008, 08:09 AM
Yes you can add a new unit to the game with the editor. Just open the Civ4UnitInfos.xml file in the editor. Select a unit that's similar to the unit that you want to create and hit the insert button to clone it. You will now have two units with the same name. Edit the type element for a given unit to change it's name. Edit the other element values to change the unit as needed.

There is currently a minor display issue with the editor when cloning an item in the Class List. When you add a new class item (a unit in this case) and rename it, the Class List display doesn't update to show this. For now you can just click on the type button and then click on accept to redraw the screen.

timboobaa
Jul 03, 2008, 08:57 AM
Yes you can add a new unit to the game with the editor. Just open the Civ4UnitInfos.xml file in the editor. Select a unit that's similar to the unit that you want to create and hit the insert button to clone it. You will now have two units with the same name. Edit the type element for a given unit to change it's name. Edit the other element values to change the unit as needed.

There is currently a minor display issue with the editor when cloning an item in the Class List. When you add a new class item (a unit in this case) and rename it, the Class List display doesn't update to show this. For now you can just click on the type button and then click on accept to redraw the screen.
Okay thanks, I'll DL this and try.

timboobaa
Jul 03, 2008, 07:57 PM
This looks useful, though I can't use the 'Insert' key correctly with this because i've got a wierd kind of mini-keyboard - can you edit the hotkeys at all, otherwise perhaps it's time to get a proper keyboard

General Tso
Jul 03, 2008, 09:51 PM
I put it on my list of things to do, but I'm in the middle of working on my mod now. It might be a little while until I get around to it.

InternalShadow
Jul 16, 2008, 11:09 AM
Can't download:

"Warning: copy(./downloads//ec_tmp/civ4_xml_editor__v113.zip) [function.copy]: failed to open stream: Permission denied in /downloads.php on line 706
ERROR: File not found."

CivalGanjaman
Jul 18, 2008, 08:37 PM
Im trying to make a seperate XML editor, focusing on technologies Tso, would these be at all integratable?? Im using VB.

Also you any good with datasets as im stuck (self teaching very slowly...)

General Tso
Jul 19, 2008, 09:11 AM
Can't download:

"Warning: copy(./downloads//ec_tmp/civ4_xml_editor__v113.zip) [function.copy]: failed to open stream: Permission denied in /downloads.php on line 706
ERROR: File not found."

I just tried to download it and it worked fine, I suggest that you try again - it might have been some kind of temporarary problem with the this site.

General Tso
Jul 19, 2008, 09:22 AM
Im trying to make a seperate XML editor, focusing on technologies Tso, would these be at all integratable??

My editor is written in Python so I don't think that they are integratable. If your'e interested in trying to do something with it, the soure code for the editor is located in a folder call "Source Files".

Also you any good with datasets as im stuck (self teaching very slowly...)

Sorry, I havn't done anything with datasets so I can't help you, but I know the feeling, I had plenty of those when I was first learning Python while writing code for the editor. That's one of the reasons why I made this editor. It was to frustrating trying to learn Python and create a mod for Civ4 at the same time - due to the long load time of the game.

CivalGanjaman
Jul 19, 2008, 01:37 PM
Yeah, lucky for me I havent got the creativity to mod and I want to become a developer so I am commited to one task. However I am unfortunately hooked on marathon Civ :P

Belizan
Nov 05, 2008, 03:41 AM
Is this still being worked on?

General Tso
Nov 17, 2008, 06:35 AM
Is this still being worked on?

I haven't been working on this recently (moved on to other projects). Is there anything in particular that you wanted changed?

Belizan
Nov 26, 2008, 11:11 PM
I've been using it off and on, but there were a few little things I thought I might tweak if the source were available (or if you wanted to tweak them, that'd be good too :). An indicator of the path in the title, and a dirty bit so you knew when the file was modified from save version. A test of file size/mod date on activate with the option to reload if the file was modified in another editor (coupled with awareness of whether this version was modified from the original).

Those would be the basics. I was also thinking about adding an auto-text ref look up, and an auto text-ref adder, but that's a bit more involved.

BTW, for structure hints, you can also look at the schema rather then examining each xml entity. Not substantially different/more difficult I would think.

General Tso
Nov 27, 2008, 09:47 AM
I've been using it off and on, but there were a few little things I thought I might tweak if the source were available, or if you wanted to tweak them, that'd be good too :).

Thanks for the ideas. I'm working on some other things right now, so it may be a while to I get back to this. If you're interested, the source files are included with the download. They are in the "Source Files" folder. It's located in the program folder.
I was still learning Python when I wrote this, so some of the code may not be written in the best manor possible. The two biggest problems in my opinion are:
1. The screen isn't updated when a new item is inserted in the Class List and it's name is changed in the Element List. You can work around this by clicking on the Type button and then clicking on Cancel - that will refresh the screen.
2. There are a small number of items that can't be edited. Hopefully this doesn't affect many people.