Chapter 18: Activities

§18.1. What are activities?; §18.2. How activities work; §18.3. Rules applied to activities; §18.4. While clauses; §18.5. New activities; §18.6. Activity variables; §18.7. Beginning and ending activities manually; §18.8. Introduction to the list of built-in activities; §18.9. Deciding the concealed possessions of something; §18.10. Printing the name of something; §18.11. Printing the plural name of something; §18.12. Printing a number of something; §18.13. Listing contents of something; §18.14. Grouping together something; §18.15. Issuing the response text of something; §18.16. Printing room description details of something; §18.17. Printing inventory details of something; §18.18. Printing a refusal to act in the dark; §18.19. Printing the announcement of darkness; §18.20. Printing the announcement of light; §18.21. Printing the name of a dark room; §18.22. Printing the description of a dark room; §18.23. Constructing the status line; §18.24. Writing a paragraph about; §18.25. Listing nondescript items of something; §18.26. Printing the locale description of something; §18.27. Choosing notable locale objects for something; §18.28. Printing a locale paragraph about; §18.29. Deciding the scope of something; §18.30. Clarifying the parser's choice of something; §18.31. Asking which do you mean; §18.32. Supplying a missing noun/second noun; §18.33. Reading a command; §18.34. Implicitly taking something; §18.35. Printing a parser error; §18.36. Deciding whether all includes; §18.37. Printing the banner text; §18.38. Printing the player's obituary; §18.39. Amusing a victorious player; §18.40. Starting the virtual machine

arrow-up-left.pngContents of Writing with Inform
arrow-left.pngChapter 17: Understanding
arrow-right.pngChapter 19: Rulebooks
arrow-down-right.pngIndexes of the examples

§18.1. What are activities?

It is poor form to define with negatives, but the first thing to say about activities is that they are not actions. This needs saying because Inform often seems to treat them as if they are, by allowing us to write rules like so:

Before printing the name of a woman, say "Ms ".

With this rule in place, someone called "Daphne" will always be described as "Ms Daphne", and so on. The language looks as if we were imposing a rule on an action called "printing the name of", but there is no such action: instead, it is an "activity". To spell out the difference:

An action is a simulated task for the fictional protagonist.

An activity is a real task for the computer program doing the simulation.

Activities allow us to influence or change some of the standard habits of Inform, using rules as flexible and powerful as those applicable to actions, though activities are in several ways simpler and easier.

arrow-up.pngStart of Chapter 18: Activities
arrow-left.pngBack to Chapter 17: Understanding: §17.21. Precedence
arrow-right.pngOnward to §18.2. How activities work

*ExampleAnt-Sensitive Sunglasses
What are activities good for? Controlling output when we want the same action to be able to produce very flexible text depending on the state of the world -- in this case, making highly variable room description and object description text.