you know how in c you can use macros to blot out sections of code you need disabled or select from a series of code blocks based on some option? what if we could do that with tables?
often modders end up working across multiple versions of the engine during the course of mod development. say you want to use features in an experimental build, but still do most of your deving under stable. you ususally end up getting the way you want them and then commenting them out until they hit trunk. what about we do something like:
$tried and true setting that works in stable build: 42
?ifvers: 3.6.13
$tag that works in only in 3.6.13 and should be ignored everywhere else: 69
?endif
?ifhighervers: 3.6.13
$tag that only works in builds after 3.6.13: 3.14159
?endif
?iflowervers: 3.6.12
$tag that was deprecated after 3.6.12 and shouldnt be used anymore: "your mom"
?endif
the syntax starts with some character that would otherwise be treated as a comment and skipped such as, "?" (i used ? but it could just as easily be an @ or a &), followed by the comparation type:
if: true if values match
ifnot: true if values do not match
ifgreater: true if value is higher than attribute
iflesser: true if value is lower than attribute
the next part defines the attribute that is being checked against. i used the games version number (the short version, in practice the long version would be better). i figure you might also want mediavp version, or versions from other mods you are using. this would be followed by the ":" character and then the value which would be parsed as a string and handled differently depending on the attribute name.
so we got:
"?"+comparation type+attribute name+":"+value
;text block containing table tags
?end
and if the conditional statement is true, the text block is parsed, otherwise its treated as a comment and skipped. you might also do ?else and ?elseif statements, but those could be constructed from these primitives. just an idea, not gonna assume modders would understand or use this. many of them would likely go "wtf?!?". but for large scale mod projects deving off of multiple versions i think it would come in handy.