Editable Stored Actions by Ron Newcomb Search for other extensions by this author Approved for the Public Library

Versions

Download version 10/150410For Inform 7 6L38

Links

Description

This extension extends section 12.20 of Writing With Inform. The individual parts of a stored action -- actor, noun, second noun, action name -- can be changed directly. Also exposes new parts: request, text, participle, preposition, number, and each kind of value.

Tags actions

Documentation

This extension allows us to directly change the parts of a stored action. The standing orders are a stored action that varies. The soldier on point is a person that varies. Guarding it from is an action applying to one room and one direction. change the action name part of the standing orders to the guarding it from action; change the actor part of the standing orders to the soldier on point; change the noun part of the standing orders to the battlefield; change the second noun part of the standing orders to north; This extension also exposes a few new parts of a stored action. The request and numerical parts can be changed in the same way as the earlier four. The rest can only be read. request part of S text part of S preposition part of S participle part of S number part of S second number part of S The request part is an either/or property that differentiates between "Bob jumping" and "asking Bob to try jumping". (The latter rule, if executed, would first consult the persuasion rules. It is not referring to either of the asking actions in the Standard Rules "asking it for" nor "asking it about".) The text part is only of interest to actions which apply to a topic. The text part stores the player's entire command, not just the topic part. If the action name part of a stored action is changed, this obviously invalidates the text part. The preposition part returns the preposition used between the two nouns, for those actions that apply to two nouns. For example, the "telling it about" action has "about" as its preposition. Similarly, the participle part would be "telling". These two parts may be used on just the action name (such as "the giving it to action") in addition to a stored action. The number and second number part are for actions that apply to a number or kind of value. Actions can only apply to a single number or kind of value, never two, but if an action also applies to an object, the number part may be first or second. We can test if a noun or second noun is an object by the phrases. *: if the noun part of (a stored action) is an object, if the second noun part of (a stored action) is an object, For the phrases that return the participle, preposition, or whether or not a noun is an object, we may also use an action name instead of a stored action. This is because the returned information is constant, not depending upon a particular instance. For example: say "[the preposition of the asking it for action]"; unless the second noun part of the dialing it for action is an object: say "[the second number part of the current action]"; A final, small feature: we may ask if a stored action involves a particular action name (i.e., if it involves a particular verb). There are easier, more direct ways to do this, except if the action name is in a variable. let the possibility be a random action name; if the best idea yet involves the possibility: say "And suddenly, a hope; a connection. [The best idea yet] may fall within your realm of possibilities."; The phrasebook of the index lists these phrases succinctly. [A caveat: the extension currently has a limitation regarding using constant values. The following will produce a compiler error: change the actor part of the standing orders to Charlie; Instead, a workaround is offered: Charlie is now the actor part of the standing orders; This limitation affects actor, noun, and second noun. We apologize for the inconvenience.] Example: * The Ultimate Puzzle Solution - A kind of value's not-so-kind example *: "The Ultimate Puzzle Solution" Include Editable Stored Actions by Ron Newcomb. The backyard is room. A Rubik's cube is a thing carried by the player. Feet are a kind of value. 10' specifies feet. Throwing it is an action applying to one object and one feet. Understand "throw [something] [feet]" as throwing it. Pent-up frustration is a stored action that varies. Report throwing it: now pent-up frustration is the current action; change the second feet part of pent-up frustration to the feet understood plus 10'; say "Although [the current action] was all you intended, you find yourself [pent-up frustration] instead." Test me with "throw rubik's cube 30['] " Example: *** Editable Stored Actions - Allowing our player a CHANGE command similar to the author's *: "Editable Stored Actions" Include Editable Stored Actions by Ron Newcomb. Section 1 - Basic setup The best idea yet is a stored action that varies. Place is a room. Bob and Joe are men in place. A rock is in place. Persuasion: rule succeeds. When play begins, now the best idea yet is the action of Bob giving the rock to Bob. Instead of looking, say "You see an action here: [bold type][the best idea yet][roman type]." Test me with "change the second noun to joe/do it/change the request to true/do it/change the second noun to me/l/change the action to jumping/jump/do it/eh/l/change the request to false/do it/l/x joe/do it/tell joe about stuff/do it/ask joe for rock/l/change the noun to rock/x noun/x second noun/do it/change second noun to rock/do it/x preposition/x participle/eh". Section 2 - The verbs DO IT, EXAMINE, and CHANGE Understand "do it" as executing. Executing is an action applying to nothing. Carry out executing: try the best idea yet. Understand "examine [text]" or "x [text]" as inspecting. Inspecting is an action applying to one topic. Carry out inspecting "prep/preposition": say "The preposition is [bold type][preposition part of the best idea yet][roman type]." Carry out inspecting "participle/name/action-name/action": say "The participle part is [bold type][participle part of the best idea yet][roman type]." Carry out inspecting "topic/topical/text/textual": say "The topic part is [bold type][text part of the best idea yet][roman type]." Carry out inspecting "actor": say "The actor part is [bold type][actor part of the best idea yet][roman type]." Carry out inspecting "noun": say "The noun part is [bold type][noun part of the best idea yet][roman type]." Carry out inspecting "second noun": say "The second noun part is [bold type][second noun part of the best idea yet][roman type]." Carry out inspecting "request": say "The request part is [bold type][if request part of the best idea yet]true[else]false[end if][roman type]." Understand "change [text] to [any thing]" as changing it to. Changing it to is an action applying to one topic and one visible thing. Check changing "actor" to: if the second noun is not a person, say "Actors must be people." instead. Carry out changing "actor" to: change the actor part of the best idea yet to the second noun. Carry out changing "noun" to: change the noun part of the best idea yet to the second noun. Carry out changing "second noun" to: change the second noun part of the best idea yet to the second noun. Carry out changing "request" to truth: change the request part of the best idea yet to true. Carry out changing "request" to falsehood: change the request part of the best idea yet to false. Report changing it to: say "The best idea yet has been changed to [bold type][The best idea yet][roman type]." Section 3 - CHANGE an action name Understand "change action/name/action-name [text]" as a mistake ("To change the stored action's action name, try to do that action. For example, JUMP will change the action name part to the jumping action. (Sorry, parser difficulty.)"). Instead of doing something except executing, inspecting, or looking when the current action is not changing to: change the action name part of the best idea yet to the action name part of the current action; say "The action name part (only!) has been changed, yielding [bold type][the best idea yet][roman type]." Section 4 - Niceties, workarounds, and debugging The block giving rule is not listed in any rulebook. Instead of someone jumping, say "[Actor] leaps high into the air." Truth and falsehood are things. Understand "true/yes" as truth. Understand "false/no" as falsehood. After reading a command when the player's command includes "the", cut the matched text. Understand "eh" as a mistake ("actor: [actor part of the best idea yet][line break]action name: [action name part of the best idea yet][line break]noun: [noun part of the best idea yet][line break]second noun: [second noun part of the best idea yet][line break]request? [if request part of the best idea yet]yes[else]no[end if][line break]topic: [the text part of the best idea yet][line break]participle: [the participle part of the best idea yet][line break]preposition: [preposition part of the best idea yet][line break]").