From what I can tell there are a lot of events in the current event-based systems that depend a lot on big lists of things for which the same event has to be duplicated - e.g. the artifact grant/confiscation system, the ethnicity trait assignment system, and parts of the magicka system.
Have people thought about using a template language to generate these event files instead? You could write the event as a template, and then compile it into its "raw" format with a .sh or a .bat file or whatever.
Just as an exercise I rewrote the current artifact_events.txt file using Jinja2 as a templating library:
https://gist.github.com/swwu/cf2114ffce1babf4eab1
For a total of about 410 lines of code, down from almost 9000 for the "raw" text version. It also has a few other benefits (e.g. changing the way artefacts are inherited or granted will now just require one code change instead of ~60 identical ones).
You can run it by just dropping both files into the same directory and running the python script (you need Python though, and Jinja2 installed somewhere on your python path). No particular attachment to Jinja in particular, it was just the easiest thing for me to pull in and get running.
Edit: here's the original artifact_events for comparison, as per r671 in SVN - https://gist.github.com/swwu/97dd440eb085f65f1478
Have people thought about using a template language to generate these event files instead? You could write the event as a template, and then compile it into its "raw" format with a .sh or a .bat file or whatever.
Just as an exercise I rewrote the current artifact_events.txt file using Jinja2 as a templating library:
https://gist.github.com/swwu/cf2114ffce1babf4eab1
For a total of about 410 lines of code, down from almost 9000 for the "raw" text version. It also has a few other benefits (e.g. changing the way artefacts are inherited or granted will now just require one code change instead of ~60 identical ones).
You can run it by just dropping both files into the same directory and running the python script (you need Python though, and Jinja2 installed somewhere on your python path). No particular attachment to Jinja in particular, it was just the easiest thing for me to pull in and get running.
Edit: here's the original artifact_events for comparison, as per r671 in SVN - https://gist.github.com/swwu/97dd440eb085f65f1478
- 1