Hello, I would like to say that this is an amazing editor that could really make modding accessible for an idiot like myself who has a lot of ideas and little skill. That is, if i could get it to work. Hopefully im just being stupid and you can show me the error of my ways.
To test out the functionality of a new mod type i always try something simple to see how it works and expand from there. In this case i created a new technology called Crop Rotation that increases farm yield (screenshot 1). Simple right? However when i try to export the project with conflict detection on i get an unhandled exception stating value cannot be null (screenshot 2)
Full text of the exception:
Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: item
at System.Windows.Forms.ComboBox.ObjectCollection.AddInternal(Object item)
at System.Windows.Forms.ComboBox.ObjectCollection.Add(Object item)
at IndieStoneTools.Forms.ConflictDialog.FillReplaceDropDown(String replaceType)
at IndieStoneTools.Forms.ConflictDialog..ctor(Conflict conf, Int32 index)
at IndieStoneTools.Forms.ConflictDialog.DoConflicts(ConflictInfo info, Civ5XmlDatabase db)
at IndieStoneTools.Forms.Export.SaveISMod()
at IndieStoneTools.Forms.Export.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36365 built by: FX452RTMLDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
IndieStoneTechEditor
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///E:/Games/Civilization%205/indiestone%20techtree%20editor/IndieStoneTechEditor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34285 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34294 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.36365 built by: FX452RTMLDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
IndieStoneTools
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///E:/Games/Civilization%205/indiestone%20techtree%20editor/IndieStoneTools.DLL
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34283 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Firaxis.Framework
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/Games/Civilization%205/indiestone%20techtree%20editor/Firaxis.Framework.DLL
----------------------------------------
DevIL.NET2
Assembly Version: 1.1.2619.31671
Win32 Version:
CodeBase: file:///E:/Games/Civilization%205/indiestone%20techtree%20editor/DevIL.NET2.DLL
----------------------------------------
msvcm80
Assembly Version: 8.0.50727.6195
Win32 Version: 8.00.50727.6195
CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a/msvcm80.dll
----------------------------------------
System.Design
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.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.
If i disable conflict detection it generates the XML files, which i then tried to convert to a mod the usual way (with SDK). The game loads, however the techtree is bugged. I cannot scroll tree to the right and as you can see in (screenshot 3) the era title seems to have appeared in the middle of the tree for some reason. I also can click on the technology but it will not research it, the research icon will show title of last technology being researched but use the icon of my technology, so the game clearly cannot determine what it is supposed to do.
The modding and testing was done with all other mods and fakeDLC removed to make sure they arent the source of conflicts, so its not that. I also tried adding the <system.windows.forms jitDebugging="true" /> line in the config file of the program but it made no difference.
Hopefully i am just doing something wrong and you can point me into the right direction.
Strazdas
Edit: Did some more testing. Apperently if i select the new technology, it does not show it being selected but skipping turns will "research" it and the farms will get the bonus, however it will still show as unresearched in tech tree.
I looked at database validation logs and apperently its giving me errors for all the xml files the program is generating. It states:
[147955.669] Database::XMLSerializer (TechTreeUnits.xml): There was an error executing the update statement! See Database.log for details.
[147955.669] PRIMARY KEY must be unique
[147955.669] In XMLSerializer while updating table UnitPromotions from file TechTreeUnits.xml.
[147956.387] Validating Foreign Key Constraints...
And the same error for 10 of the files. In those files the editor generated some code which i assume is just a copy of vanilla code, because i did not change things like units at all. however i assume since the program generated these, they are needed?
Edit 2: I have found a culprit, kind off. I still get the same error when exporting the XML files in editors, however it seems to work ingame. I have assumed correctly that the problem is my own stupidity. I looked at what an existing technology - fertilizer - does and tried to copy it. Fertilizer increases food yield on both farm and terrace farm. So i increased the yield for both on my technology as well. However apparently i do not have that nation DLC purchased, so terrace farm improvement was not found by the game and it bugged out. So despite the vanilla technology having a reference to terrace farm, one cannot have this reference in mods if the DLC is not present.
Now to test it with my building mods and enhanced UI.....
Edit 3: I realized this mod does not add flavors to technologies, so AI will research them only when it has no other options, making AI research patch horrible. I would suggest adding an option in the technolgy options to add/change technology flavor so one would not need to manually change the XMLs afterwards. Luckily i have gone over flavor creating with my building mod and noticed them missing.