Posted: Wed Feb 03, 2016 7:20 am Post subject:
Writing CSF files
Hi guys,
Anyone ever try to write a RA2/YR string table?
Well, I am!
With some help from AlexB I'm working on the code needed to write such a file.
I've taken Olaf's XCC code and looked at how he writes CSF files.
This is his code, for the sake of syntax highlighting I have created a paste of it: http://pastebin.com/H7Wz4hVe
This is the code I have: http://pastebin.com/uPBShnKw (ugly, because trial and error)
Note: writeToOfstream is a template, taking the data type of the passed value.
As you can see, there's no real difference in code. Olaf's does not seem to encode the value's wstring, but I could be wrong.
But somehow, mine breaks the format and causes the world to crash.
So I tried writing ra2.csf and I get a different file size than the original, straight from the MIX, CSF file.
Funny thing is, XCC also has a different file size. So there's 3 files, with 3 sizes.
I'm wondering, does anyone have experience writing these? Care to share some of the knowledge? _________________
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Feb 03, 2016 10:13 am Post subject:
What I only know - notsure if it helps at all - is that Marshall also made a csf writer thingy. http://marshall.strategy-x.com/vb6csf/index.php _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
That I cannot. I don't know what the game does when saving such a file.
I can create a working string table like XCC produces, but that's it.
I use a map, the game's CSF is not ordered. So you cannot get an identical file.
I'm not going to use an unordered map because it's slower and goes directly against the principle of a map which is... being about sorted.
Does it have to be identical? I mean, if it creates a working string table without loss of quality, then what's the problem?
Is this btw the point where you say, "but I can " ? xD _________________
If its just the order that is different then it shouldn't matter, so long as the individual entries in the files are the same. I'm just mindful that "it works" and "it works optimally" aren't always the same thing, plus I like trying to figure out exactly how the original generators worked. QUICK_EDIT
True, if the data is correct, all is fine.
So far it works and it works optimally, haven't run into any issues.
I'm curious as well. They probably just entered them manually in the editor or some tool, which wrote them unsorted to the file.
Wouldn't be surprised if they did not have the option to add ExtraValue at all. _________________
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum