:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Mon Dec 18, 2017 6:55 pm
All times are UTC + 0
 Forum index » Featured Tools » CnC Editing Tools
Writing CSF files
Moderators: CnC Editing Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 7:20 am    Post subject:   Writing CSF files Reply with quote

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?
_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Last edited by RP on Wed Feb 03, 2016 2:36 pm; edited 1 time in total

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyörgy, Hungary

PostPosted: Wed Feb 03, 2016 10:13 am    Post subject: Reply with quote

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
_________________



AS Discord server: https://discord.gg/7aM7Hm2

Back to top
View user's profile Send private message Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 2:35 pm    Post subject: Reply with quote

Alright, I got it to work.
There were some unknowns about writing empty values which is now fixed.


_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Wed Feb 03, 2016 9:17 pm    Post subject: Reply with quote

Can you round trip an original csf file? Load an original from the game and save an identical one out?

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 10:06 pm    Post subject: Reply with quote

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 Razz " ? xD
_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Thu Feb 04, 2016 8:37 am    Post subject: Reply with quote

No, no rabbits out of the hat like that Wink

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.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Thu Feb 04, 2016 9:02 am    Post subject: Reply with quote

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.
_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Mig Eater
General


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Thu Feb 04, 2016 9:57 am    Post subject: Reply with quote

Matthias Wagner (IIRC) made the first string editor RA2StrEdit, if your interested TibEd also comes with a string editor...
_________________



Back to top
View user's profile Send private message Visit poster's website YouTube User URL Facebook Profile URL Twitter Channel URL
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
 Forum index » Featured Tools » CnC Editing Tools
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise play the game below please contact the Administrator for help.


 
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


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.1289s ][ Queries: 12 (0.0153s) ][ Debug on ]