View Full Version : *Beta* Unfinished Tech editor.
Darva May 02, 2006, 02:43 AM Updated. Now capable of saving an xml file. It looks properly formatted, but I can't test it. (Long story, no cd-rom drive at the moment, at least the computers working again.) Also, everything is now editable except quote, button, sound, and soundmp.
v .01
* Fixed bugs reported by Conquestador
* Successfully tested loading default civ4techinfos, rewriting it, and loading into Civ4 as a mod without errors.
* Added beginings of visual placement of techs in the grid.
Some options in the menu don't work yet, for the moment just use save as, since plain Save doesn't work yet.
Source is included in the download marked SRC. The program is writen in VB.net 1.0. To install it, just drop the exe where ever you want it, and run it.
Comments are very much appreciated. (even if you just want to make fun of my ham handed code) :D Hopefully i will make progress a bit faster now, as I have repaired my computer and can once again run Civ 4.
Image of tech tree grid:
http://img212.imageshack.us/img212/5588/sstechtreeprelim5qg.th.jpg (http://img212.imageshack.us/my.php?image=sstechtreeprelim5qg.jpg)
wotan321 May 02, 2006, 08:44 AM How will this thing effect the F6 tech tree? Will all the lines connect properly for prerequisites?
In any case, thanks for working on this, its very much needed.
woodelf May 02, 2006, 09:19 AM I'll give it a whirl later on. Is this the same one that was previewed in the main C&C 7-10 days ago?
If it works like I hope it works then it will be a boon to us all. ;)
Darva May 02, 2006, 01:24 PM Yes it is the same one i posted about previously. And when it is finished, yes it will edit the tech tree. (You already can, you just can't save it yet.)
The Great Apple May 02, 2006, 01:43 PM Yes it is the same one i posted about previously. And when it is finished, yes it will edit the tech tree. (You already can, you just can't save it yet.)As is move about the positions of the techs on a virtual tech tree so you can see what it's going to look like without having to boot up Civ?
That would be awsome...
Darva May 02, 2006, 03:46 PM That's something i hope to do eventually. Actually, i need some information for that... How big is the normal tech tree display? How many places verticle by how many places horizontal?
Asjo May 02, 2006, 04:33 PM So, will there be a possiblity to somehow limit tech trees to make sure that a certain scenario would not have any techonological advance? Kind of crucial, as I see it, but it seems that this is just for techonologies in general.
The Great Apple May 02, 2006, 04:40 PM That's something i hope to do eventually. Actually, i need some information for that... How big is the normal tech tree display? How many places verticle by how many places horizontal?I don't think it's constrained... or if it is the constraints are pretty large.
IIRC the lowest tech is at step 14 in the vertical direction (steps starting from 0 - relating to iGridY), and each takes up about 1.5 steps in height... however, if you were to put a tech below step 15 then the tech-tree would have scroll arrows. The horizontal length is defined by how large the largest iGridX value is. The horizontal steps are quite large so you can't get overlap on them... with a default tech tree.
Unfortuntely with the game being so moddable the relative sizes I've given you will only work on an unmodded tech screen. If somebody wanted to edit CvTechChooser.py and half the distance between steps (redifining iGridX/Y) then they could quite easiy.
Having said that I'm yet to see somebody do something like that, so you're probably pretty safe.
Darva May 02, 2006, 04:47 PM Ok, So if i limit it to say 30x30 everything aughta be hunky dorey then. Well, creating a visual representation of the tech tree is a step ahead of where i am now though. I've got writing the actual file out about 80% done, i'll post back when that part is complete.
Darva May 02, 2006, 06:35 PM Ok, the only item i have left to add is the ability to modify/write The TerrainTrades element. However, i don't have a complete list of them, or see one in the xml. Can anyone help me with this?
(NM, i'm an idiot.)
Darva May 04, 2006, 03:55 AM Well, i see a couple of people have downloaded it.. Does it work? Is the interface ok... etc.
Conquestador May 05, 2006, 02:58 PM Hi Darva, i've tried your editor and the interface is nice but the XML file generated is'nt correct.
After some manual editing i've loaded it in civ4 and it work.
How did you generate the code ? You used some type of XML mapper ?
I would be glad if you continue your work because i think is a good idea.
Darva May 05, 2006, 04:03 PM Well, i just used .net's standard xml reader/writer classes, and tried to write the xml as close to the origonal civ4techinfos.xml file as i could. Can you upload a copy of a file the program produced that didn't work, and what it looked like after you fiddled with it to get it to work? I'm a little suprised that it didn't load correctly, since as far as i can tell, my produced .xml matches the schema completely. Ahh well.
The Great Apple May 05, 2006, 05:24 PM There is (or at least was) some specific way in which you had to place to techs to get them to work in the tech chooser. You may have to do a few tests to get it right - I seem to remember you had to place them out as if it were a tree, until you got to something that required something you hadn't got yet, and then you went back to the previous branch.
Now if only that last paragraph made sense...
Darva May 05, 2006, 11:30 PM Well, unfortunatly, that's gonna have to wait till i either get a new power supply with enough plugs that i can plug my cd-rom back in, or untill a program that we can't talk about here is released for the new patch, so that i can test things as i go. ::Sigh::
Conquestador May 06, 2006, 02:11 AM these are the two version of the file. I've noticed that you need to put a CIV4TechInfos closing tag also there are problems with the Advisor element.
Darva May 06, 2006, 03:04 AM Thank you Conquestador!! I feel rather stupid now, heh. Fixed both of the bugs you reported, one was just a stupid typo, and the other was due to not paying enough attention to the raw xml. Hopefully the version i just uploaded should fix both of those bugs.
The Great Apple May 22, 2006, 03:56 PM Any progress on this?
Techtree looks good. What would be ideal is if you could implement it so that it looked a bit more like the Civ 4 techchooser with arrows and stuff. What would be even more ideal is if you could pick up links to techs from other XML files, and display them on the tree. That might be a bit tricky though...
HG_CassiusA Jun 04, 2006, 02:38 PM Just a heads up Darva, I sent you an e-mail regarding this program. I've fixed a few rather serious bugs too.
Darva Jun 10, 2006, 11:46 PM Post a file with the bugs you noticed, and i'll update the main release. What's frustrating me right now, and delaying the next version is getting prereq links to show in the tech tree, i've made about 12 attempts, and they all have various problems.
HG_CassiusA Jun 11, 2006, 07:29 PM Alrighty, here are my fixes:
mnuOpen_Click() in Form1.vb
Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
On Error GoTo ERR_mnuOpen
Dim FileTarget As New Windows.Forms.OpenFileDialog
FileTarget.Filter = "XML files (*.xml)|*.xml"
FileTarget.Title = "Select Technology file"
FileTarget.CheckFileExists = True
FileTarget.CheckFileExists = True
FileTarget.ShowDialog() 'BUG: Exception when trying to open a file that contains no techs. - NOT FIXED (in progress)
'While FileTarget.FileName = ""
'End While BUG: Application hangs. - FIXED
If FileTarget.FileName = "" Then Exit Sub 'Application would hang using the above code.
If System.IO.File.Exists(FileTarget.FileName) Then
LoadXML(FileTarget.FileName)
End If
lstTechs.DataSource = CurTechList
lstTechs.DisplayMember = "Name"
lstTechs.ValueMember = "Data"
FileOpen = True
FileName = FileTarget.FileName
mnuTechs.Enabled = True
'Error-handling
Exit Sub
ERR_mnuOpen:
Dim result As MsgBoxResult
result = MsgBox("An error occurred while trying to open the file. Would you like to try opening another one?", MsgBoxStyle.YesNo, "File error")
If result = MsgBoxResult.Yes Then mnuOpen_Click(sender, e)
End Sub
mnuAdd_Click() in Form1.vb
Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click
Dim tech As New clsTechData
tech.Name = InputBox("Please name your new technology.", "Add Technology", "UnnamedTech") 'Added by HG_CassiusA (Brendon S. Allan)
'tech.Name = "UnnamedTech" <==Obsolete code==> (HG_CassiusA)
CurTechList.Add(tech, tech.Name) 'Changed from CurTechList.Add(tech) to fix bug regarding technology deletion.
CurTech = tech
If Not CurTechList Is Nothing Or CurTechList.Count > 0 Then
lstTechs.DataSource = Nothing
lstTechs.DataSource = CurTechList
lstTechs.DisplayMember = "Name"
lstTechs.ValueMember = "Data"
Else
lstTechs.DataSource = Nothing
End If
lstTechs.ClearSelected()
lstTechs.SelectedIndex = lstTechs.Items.Count - 1
SetupForm()
End Sub
mnuRemove_Click() in Form1.vb
Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click
Dim tech As New clsTechData
tech.Name = InputBox("Please name your new technology.", "Add Technology", "UnnamedTech") 'Added by HG_CassiusA (Brendon S. Allan)
'tech.Name = "UnnamedTech" <==Obsolete code==> (HG_CassiusA)
CurTechList.Add(tech, tech.Name) 'Changed from CurTechList.Add(tech) to fix bug regarding technology deletion.
CurTech = tech
If Not CurTechList Is Nothing Or CurTechList.Count > 0 Then
lstTechs.DataSource = Nothing
lstTechs.DataSource = CurTechList
lstTechs.DisplayMember = "Name"
lstTechs.ValueMember = "Data"
Else
lstTechs.DataSource = Nothing
End If
lstTechs.ClearSelected()
lstTechs.SelectedIndex = lstTechs.Items.Count - 1
SetupForm()
End Sub
Hope this helps :D
I've also been trying to update your XML reading code to .NET 2.0 compliancy, since the XMLValidatingReader class is obsolete in .NET 2.0.
Darva Jun 12, 2006, 12:58 AM I don't really want to update it to net 2.0 for a few reasons. A. I'd like it to be as accessable as possible (i almost wrote it in VB 6.0, but the ease of .net enticed me away), B. I can't update to the most current installer (for reasons you can interpret, and i cannot say on this forum), so i can't use .net 2.0. furthermore, i'm just a bit jumpy about "advanced" microsoft technology, and refuse to adopt it until it's at least one generation behind the cutting edge.
If you'd like to maintain a second version of the program written for .net 2.0 you have my full permission HG_CassiusA, indeed, anyone who wishes to take my code and modify it has my permission, as long as they cite me as the origion, and post their code along with the .exe.
dh_epic Jun 12, 2006, 06:10 PM This is a great idea for a Util. I hope someone picks up the ball and runs with it.
erikg88 Jun 13, 2006, 08:02 AM This doesn't work for me - is it possible that I need (and I'm just grasping at straws here), some binaries for this .net business?
HG_CassiusA Jun 13, 2006, 05:19 PM Yes, you need .NET Framework 1.0 or higher, which can be downloaded from Microsoft. .NET 2.0 can run the program as well (I think), but to be respectful to Darva's wishes for his program my advice would be to use 1.0.
erikg88 Jun 13, 2006, 05:34 PM Ah - I've got it working now. A really great program - the one problem is it does not have a field for the Description, so I have to manually add it. Other than that - love it.
dh_epic Jul 05, 2006, 12:45 PM Dang. Did this one get discontinued?
Seven05 Jul 06, 2006, 10:08 PM I was wondering the same thing, so I grabbed the source code that he was nice enough to provide. My VB is a bit rusty but I'll take a look at see what I can do or if it would be easier for me to just start over.
Ploeperpengel Jul 07, 2006, 08:45 AM Ah - I've got it working now. A really great program - the one problem is it does not have a field for the Description, so I have to manually add it. Other than that - love it.
What about sharing?:(
erikg88 Jul 07, 2006, 07:34 PM What about sharing?:(
Hm?
What would you like me to share?
Ploeperpengel Jul 08, 2006, 04:43 AM Hm?
What would you like me to share?
Well your working version of course. Seems the first post doesn't get updated and many of us aren't familar with python but really could use this program if it gets fixed;)
erikg88 Jul 08, 2006, 09:48 AM Oh, I see what you thought.
Unfortunately, I have no ability with coding, and I haven't done any modification on this program. All I've done is download the .Net framework so I can run the program in the first post.
Ploeperpengel Jul 08, 2006, 10:09 AM Hm oh damn. I have framework but it didn't work yet for me. In this case I just try another time.:(
LittleRedPoint Jul 11, 2006, 02:11 PM I use ancient way to make tech tree. Create techs and boot civ 4, then marking corrections on paper.. :D
The viewer could make it lot easier..
Ploeperpengel Jul 28, 2006, 05:21 PM This thingy has a funny bug. It's absolutly impossible to add a technology named TECH_PHILOSOPHY. Sokrates wouldn't like this:lol:
Otherwise still helpful sometimes but really somebody should develope it further, pretty please!
Edit: I found a work around if I call tech_Philosophy tech_Gelaber which means something like nonsense talk in german it named it Philosophy correctly after reload and furthermore doesn't cause any problems afterwards with that. Seems this program just waited for some kind of statement first:rotfl:
Don't know if anyone can reproduce this effect but it certainly amused me:D
Edit: haha forget about was my error(of course), I think it's simply too late
Stellan_87 Oct 10, 2006, 07:55 AM how do you change the pace technologies are researched i mean increase their research points?
Stellan_87 Oct 10, 2006, 04:40 PM Dont need any help found it.
|
|