Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
However, one thing I noticed and hopefully might give a clue is that when I remove the "import aiml" line in AIMLbot.py and run the game, the error changes to
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 10, in script
$ import AIMLBot
File "game/script.rpy", line 10, in <module>
$ import AIMLBot
NameError: name 'aiml' is not defined
So the script loads but obviously cannot find what it needs.
I'm getting the utf8 error only when Renpy tries to import aiml - it's the same with my own AIML python script.
To be more exact, if I make a simple hello.py script with only print "Hello world" and import it into renpy, I don't get any error and I see "Hello world" in the terminal when I run the game.
When I add import aiml at the beginning of that script - instant utf8 error! Same script, same encoding.
I built a distribution package of my working example, it contains all necessary files. Can you download it and try if it works on your machine?
IF it works (it should?), copy the 'game' folder with all files into your SDK directory and use it as a template.
For those who want to try: Warning! Eileens replies are not written by me, but generated 'just-in-time' by pyAIML, using the Free A.L.I.C.E. AIML Set (licensed under the GNU Lesser GPL). If you get strange or rude replies during your 'discussion' with the bot, don't blame me!
I was missing the xml folder and the pprint.py. If the pprint is optional and written by you, then the culprit must have been the xml folder which I think I didn't have in the pyAIML distribution I was using...
Hm, I have no idea why you got this 'utf8' error? I got an error that xml.sax and pprint couldn't be found before I downloaded and extracted both into the 'game' directory.
Anyway, I'm glad to hear that you got it working finally.
BTW, just a hint: You're not dependent on user input. For example, I tested pyAIML and 'Jokes.aiml' from Square Bear's AIML files together with saguaro's 'Basic Message System', and it worked quite well. The bot would send me a randomly selected joke to my virtual inbox each time I triggered it with