Lines of Communication

version 1 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next

  • Section: Communicating with File Channels

    To send some text to a file channel:

        inform the chess computer that "play queen's gamble";

    (You can of course use any style of outgoing communication you like and that your external program expects, as long as it can be represented by a line of text.)

    Multiple outgoing commands will be automatically placed on individual lines. External programs are expected to clear lines as they accept each one for input. These programs should honor Inform's file format expectations (i.e. the first line should be left alone; the first character identifies whether the file is locked or unlocked; etc., see Files in the documentation for more information.)

    For incoming data, external programs should write one command per line (or multiple commands separated by periods) to the input file. You should ensure that these commands can be successfully parsed by your story. The extension will clear an input line it has finished reading from the file.

    Since external files are sending parseable commands, it's possible for your players to use these commands too, if they know what they are. While often it's enough to create new verbs with obscure names, you can also definitively restrict an action to only be allowed when passed in by a file channel by marking it "restricted to file channels."

        Updating meta info is an action applying to one thing. Updating meta info is restricted to file channels.

    You can also check directly whether a command was generated by an external file rather than the player by checking the truth state "processing external commands" during any action rule.