View Full Version : zFormation Editor


Zebra 9
Jul 06, 2007, 07:59 PM
Hi all, this is just a simple formation editor that is still in the development stage. It currenlty only allows you to create a formation, and when you save the formation it comes up w/ a window containing the code that needs to be added to the Civ4 Formations XML file.

It should be self explanitory. I'm hoping to get some sort of XML loader in the future so you can edit existing formations.

This now supports Vanilla, Warlords, and BtS formations. Now please notice that this only creates BtS formations, IT DOES NOT ADD THEM TO UNITS.

v0.55 Fixed a bug with the Foramtion Type in the BtS mode, made a few tweaks to the interface.

I have reuploaded this due to the hacker (yes I know, I'm slow).

v0.5 Added BtS compatability.

v0.4 This fixes some browser version incompatabilities.

v0.3 Added more functionality

v0.2 Added the ability to create Vanilla Formations. To do this go to the Formation Info tab in the Formation Info window, or go to the edit menu (at the top of the screen and click the option that sayes Use Vanilla (If you are using vanilla it will say Use Warlords).

Requires the Mozilla Firefox Browser.

Download Here

Centaur
Jul 06, 2007, 09:13 PM
Sweet! Finally!!!

Edit: slight problem...I press CTRL+A and nothing happens

NikNaks
Jul 07, 2007, 12:44 AM
Alright! I was starting to wonder if you'd forgotten about this. :lol: Gonna try it now.

@centaur
You need to click while holding down those keys

Edit: This is awesome! This is going to save so much time!!! Thanks, Zebra!

NikNaks
Jul 08, 2007, 06:22 AM
One piece of consructive criticism. The scale is waay too big. Each square should be about 0.2. I spread the units around a bit and they ended up about 4 tiles away!

Centaur
Jul 08, 2007, 04:39 PM
I have discovered another problem...apparently I neglected to mention that I do not posess this aparently popular addition known as the Warlords expansion pack, Therefore the game has notified me that it cannot find any other great general or siege weapon entries in the schema. I deleted these entries and now the game simply crashes with no error message telling me what is wrong, besides the generic "this program has encojuntered an error and needs to close, please tell microsoft about this problem..."

in short: I don't have warlords, and the vanilla game doesn't like what I'm doing to the xml files with this program. Perhaps it will work when I get BTS?

Zebra 9
Jul 09, 2007, 09:38 AM
I'll make a vanilla editor version. :thumbsup:

P.S So you know 1.0 and -1.0 are the sides of the plot anything less than 1.0 and anything greater then -1.0 are inside the plot.

NikNaks
Jul 09, 2007, 09:45 AM
I did know that, but there really isn't much room inside those four central squares to move things around. The whole thing should only be +2 to -2 at the most.
That's my two cents anyway.

I'm already using this a lot, btw. Thanks a bunch!

Zebra 9
Jul 09, 2007, 10:07 AM
If I increase the number of squares I the grid won't fit on screen.

NikNaks
Jul 09, 2007, 10:09 AM
No, no. Don't increase the number of squares. Make each square 'worth' less (e.g. 0.1 per square instead of 1).

Zebra 9
Jul 09, 2007, 10:24 AM
To do that I need to increase the number of squares. Because the formations run on a black that is 2 by 2, so if I reduced square sizes to 0.1 I would need 200 squares across (currently 20). Am I understanding correctly?

NikNaks
Jul 09, 2007, 11:46 AM
But you only need to go up to 1.5 (15 squares) or 2 (20 squares). I don't see the problem. :crazyeye:

Zebra 9
Jul 10, 2007, 09:53 AM
So you are saying reduce the number of squares to create a 1.0 to -1.0 square instead of my 1.5 to -1.5 (or what ever it is)?

Uploaded the update that will create Vanilla Formations. It also has several tweaks.

NikNaks
Jul 10, 2007, 09:58 AM
I think that your scale is way bigger than 1.5. I had units at least 3 or 4 tiles away.

Zebra 9
Jul 10, 2007, 10:16 AM
Ooops, I'm uplaoding again. I forgot to divide the coords by 10.

Zebra 9
Jul 10, 2007, 10:19 AM
Fixed. :thumbsup:

NikNaks
Jul 10, 2007, 10:29 AM
That's what I've been getting at. :p Now I can really get started.

Zebra 9
Jul 10, 2007, 10:53 AM
Yea, it should work a little better now. Just a little. :D

NikNaks
Jul 15, 2007, 07:22 AM
Would it be at all possible to get a version where you can set the direction a unit is facing?
See 'Direction' under 'Multi-Line Tags' here (http://civ4wiki.com/wiki/index.php/CIV4FormationInfos) if you need some info.

Zebra 9
Jul 16, 2007, 11:17 AM
I'm working on getting a few things added and that is one of them.:thumbsup:

NikNaks
Jul 16, 2007, 11:30 AM
I've been using a formula to turn degrees into the code. Would you like it? It's not part of your Editor, it's just a formula from Excel.

EDIT: There's a bug where sometimes grid references have ...99999999999 or ...000000001 tacked onto the end.

Zebra 9
Jul 16, 2007, 11:48 AM
If you could give me the math sure.

NikNaks
Jul 16, 2007, 11:51 AM
It's to do with Pi. Give me a few minutes.
In the meantime, I reported a bug in my last post.

Here you go:
With 'd' as the number of degrees
d / 180 * PI

Or for Excel:
=MOD(D,360)*PI()/180

That way, if you get a number of degrees over 360, it compensates for it.

Zebra 9
Jul 16, 2007, 12:09 PM
Yea, I noticed that today to. It'll be fixed.

NikNaks
Jul 16, 2007, 12:12 PM
Great! I used your editor earlier to create a melee unit formation (I used my formula to turn the units).
You can see it in post #3 here (http://forums.civfanatics.com/showthread.php?t=231376) if you like.

I think it turned out rather well. What's your opinion?

Zebra 9
Jul 16, 2007, 12:18 PM
Yea, they are nice.

NikNaks
Jul 16, 2007, 12:20 PM
What? The units or the formation?

Zebra 9
Jul 17, 2007, 08:30 AM
Both look very nice. I'm almost done w/ the new editor. It will be more acurate and the tooltips are much more informative.

NikNaks
Jul 17, 2007, 08:31 AM
Cool. Planned to release today?

Zebra 9
Jul 17, 2007, 08:39 AM
Most likely tomorrow.

NikNaks
Jul 17, 2007, 08:41 AM
Shame. I was gonna start some new formations.

Zebra 9
Jul 18, 2007, 12:14 PM
Ok, just uploaded a new version that allows you to change almost every formation setting, increases precision and flips the grid so the formation isn't fliped when loaded in game.

Thanks to NikNaks93 for coming up w/ the math to allow the use of Degrees instead of whatever civ uses (it's much more confusing then degrees).

NikNaks
Jul 18, 2007, 12:22 PM
:D I'm so glad I could help! I'm gonna get cracking with new formations tonight.

EDIT: Er... where's the file? You don't seem to have linked to it, and it's not in the DB...

Zebra 9
Jul 18, 2007, 12:43 PM
Same spot as before. Oooops, I forgot to change the version.

NikNaks
Jul 18, 2007, 12:46 PM
Shall I wait?

Zebra 9
Jul 18, 2007, 12:51 PM
No it's correct I just forgot to change the version number that the download displays. I fixed it though.:thumbsup:

NikNaks
Jul 18, 2007, 12:53 PM
Great! D/loading now.

Where + how do you configure the unit direction?

Zebra 9
Jul 19, 2007, 07:40 AM
I replied to a PM NikNaks93 sent me, but I'll say it here for everyone else. You can edit any value by clicking on the number/text entry next to it, the text and background around the text should both change color. You now should be able to edit the entry.

NikNaks
Jul 19, 2007, 07:42 AM
Whereabouts is this information? Is it the screen after you click save?

Zebra 9
Jul 19, 2007, 08:01 AM
No, it's the small screen that displays the unit information and has the little unit image (Can't remember if the Vanilla mode shows the image).



Edit: It's the screen w/ the unit image (it does show the image in Vanilla mode). And I just noticed that I'll have to get a tweak in that will fit the grid onto a 1024 x 768 monitor res. (my compter runs 1280 X 1024).

NikNaks
Jul 19, 2007, 08:13 AM
But that information isn't shown on the tools window. Now I'm confused :crazyeye:

Zebra 9
Jul 19, 2007, 08:21 AM
Here's a screeny. When you have a unit selected (it's changing colors) it's info will display in the Tools screen. Now all the entries that are circled in the lime color when clicked become editable.

NikNaks
Jul 19, 2007, 08:24 AM
Ok. I re-downloaded the version you have linked, and that information still isn't shown. Are you sure you've uploaded the right version?

Oh, and you may want to explain the Firaxis East/West mistake so people don't get confused.

Zebra 9
Jul 19, 2007, 08:34 AM
Downloading a copy to check it.

Zebra 9
Jul 19, 2007, 08:39 AM
Ok, somehow I uploaded v0.2 instead of v0.3. How I goofed it up like that is beyond my understanding, but I now have the correct version up.

NikNaks
Jul 19, 2007, 08:41 AM
Ah. That explains it. No wonder I couldn't find it! :lol:

NikNaks
Jul 19, 2007, 08:45 AM
Clicking on them doesn't allow me to edit them. It just highlights them. :crazyeye:

Zebra 9
Jul 19, 2007, 08:46 AM
Yea, sorry for the confusion.

Zebra 9
Jul 19, 2007, 08:46 AM
When you click it start typing.

NikNaks
Jul 19, 2007, 08:47 AM
Nope. Click it and it highlights it, but I can't type anything in.

Zebra 9
Jul 19, 2007, 08:50 AM
Works for me. What version of firefox are you using? I'm using v1.0.

NikNaks
Jul 19, 2007, 08:51 AM
Firefox version v1? I'm using 2.0.0.5!

Zebra 9
Jul 19, 2007, 08:54 AM
Okay...

...Pauses...


...Um... ...I'll see if i can get somthing that should work tonight.

They have a version 2.0.0.5 already!!

NikNaks
Jul 19, 2007, 08:58 AM
They released v1.5 about a year ago, and v2 a few months ago. Have you disabled updates or something???

Zebra 9
Jul 19, 2007, 04:53 PM
The computer I work on doesn't have internet access. And this computers owner doesn't seem to care what version of browser it's got.

Just uploaded v0.4 hope it works for you.

Centaur
Jul 21, 2007, 11:32 PM
Wow...two updates in approx~24hrs? This has gotta be one of the most frequently updated thread on the forums!

NikNaks
Jul 23, 2007, 05:00 AM
It works! Thanks, Zebra.
So when will the BtS version be released?:mischief:

Zebra 9
Jul 23, 2007, 10:42 AM
As soon as I get BtS and create a python server to automaticly change the XML. This is almost done. :thumbsup: Gald it works.

Also you probably noticed that it starts in Vanilla instead of Warlords now.

NikNaks
Jul 23, 2007, 10:47 AM
Also you probably noticed that it starts in Vanilla instead of Warlords now.That's slightly annoying, but I don't really mind :p
Good to hear you're going to get working on a BtS version.

Zebra 9
Jul 23, 2007, 11:16 AM
Well if you want it to start in Warlords go into the zFormation Editor folder, you will see a file by the name of config.js. Open it in notepad and change the line that reads civVersion = 161; to civVersion = 208;. Now it should load up in Warlords mode. :thumbsup:

Oh, I just noticed that I have some debug code in that file. To turn it off just changedefaultUnitTypes = "UNIT_WARRIOR UNIT_TANK, UNIT_ARCHER";
defaultEventTypes = "ENTITY_EVENT_IDLE,ENTITY_EVENT_SURRENDER,ENTITY_EV ENT_SLEEP,ENTITY_EVENT_HEAL,ENTITY_EVENT_SENTRY,EN TITY_EVENT_PILLAGE"; to defaultUnitTypes = "";
defaultEventTypes = "";. :thumbsup:

Zebra 9
Aug 14, 2007, 08:20 AM
Just uploaded v0.5. It supports BtS formations.

I'm working on a small python server that, if it works, should allow for complete control over XML files. So all you would have to do is create the formation click save and start the game and presto you have formations!

Enjoy v0.5. :thumbsup:

NikNaks
Aug 14, 2007, 08:23 AM
Alright! I'm gonna start making BtS formations now!

Muahahaha.... :lol:

Zebra 9
Aug 15, 2007, 08:48 AM
I just uploaded v0.55. It fixes a bug with the Formation Type while in the BtS mode. I also made a few interface changes.:thumbsup:

Zebra 9
May 15, 2008, 06:20 PM
I just reuploaded it, if there any old problems its because I put the wrong one of my sixty gagillian copies on! I need to reorganize my computer.