I6: Replacing Library Messages

I want to rewrite quite a lot of the messages in LanguageLM … but I’m having trouble seeing how to do this in my own source code, and none of the documentation I’ve consulted (including DM4, Roger Firth’s resources, and so forth) seems to explain how to undertake this obviously desirable activity.

I’ve made a copy of the entire LanguageLM routine. The question is where to put it. It’s in a file by itself, and I want to Include that file at some point in my .inf file. But no matter where I put it, the compiler doesn’t like it. The compiler (6.31, running in Windows 7) complains, “Error: Expected routine name but found LanguageLM.” The keyword ‘replace’ gives me a whole slew of error messages, so I’m pretty sure it isn’t what’s needed.

I can, of course, hack verblibm.h in order to redirect L___M, but I don’t like to resort to that sort of trickery. There must be a way to do this…

Suggestions? Thanks in advance!


I would recommend you to use the LibraryMessages object instead of LanguageLM routine as is explained in DM4: http://www.inform-fiction.org/manual/html/s25.html

To use the LanguageLM routine in your own code, you should do a simple hack in english.h first. The trick consists on omit the entire original routine when compile; for example, placing it between #Ifdef WITHOUT_MESSAGES; / #Endif; statements (as does the spanish library INFSP). Then, in your code, you must declare a WITHOUT_MESSAGES constant and write your own LanguageLM routine after including Parser.h and before including Verblib.h. And that should work!

PS: Sorry for my english if it’s not very good.

Aha! Thank you! I knew there was a way to do it, I just didn’t remember what it was.