Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: assasing123 on March 27, 2012, 10:46:46 am
-
is there any specific reason of why ship weapon and whatever tables have to follow a specific order when typed (besides those lines that have sub data), for example:
why writing
$Shields: XXXX
$Shield Color: XXXX
$Power Output: XXXXX
works but
$Power Output: XXXXX
$Shields: XXXX
$Shield Color: XXXX
will totally **** it all up and make the game crash?
cant it be made that the parser reads the table in whatever order is it written and then rearranges it on memory to the order it expects? it would help a lot with organization and making section tables better.
thus alowing stuf likefor example:
Xfighter
Mobility section:
glide, speed, etc etc stats
Weapons:
guns, missiles, banks, etc etc
Effects:
debris, particles, engines etc etc
you get the idea...
-
This can't be changed without making fundamental changes to the way all the tables are parsed. The parsing code we have right now is simple and easy to work with, for both sides (developers and modders). Changing it to an XML-like parsing style would increase code complexity for a relatively minor increase in user friendliness; after all, there's a reason why we maintain the documentation on the wiki.
-
That and I find it easier to debug this way. If a required flag seems to be missing, it's pretty easy to just read down the list to find the one that isn't there (or is misplaced).
-
Not to mention it forces modders to keep their tables ordered, making them easier to read and keeping people from makng messy, difficult to debug tables.
-
if it aint broke, dont fix it
-
in that case is there any chance or way the order of the tables could be a little bit more organized? like a custom file to define the order of the table for the parser?
-
No. What if you wanted to share a tbm from one mod with another? Then the order wouldn't work anymore.
-
if it aint broke, dont fix it
^5