Wednesday, July 29, 2015

Configuration Files

I don't remember what prompted it, but something got me thinking about configuration files in Hugo and how I never perfectly designed a way to detect if an interpreter fully supports them.

See, the FILE_CHECK constant-checking method described in the Hugo manual doesn't work with Gargoyle.  Not only that, but Gargoyle can read configuration files- just not write to them- so if a configuration file has been created by another interpreter, previously, the game could easily be tricked into thinking everything is working fine.  Adding even more complication is that configuration-file-writing does work in the glk Hugo interpreter (even though no one ever uses that one) so I couldn't just do a simple "minimal port"check.

So I brought my attention to this the other day.  Eventually, my fix for the problem involved using Hugo's system-time-catching functionality (along with Future Boy!'s time-handling routines) to take the current time, save it to the configuration file along with everything else, then read the time back from the configuration file.  Then it calculates the difference between the two times, and if it's longer than 5 seconds (I'm trying to account for really slow computers here even if a 2 second timer would probably still be playing it safe), it calls the configuration error routine (so a game like "the Halloween Horror" can quit out, as it relies on configuration files).

In other news

Herr Jizaboz finished his demo game about a tourist in North Korea.  I've helped him with it here and there.  I hope people get a big kick out of it!


Looks like there was a Notepad++  update so I also updated the Hugo Notepad++ distribution.  You can get it here.

No comments:

Post a Comment