Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter - Polling running activities
    [Oddly, Inform doesn't provide an I7 phrase for checking whether an activity is running *with a given parameter*, though the template code does provide that functionality. This phrase wrapper provides us the ability to test this.]

    To decide if (A - an activity on values) is running/going --/on with parameter/-- (O - a value) parameter/-- specified/--:
        (- TestActivity({A}, 0, {O}) -)

    To say currently running input loops:
        let count be 1;[The count will be 1 more than the number of loops we have listed.]
        say "The following input loops are currently running:[line break]";
        if the reading a command activity is going on:
            say " [count]. [italic type]Main input[roman type]: primary.";
            increase count by 1;
        repeat with loop running through input-loops:
            if the input looping activity is running with the loop specified:
                say " [count]. [italic type][loop][roman type]: [if loop context of loop is g-primary]primary[else]secondary[end if].";
                increase count by 1;
        if count is 1, say " No input loops are running.";
        if count > 3:[There are three or more input loops running.]
            say "[line break]***Warning: There are more than two input loops running simultaneously."

    [Inform's "not for release" doesn't refer to the DEBUG constant, but that would actually be preferred—we may for example want to debug a blorb file, especially if we have a multimedia game, and this is made impossible by "not for release," which is controlled by I7 and works only when the Release button has been pressed in the IDE. The upshot is that we need to use a bifurcated means of including debugging code. By including the Extended Debugging extension, we can produce a blorb file (i.e., a "release" build) with the debugging command. Failing that, our debugging command will only be usable in the IDE.]