Almost anything else? Honestly, XML is ugly and repetitive and hard to read. Of course, I don't expect you to go and roll your own DSL like Paradox does for Clauswitz (even though it is much nicer to work with), but maybe you could convert to using JSON?
There are a thousand libraries for dozens of languages for parsing JSON (i'm fond of Newtsonoft.JSON myself, use the C# implementation at work a lot) and it's super easy to work with.
Observe wrote:Mission Director XML is good with me. I am happy to hear they are keeping it. While I used it to the extent I needed, I was never a big fan of X3 scripting and was happy to see it dropped.
md scripting was hard to understand at first, and once you've understood the workflow, the next big problem was to keep the "overview": the bigger the script, the more likely you loose the context and make some mistakes. in msci scripting, you can easily keep parts a bit in order, for example with "gosub / endsub". besides that, there were no <xml-tags/> and you didnt had to reload the game in order to test your stuff
xirsoi wrote:Honestly, XML is ugly and repetitive and hard to read.
exactly, X3 msci scripting was also internally stored as xml, but you never had to deal with that because there was an ingame editor which displayed the script very well (procedural, kind of C-style), we could easily make changes and test them immediately, without having to reload
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.
what we know now is that there wont be "MSCI"-style scripting, only "MD"-style
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.
XML wouldn't be my first choice as an end-user language.
They used it for WIX installer but that felt like they probably planned to put a UI over the top and use it as a save format, but never got round to writing the UI.
Shimrod wrote:XML wouldn't be my first choice as an end-user language.
They used it for WIX installer but that felt like they probably planned to put a UI over the top and use it as a save format, but never got round to writing the UI.
There are UIs for Wix. I think they made it XML so it was a standardised "command line" type interface that could be generated by something else.
JSDD wrote: and you didnt had to reload the game in order to test your stuff
...
without having to reload
If you just changed already existing Scripts Loading a Savegame is enough, or even faster: use the Debug Commands "reloadai" "reloadmd" and "reloadui". If new Files are added this doesnt work though, i guess because Files are indexed on Startup..
i am also pretty sure i gave you that hint multiple times already. (i even mentoined them on the previous Page)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
plamen wrote:Maybe someone should make a C# / Python / JavaScript / Whatever-Language compiler to XML MD.
because its very unlikely it would properly utilize the mechanics of MD (Event-Based, Namespaces, MD-Instances, Expression Chains...) this would probably result in weird and inefficient code...
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Conservatively compiled MD code wouldn't lose anything, unless the compiler were half baked. In general, a compiler is just a translator from some format to another format, the latter generally being closer to execution ready. If you take the trivial case of the input and output formats being matched (eg. the compiler takes MD xml code as input, and spits it back out), every MD capability would be preserved.
Xml has a lot of excess cruft that could be trimmed off, so a rudimentary compiler input format might just be a 1:1 mapping of MD nodes with an alternate syntax. Eg. a python-like syntax for block indentation would allow removal of the block closing tags like </do_all>, most of the node start/end tags ('<', '/>') could be trimmed (when not multi-lined), and most of the quotation marks could be omitted (when a space isn't present in the string).
Once the syntax is cleaned up a bit, the compiler could be expanded with extra coder convenience features, eg. function calls to be inlined at compile time, support for splitting code across multiple source files, etc. It could even have an editor built for it, similar to Exscriptor for X3, though it might be better to try to integrate into an existing developed editor, eg. setting up a custom language format for Notepad++.
On the other end of the spectrum would be a compiler that could take generic C++/Python/etc. code and process its AST into MD nodes. That would be an effort to get functional, and hard to make efficient, so it is probably too much effort for anyone to put into modding a niche spaceships game for no pay.