For a number of years I've been using a small app called PolyGen (available for Win, Linux & Mac):
PolyGen is a program for generating random sentences according to a grammar definition, that is following custom syntactical and lexical rules. It takes a text file as source program defining a grammar by means of BNF-like rules and executes it, eventually showing the result. Here a source program is a grammar definition, the execution consists in the exploration of such grammar by selecting a random path and the result is the sentence built on the way.
PolyGen help creating randomly patchworked texts (on any lenght) to auto-generate description which vary in time. Random productions are based on rules, so output text keeps track of consistency of gender and number when stitching together the various random outputs. It's very handy and it has been used in Muds to autogenerate descriptions, characters, but also code snippets, ecc. After my question I'll post more info and links about PolyGen (for those interested).
QUESTION...
My question is: I'd like to integrate polygen's output with Evennia, how? I haven't come across anything in EV docs so far that mentions restictions or proper ways to do it. Can I just put in my Envenia python script a link to an external python script which will stream out the produced text when invoked? Are there catches and caveats to implementing this? PolyGen is quite fast in outputting the text, so could I just have Ev on hold with a STRING = myscript.py approach (meaning the variable will accept as string value the output of my script) or is it better to setup some asynchronous method?
I see great potential for PolyGen in Evennia.
as an example, at this link there is a source file of an Italian Mud (Maciste) which relied on PolyGen in it's hard-code:
Thanks for any help you can give me to integrate it into Evennia.
Tristano (Italy)
MORE INFO ON POLYGEN
The program was created by an Italian professor. It's written in OCaml . This is the download page (Win, Linux & Mac) of the official website:
The site is no longer mantained (PolyGen is stable and finale), but there is a FaceBook group for PolyGen:
There are a few example grammars in English, but because the app is italian it hasn't spead so much in the English world.
The English manual can be found inside this zipped archive:
or individually, as a single HTML source:
Some links of interest related to PolyGen:
A FEW NOTES ON POLYGEN
PolyGen has his own (OCaml-like) syntax for writing text-grammars. There is no "#include" function in it, so to stitch-up multiple grammar templates I have to use some pipelining scripts. Basically, as an example, I've built a PolyGen grammar that outputs fantasy character names, another one names of places, ecc, so when I create a grammar to output a specific description for a context and I need to use the names of character and places, I create a script which pipes all thre of them and feeds them to PolyGen, so that all definitions will be reachable to the program. An "#include" function would have helped, but there isn't one...
So far I've used it to customize email-templates signature and quotations, and even on a local Apache server for HTML pages code randomization.