Mods: Mac to PC compatibility?

Thanks. It doesn't make any difference. Is everyone on Windows testing with v2.13?
 
Aargh...
I've been working on a mod for Colonization, and I've run into the same brick wall that happened with my other mod. Since this isn't a unique crash, I think there has to be something screwy with the programs I'm using to mod my XML. I use Smultron, and I think there is something bad with the text encoding.
I don't know anything about encoding, but it seems Smultron likes to convert everything to Unicode (UTF-8). It works fine with the Mac XML, but it (in my hypothesis) screws up the Windows XML.
I was wondering if anyone knows anything about the differences between the Windows and Mac XML, and if it would be possible to fix it up? For all I know, it could be something else that the Windows XML doesn't like, so if you know any differences, please let me know!
 
If you are getting an XML parsing error then upload your files, or email them to alanh<at>civfanatics<dot>net, and I'll take a look.

However, if the crash you are getting now is not throwing up an XML parsing error, but is the same as the one I get with Battle of Hastings now that the XML is fixed, then I doubt if it's an XML problem. It's more likely to be something in your graphics mods.

Windows should cope OK with utf8 encoding. However, you do need to make sure that the encoding is specified correctly in the header line if it is not the default ASCII, and that it matches the actual encoding in your text. Files with non-English text, such as multi-lingual Civilopedia text files, should have the correct encoding defined. And it must be consistent throughout the text in that file.

Your Battle of Hastings files have no encoding definitions, which is probably OK, as they all seem to use ASCI which is the default. If they were created using Smultron then it seems to be doing OK for those files. Note that I *did* straighten out the line endings in them, as your edits were incosistent with the rest of the file, making them all but unreadable in BBEdit, but that didn't seem to be causing any runtime problems.

FWIW, I use BBEdit for text editing, but TextWrangler is the free version, and it is just as capable as BBEdit for your purposes. I've never looked at Smultron - and had never heard of it before you mentioned it here, but its description looks good.
 
:) I keep running into your posts Flintlock. Somewhere above you mentioned only one mod made by a mac user that ran on Windows. What was the mod? (I bet I could be number 2 if I put my mind to it.) Also, you wouldn't be using Bootcamp for Warlords by chance? I may be getting it running myself. April 28?
 
@Alan
Thanks for the reminder on art files; I fixed the problem! I have barely made any changes, but I changed my civilizationartdefines.xml, and I found out you cannot delete any of the original entries. I don't recall doing that for my other mod, but I may have.
I'm just really glad I found the problem! :D

@ iggymnrr
The other mod was a World War 2 mod by Nwabudike Morgan, but the idea that it runs on Windows is only really a half truth. People are able to load the mod itself, but it crashes while loading the scenario.
I don't use Bootcamp at all; I use Crossover Games for Colonization. I've yet to get the Windows versions of CIV, so thats why I released a mod that didn't work for Windows. I think I'm going to go through my mod and fix it up; I'm hoping this is the *sole* problem! :woohoo:
 
Alan, not to highjack the thread but could i ask a favour of you, since you have vast knowledge of fixing problems, could you load up my mod in windows and tell me what i may be able to do to fix the issues that arise?
 
I'll try to get to it in the next day or three - bit busy right now :(
 
Wouldn't mind doing some testing to help you out. This weekend I'll launch Boot Camp and install Vista, but it seems I went straight for the civ iv/bts combo so it might be a couple of weeks b4 I get Warlords -- cheaply by snail mail.
 
Here are the errors that cause problems with WW2.2 in the Windows version of Warlords:

1. XML/Art/CIV4ArtDefines_Unit.xml - Line 312:
Element content is invalid according to the DTD/Schema
You have no <ShadowDef> tag before the <fBattleDistance> tag in the <UnitArtInfo><type>ART_DEF_UNIT_WAFFENSS</type> ... element.

I copy/pasted the <ShadowDef> element from the next <UnitArtInfo> into it.

2. Same problem with BISMARK, HMS_HOOD

3. This may be related to your unhappiness issues:

XML/Units/CIV4UnitInfos.xml - Line 1221
<iHappiness> is not declared in the DTD/Schema.

I removed that line.

The Windows version clearly cares about compliance with the Schema files. The Mac version appears to ignore them. This caused some of Flintlock's problems as well.

You need to ensure that you meet the requirements for each element structure laid down in the schema file defined at the top of your XML file. If an element is specified to be inside another element, then it must appear, in the order given in the schema, unless its minOccurs property is zero.

The mod now loads as far as initEngine and then crashes Warlords. This is the same behaviour as Flintlock's mod on my system.

If you can suggest a Warlords mod that is known to work in Windows Warlords, and has similar characteristics to your mods - modified units, civs etc. then I can check whether that works OK here. If so, then there is likely to be something about your Mac-generated mods that causes the problem. Note that some Windows users don't get my crash with Flintlock's mod, so it seems to be somewhat system-sensitive.

Attached are the two modified XML files that get through initXML phase on my system. I've no idea whether the shadows I have copied into those units are reasonable ...
 

Attachments

@ iggymnrr
If you haven't bought your disk already, I'd recommend XP over Vista for Civ. It seems there are problems with it which esp. flaunt themselves in mods.

@ Alan
When I used to use TextWrangler, on certain occasions the indentations in the XML would be messed up (sometimes when I loaded up my techinfos, I would be all in a straight line! :eek: ) This made it esp. difficult to get the correct indentations, and I noticed the errors while using Smultron.
Where I'm going with this is...
how picky is the Windows versions with XML? I've come across a few incorrect syntaxes, so I'm sure there's more.

Also, The J noticed there most likely an error being produced because of the text tags. He was able to load the game in German, but without text since I deleted those tags. The symbols for Windows are sometimes illegal on Macs, so we figured the same must be true for the Windows trying to use Mac symbols. Do you know if there is a Windows equivalent to Zap Gremlins?
Thanks for the help! :)
 
@ Alan
When I used to use TextWrangler, on certain occasions the indentations in the XML would be messed up (sometimes when I loaded up my techinfos, I would be all in a straight line! :eek: ) This made it esp. difficult to get the correct indentations, and I noticed the errors while using Smultron.
Where I'm going with this is...
how picky is the Windows versions with XML? I've come across a few incorrect syntaxes, so I'm sure there's more.
I've responded to this elsewhere. White space is irrelevant in XML. Spaces, tebs, new lines should all be ignored by the parsers as long as they are not within the tags and element data. If you are losing indentations it is more than likely that one text editor is set to put spaces in place of tabs - eg 4 spaces per tab, and another is set to s different tab:spaces ratio. Stick with one editor if you want pretty text layout, or make sure the prefs are set consistently in all of them.
Also, The J noticed there most likely an error being produced because of the text tags. He was able to load the game in German, but without text since I deleted those tags. The symbols for Windows are sometimes illegal on Macs, so we figured the same must be true for the Windows trying to use Mac symbols. Do you know if there is a Windows equivalent to Zap Gremlins?
Thanks for the help! :)
The crash I'm getting is likely because some graphics file that's expected according to the XML is not found, or is corrupt. The Mac may be more forgiving of that sort of error than Windows.

Zapping Gremlins reduces a file to a "lowest common denominator" of basic printable ASCII codes. If all your Gremins are zapped the file should not have any problems on any platform, although it might not look too good to a non-English speaker.

I hadn't looked at this before, but I just tried zapping your /XML/Text files in Battle of Hastings and found some. XML/Text/Civ4GameText_Warlords_Civilopedia.xml has lots. It claims to be ISO-8859-1, but it is multilingual, and contains a variety of different character encodings. I've replaced the gremlins with html-escaped codes which should be OK in any system, but it still crashes on my system. The modified file is attached FWIW.

[PS] Windows seems generally much more tolerant of messy encodings in the XML files. I'm sure the mixed text in the above file would work fine on Windows.
 

Attachments

Thanks for fixing that Alan. :)
As far as missing/bad graphics are concerned, do you think it could be something to do with the formationinfos.xml? I had to delete tags related to the units I removed, but I never seemed to need to add in tags for the units I added. I noticed in the Napoleonic Wars mod (which is basically my reference for comparison) there were tags relating to the new units.

Could this be the missing graphics you are talking about? (That would suck, since that file is a terrible one to deal with. :sad: )
 
I've done a quick search, and as far as I can tell it isn't essential to change the CIV4FormationInfos.xml file for new units.

I'm a little nervous about the fact that you say you have *deleted* units. Why would you do that? Couldn't you just change the defaults, leaving the unused units in place everywhere? Deleting anything leaves great opportunities for references you haven't spotted to be left hanging.
 
Back
Top Bottom