Editing Module:Test/data/doc
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Transformation rules == | == Transformation rules == | ||
− | === RimWorld | + | === RimWorld vesion === |
− | + | Vesion is added to the beginning of each generated data file. | |
<pre> | <pre> | ||
Line 17: | Line 17: | ||
<defName> is used as part of the index for the main Def table. | <defName> is used as part of the index for the main Def table. | ||
− | Additional | + | Additional attribute added: "DLC". |
<pre> | <pre> | ||
Line 26: | Line 26: | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 40: | Line 40: | ||
</pre> | </pre> | ||
− | Parent ( | + | Parent (absctact) Def that gets inherited: |
<pre> | <pre> | ||
Line 50: | Line 50: | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 67: | Line 67: | ||
</pre> | </pre> | ||
− | === | + | === Descriptions === |
+ | |||
+ | Because of some exceptions in Royalty Defs, <description> content has to be wrapped in double square brackets (Lua multiline syntax). | ||
+ | |||
+ | === <nowiki><li></nowiki> elements without children === | ||
Get transformed into ordered lists (numerically indexed Lua tables). | Get transformed into ordered lists (numerically indexed Lua tables). | ||
Line 77: | Line 81: | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 88: | Line 92: | ||
Note: a comma after the last item in a list is not flagged as an error in Lua. | Note: a comma after the last item in a list is not flagged as an error in Lua. | ||
− | === | + | === <nowiki><li></nowiki> elements with children === |
<pre> | <pre> | ||
Line 107: | Line 111: | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 126: | Line 130: | ||
</pre> | </pre> | ||
− | === | + | === <nowiki><li></nowiki> elements with a single attribute "Class" === |
The value of the "Class" attribute is used to rename the <nowiki><li></nowiki>. | The value of the "Class" attribute is used to rename the <nowiki><li></nowiki>. | ||
<pre> | <pre> | ||
− | + | comps = { | |
− | + | { | |
− | + | _ = { | |
+ | Class = "CompProperties_Glower", | ||
+ | }, | ||
+ | glowRadius = 10, | ||
... | ... | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 145: | Line 152: | ||
</pre> | </pre> | ||
− | + | NOTE: The first sample already underwent the transformation of attributes to a subelement. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Ranges (1~2) === | === Ranges (1~2) === | ||
− | + | : TODO | |
− | |||
− | |||
=== Curve points === | === Curve points === | ||
Line 174: | Line 173: | ||
</pre> | </pre> | ||
− | + | becomes | |
<pre> | <pre> | ||
Line 187: | Line 186: | ||
</pre> | </pre> | ||
− | === | + | === Components === |
+ | |||
+ | It would be useful to have some of the more used components. They can then be queried for additional functionality that some game objects have. | ||
+ | |||
+ | They can be numbered tables or, as in some of the examples above, string indexed. String indexes, in general, are simpler to use. Numeric tables I have to search through. | ||
− | + | See | |
− | + | '''TODO:''' implement filtering | |
− | |||
== Issues == | == Issues == | ||
Line 209: | Line 211: | ||
=== Inheritance (interaction with parser) === | === Inheritance (interaction with parser) === | ||
Inheritance can be handled by the parser or the module. If the parser handles it, then for any change the dataset needs to be recreated so I'm leaning towards letting the module take care of that. In this case the only purpose of the parser is to filter data and transform it into something Lua can use. | Inheritance can be handled by the parser or the module. If the parser handles it, then for any change the dataset needs to be recreated so I'm leaning towards letting the module take care of that. In this case the only purpose of the parser is to filter data and transform it into something Lua can use. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |