Advertisement
Civilization Fanatics' Center  

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Utility Programs

Reply
 
Thread Tools
Old Nov 15, 2005, 01:54 AM   #1
Futzy
Chieftain
 
Join Date: Oct 2005
Posts: 17
Post Civ4 XML Editor - First Bug Fix Release!

BUG FIX! Fixed the alternate directory bug!

OK, this began life as a little app I was throwing together to help me create new civilizations for a mod. But as I got rolling, I decided it might actually be good enough to release, so here it is, version 0.1!

What it does so far:
  • Creates new mod folders
  • Updates the ini file in the root of mod folders
  • Allows you to create new civilizations and delete existing ones
  • Allows you to edit all civ properties located in the CIV4CivilizationInfos.xml file
  • Allows you to edit color and text data from the other relevant XML files
  • Enforces good practices by not modifying any of the root files
  • Stores location of Civ 4 files in a config file so you can change it if you didn't install it to the normal folder

Known Shortcomings and Bugs:
  • Does not work on any of the non-English languages in the text files
  • Does not edit one or two sections of the civ XML because I could not find samples of how they needed to be structured
  • Does not allow you to prevent a civ from building certain units

What it WILL do in future versions:
  • Allow you to edit Leaderheads

What it MAY do in future versions:
  • Include a graphic viewer so you can more easily select graphics
  • Include an audio player so you can more easily select audio
  • Allow you to edit other sections of the XML


For the technically inclined, I wrote the app in C# 2.0, since I just got my hands on the final version, and this seemed like a good teaching project.

PLEASE NOTE: Because this is written in a .NET 2.0 language, most of you will need to download and install the .NET 2.0 framework. You can find it here.

Please let me know what you think, I would love for this to continue to grow.

Edited to update feature list with things I forgot the first time around.
Attached Files
File Type: zip Civ4XMLEditorSetup.zip (411.0 KB, 10175 views)

Last edited by Futzy; Nov 18, 2005 at 07:22 PM. Reason: Updating attached file to version 0.1.1
Futzy is offline   Reply With Quote
Old Nov 15, 2005, 03:27 AM   #2
sovarn
Warlord
 
sovarn's Avatar
 
Join Date: Nov 2005
Location: London
Posts: 164
wow, thanks.

This should be a very useful tool for ppl.
sovarn is offline   Reply With Quote
Old Nov 15, 2005, 04:10 AM   #3
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Dude.

I could hug you.
Feet is offline   Reply With Quote
Old Nov 15, 2005, 04:20 AM   #4
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Just so you know that one the colours page you can choose 4 colours but there's only 3 preview boxes, this is pretty confusing.

Apart a few errors where you can just click continue it works really well.
Feet is offline   Reply With Quote
Old Nov 15, 2005, 04:27 AM   #5
Vilu
Chieftain
 
Join Date: Nov 2005
Posts: 18
Quote:
Originally Posted by Futzy
PLEASE NOTE: Because this is written in a .NET 2.0 language, most of you will need to download and install the .NET 2.0 framework.

Ouch. There goes my chance of trying out the editor. .NET 1.1 and 2.0 cannot co-exist on the same machine and I really need 1.1 for a project that doesn't work with 2.0.
Vilu is offline   Reply With Quote
Old Nov 15, 2005, 04:36 AM   #6
emalherbe
Chieftain
 
Join Date: May 2002
Location: South Africa
Posts: 7
Quote:
Originally Posted by Vilu
Ouch. There goes my chance of trying out the editor. .NET 1.1 and 2.0 cannot co-exist on the same machine and I really need 1.1 for a project that doesn't work with 2.0.
You can run both at the same time. If you are having issues with IIS you can just right-click on the web app and select the 1.1 framework from the selector box (instead of the default 2.0) in the properties dialog.
emalherbe is offline   Reply With Quote
Old Nov 15, 2005, 04:43 AM   #7
Orion66
Master of Orion
 
Orion66's Avatar
 
Join Date: Feb 2003
Location: POLAND
Posts: 369
!!!!!!!!!!!!


The editor doesn;t want to work becose I have diffrent path to game. I edited config file with a proper path but editor is still looking for 'C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods
Orion66 is offline   Reply With Quote
Old Nov 15, 2005, 08:06 AM   #8
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Ok well it's loosing some of my information now which is pretty irritating. :P

Things like Civilopedia entries for the new factions, city names (they show up in the list but the name text box remains empty).

Weird thing is the first time ran it, they were held ok. I had to close it and when I came back to it later it no lnger saves this info. I think it HAS saved it in the XML but you can no longer see what you've put in the TEXT boxes in the app. I think. Something like that anyway.

Looking forward to the leaders part. I just tried to do it manually and it didn't work.
Feet is offline   Reply With Quote
Old Nov 15, 2005, 08:15 AM   #9
Futzy
Chieftain
 
Join Date: Oct 2005
Posts: 17
Quote:
Originally Posted by Feet
Ok well it's loosing some of my information now which is pretty irritating. :P

Things like Civilopedia entries for the new factions, city names (they show up in the list but the name text box remains empty).
On the city tab, the names that show up in the list box on the left are the names in the civilization XML file, then when you click on one of the names, you should see the "friendly" name popup in the text box on the right (which is stored in one of the files in the Text directory, I don't remember which one off the top of my head). If it's losing those values, check and see when you save if it's saving both files. If should, but if it only saves the civ XML and not the text XML, that would explain the behavior you describe. If you could check and let me know, that'll help me find and fix the bug.
Futzy is offline   Reply With Quote
Old Nov 15, 2005, 08:29 AM   #10
Futzy
Chieftain
 
Join Date: Oct 2005
Posts: 17
Quote:
Originally Posted by Feet
Just so you know that one the colours page you can choose 4 colours but there's only 3 preview boxes, this is pretty confusing.
This is confusing, but it is because it is the way it works in the files. That first drop down defines a set of 3 colors, a primary, a secondary, and a text color. Then the 3 drop downs below that edit the actual colors. So for example (and I'm at work now, so I'm doing this from memory, so the names are probably a little off), let's say the first drop down is PLAYERCOLOR_BLUE, then under that are COLOR_BLUE for Primary, COLOR_WHITE for Secondary, and COLOR_BLUE_TEXT for Text. If you go in and Edit COLOR_BLUE_TEXT, then ALL items in the game that use COLOR_BLUE_TEXT will be changed to the new color you specify. If you instead hit New on Text Color, and create a new custom color called MYMOD_COLOR_BLUE_TEXT, then the default COLOR_BLUE_TEXT will remain unchanged, but the default PLAYERCOLOR_BLUE will now point to your new MYMOD_COLOR_BLUE_TEXT for its text color. So if you don't want to change any of the original colors, you should always start by creating a new color set at the top like MYMOD_PLAYERCOLOR_BLUE, then make new colors down below as necessary. But if you do want to overwrite the default colors, you have that ability.
Futzy is offline   Reply With Quote
Old Nov 15, 2005, 08:38 AM   #11
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
It's updating an XML file called Text_Civilopedia_Civleaders.xml.

Pretty sure this is incorrect and it should be Civ4GameText_Civilopedia_Civleaders.xml

That's the problem. Its reading from the latter and writing to the former. Needs to both be the latter. Just a typo I guess.
Feet is offline   Reply With Quote
Old Nov 15, 2005, 08:40 AM   #12
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Quote:
Originally Posted by Futzy
This is confusing, but it is because it is the way it works in the files. That first drop down defines a set of 3 colors, a primary, a secondary, and a text color. Then the 3 drop downs below that edit the actual colors. So for example (and I'm at work now, so I'm doing this from memory, so the names are probably a little off), let's say the first drop down is PLAYERCOLOR_BLUE, then under that are COLOR_BLUE for Primary, COLOR_WHITE for Secondary, and COLOR_BLUE_TEXT for Text. If you go in and Edit COLOR_BLUE_TEXT, then ALL items in the game that use COLOR_BLUE_TEXT will be changed to the new color you specify. If you instead hit New on Text Color, and create a new custom color called MYMOD_COLOR_BLUE_TEXT, then the default COLOR_BLUE_TEXT will remain unchanged, but the default PLAYERCOLOR_BLUE will now point to your new MYMOD_COLOR_BLUE_TEXT for its text color. So if you don't want to change any of the original colors, you should always start by creating a new color set at the top like MYMOD_PLAYERCOLOR_BLUE, then make new colors down below as necessary. But if you do want to overwrite the default colors, you have that ability.
Ahhh I see. Thanks for clarifying that.
Feet is offline   Reply With Quote
Old Nov 15, 2005, 09:10 AM   #13
silentknight111
Warlord
 
Join Date: Oct 2005
Posts: 145
Quote:
Originally Posted by Orion66
!!!!!!!!!!!!


The editor doesn;t want to work becose I have diffrent path to game. I edited config file with a proper path but editor is still looking for 'C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods
Same here.. you can change the config file but it doesn't do anything :P
I cant use this because I install all my games to a different drive and it won't stop looking on my system drive.
silentknight111 is offline   Reply With Quote
Old Nov 15, 2005, 10:30 AM   #14
AsnoT
Mostly Civilized
 
AsnoT's Avatar
 
Join Date: Apr 2003
Location: Austria
Posts: 226
Quote:
Originally Posted by silentknight111
Same here.. you can change the config file but it doesn't do anything :P
I cant use this because I install all my games to a different drive and it won't stop looking on my system drive.
oh my, what a pity - i also have games installed on their own harddisk, not default
__________________
Intel Core2Duo 8400 @ 3GHz, 4 gb ram, Asus P5N-T Deluxe, Gforce GTX260, running civ4 at 1920x1200 and 16xAA
AsnoT is offline   Reply With Quote
Old Nov 15, 2005, 02:25 PM   #15
Bone_Jones_00
Chieftain
 
Join Date: Oct 2002
Posts: 22
Maybe he can do an update that solely fixes that part where you can specify where to locate the game? Everyone here would love you!
Bone_Jones_00 is offline   Reply With Quote
Old Nov 15, 2005, 07:29 PM   #16
Bone_Jones_00
Chieftain
 
Join Date: Oct 2002
Posts: 22
I tried and even edited the hex code to change to my location on my hard drive with no luck. I can't find it anywhere.
Bone_Jones_00 is offline   Reply With Quote
Old Nov 15, 2005, 08:21 PM   #17
Futzy
Chieftain
 
Join Date: Oct 2005
Posts: 17
OK guys, I found and fixed the bug with the directory. I have updated the file attached to the first message.

If you care, it was a classic 3 in the morning bug, I was reading the value out of the config file, but then overwriting it with your OS's Program Files location...
Futzy is offline   Reply With Quote
Old Nov 15, 2005, 11:09 PM   #18
Cafegio
Warlord
 
Cafegio's Avatar
 
Join Date: Sep 2005
Posts: 177
WHY DO I KEEP GETTING THIS ERROR

System.NullReferenceException: Object reference not set to an instance of an object.
at Civ4XMLEditor.frmMain.SaveFiles()
at Civ4XMLEditor.frmMain.saveToolStripMenuItem_Click( Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Obje ct key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(Eve ntArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(Eve ntArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(M ouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventIntera ctive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(Event Args e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEven tArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(M ouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Mes sage& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Civ4XMLEditor
Assembly Version: 0.1.2145.38171
Win32 Version: 0.1.*
CodeBase: file:///C:/Program%20Files/Civ4%20XML%20Editor/Civ4XMLEditor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Cafegio is offline   Reply With Quote
Old Nov 16, 2005, 05:43 AM   #19
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Ok there's a new typo in the config file of the new version you put out.

<value>C:\Program Files\Firaxis Games\Sid Meier's Civilization 5</value>

Spot the error.

I think that's just wishful thinking tbh. Setting it back to 4 makes the new version work for me again.
Feet is offline   Reply With Quote
Old Nov 16, 2005, 06:02 AM   #20
Feet
Warlord
 
Feet's Avatar
 
Join Date: Oct 2005
Location: Southend, UK
Posts: 143
Just so you know what i mean about the app saving to the incorrect xml names, here are two screenshots.

This one is taken from

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Text



This one is taken from my Mod folder, after I have used your app.

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods\ASOIAF\Assets\XML\Text



It's writing 4 new xml files with the changes I input instead of to the actual files it should be writing too that the mod will use (which have Civ4Game in front of the name).

Your app is reading from the right files (hence why when I reload the app it doesn;t show the chahges I made), abd is writing to the wrong ones.

Hope that helps you and well done on a brilliant mod. This has saved me quite a few hours, despite a few problems.

It's easy to fix manually however, as you just rename the incorrectly named files to the correct name and all works well.
Hope this helps you.

Last edited by Feet; Nov 16, 2005 at 06:19 AM.
Feet is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Utility Programs > Civ4 XML Editor - First Release!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Civ4 XML Editor General Tso Civ4 - Utility Programs 121 Jul 15, 2010 10:30 AM
Civ4 XML Editor - First Release! Futzy Civ4 - Creation & Customization 6 Apr 04, 2008 05:38 PM
Making use of the XML Schemas in your XML editor Padmewan Civ4 - Creation & Customization 6 Mar 26, 2006 03:13 PM
Suggestion : A good XML editor for CIV4 and other acantoni Civ4 - Creation & Customization 7 Mar 03, 2006 04:43 PM
Civ4 XML editor projected Vino6 Civ4 - Creation & Customization 40 Nov 18, 2005 05:09 PM


Advertisement

All times are GMT -6. The time now is 11:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR