View Single Post
Old 01-28-06, 03:26 PM   #14
GlobalExplorer
Admiral
 
Join Date: May 2005
Location: Berlin
Posts: 2,015
Downloads: 165
Uploads: 0
Default

Quote:
Originally Posted by Stiebler
GlobalExplorer wrote:
Quote:
I have just found out that in your hand edited entries (Hospital ships etc) you mixed up the order of the Type and Class properties in Campaign_RND:

[RndGroup 1718.RndUnit 1]
Type=103
Class=NHOS
..

This should in fact be:

[RndGroup 1718.RndUnit 1]
Class=NHOS
Type=103

At least that is how the mission editor would write it.
Sorry if that's given you any difficulty.

However, the data lines are not fixed within ship descriptions. SH3 can read them in any order. That's why they are written as:
Type=103
Class=NHOS

and not as:
103 ;; Type
NHOS ;; Class.

This is a fairly standard way of entering data into a class or structure, that (in principle) allows error checking as the data is read. Who knows whether the original programmers actually carried out error checking?

But you should consider this for your own mod.

Stiebler.
That's all correct, but:

Have you ever tried to write a parser for the .mis files that uses something "safe" like GetPrivateProfileString() ?? I did, and, depending on the language, it takes 10-15 minutes to parse one of the .mis files. Thats because for every access in the form (Key,Section), the whole file must be searched. With ~200.000 lines in one file this gets a bit, er, slow. My current parser reads the file into an array, and then parses it in one direction. So in fact, it parses the whole file in a bit more than the time one (!) access to GetPrivateProfileString() takes. I'm not saying this is the best practice, but it is very fast, and I think Ubi will do it in a similar way, though probably more robust.

I highly doubt that the order can be completely random, otherwise Ubis parser would be extremely slow. Smaller deviations like the example will work, but I personally would not mess with these things.

This is just my personal opinion. But I think this is a bit like not paying attention to case sensitive names and saying: but it's working. In the long run, you will shoot yourself in the foot.
__________________

GlobalExplorer is offline   Reply With Quote