trepan wrote:It sounds to me like you want a BOS -> COB compiler built into the engine,
and a way to modify the input BOS file before it gets compiled. Could you
explain exactly what you want?
P.S. Implementing my version of your suggestion would probably mean that
it would take significantly longer to load mods with a lot of units.
Not necessarily modify much, just being able to "copy" a COB would be a good deal (e.g. Spring.LoadCobAs(cobname, newname)). Imagine you have e.g. ten levels of creep and you want to use lua defs to create the defs for the different levels while only making one definition file for the creep type. Now this would be fine except you won't have matching COBs for your different creeps so if you have ten levels of creeps you still need to have the creep1.cob - creep10.cob files and if you decide to add ten more levels you'll have to manually copy those files to creep11.cob and so on.
For handling differences in the intended script behaviour I think it'd be enough to initialize some static-var differently for each creep level and let the scripter have his code branch if he needs that. This part could probably be handled by a LuaRule anyway so any code for that in the def stuff would be merely for convenience.