In response to a request by Pedrunn (sort of..) and because I'd been intending to do something like this I have written a program to process templates intended to duplicate sections of SLIC code. This is not as powerful as I had hoped at present, but to go any further I'd have to incorporate the system into CTPEd (something I intend to do, but people would probably want a seperate program).
The basic intent is to generalize the program that I previously wrote for helping with the advance with city capture code for other purposes.
This amounts to generating repetetive code based of the contents of the data files.
Now you can make template files (I suggest .slt) which are processed into complete and final .slc files, removing the intermediate copy-paste step that there was before. I have also added further functionality to access the fields within the entries (in a limited way) and supply the number of the entry for use with array indicies and such like.
Attached is the executable, zipped with a sample template file including details of how to use this and the processed SLIC file which should be output from the sample template.
Any feedback welcome - there are no doubt some things I could quickly add if they are desired but haven't thought of.
Here's a short sample of output, based on something Pedrunn was wanting:
The basic intent is to generalize the program that I previously wrote for helping with the advance with city capture code for other purposes.
This amounts to generating repetetive code based of the contents of the data files.
Now you can make template files (I suggest .slt) which are processed into complete and final .slc files, removing the intermediate copy-paste step that there was before. I have also added further functionality to access the fields within the entries (in a limited way) and supply the number of the entry for use with array indicies and such like.
Attached is the executable, zipped with a sample template file including details of how to use this and the processed SLIC file which should be output from the sample template.
Any feedback welcome - there are no doubt some things I could quickly add if they are desired but haven't thought of.
Here's a short sample of output, based on something Pedrunn was wanting:
Code:
PEDRUNN_PILLAGED_IMPROVEMENT[0] = TerrainImprovementDB(TILEIMP_ADVANCED_FARMS); PEDRUNN_PILLAGE_BONUS[0] = 500; PEDRUNN_PILLAGED_IMPROVEMENT[1] = TerrainImprovementDB(TILEIMP_ADVANCED_MINES); PEDRUNN_PILLAGE_BONUS[1] = 800; PEDRUNN_PILLAGED_IMPROVEMENT[2] = TerrainImprovementDB(TILEIMP_ADVANCED_UNDERSEA_MINES); PEDRUNN_PILLAGE_BONUS[2] = 1000; PEDRUNN_PILLAGED_IMPROVEMENT[3] = TerrainImprovementDB(TILEIMP_AIR_BASES); PEDRUNN_PILLAGE_BONUS[3] = 1000; PEDRUNN_PILLAGED_IMPROVEMENT[4] = TerrainImprovementDB(TILEIMP_AUTOMATED_FISHERIES); PEDRUNN_PILLAGE_BONUS[4] = 1400;
Comment