Protagonists

I have created an extension, called “Protagonists”, which is designed to provide several conveniences for IF with multiple playable characters (where the player can play as any one of several different people). It currently provides support for 3 things:

  1. PLAY AS a person (this is trivial, but useful, so included for completeness)

  2. ALICE, FOLLOW ME and similar (currently only supports following the player; if there is interest, I may add support for other leaders)

  3. A very general system for giving orders to groups of people (independently of persuasion). Requires Questions by Michael Callaghan; the rest of the extension will still work without Questions.

The third will require some explanation. Here’s an example session:

[spoiler]>test me
(Testing.)

[1] light lamp
You switch the lamp on.

[2] order
Order what action?
1 - Travel as a group.

[3] 1
Alice, Bob, Carol and David are now following you.

[4] s
David, Carol, Bob and Alice follow you.

Narrow passage
The passage extends north and south.

[5] s
David, Carol, Bob and Alice follow you.

Cave
Your lamplight casts hundreds of shadows all over the cave. There are exits in the four cardinal directions.

You can see a Beast here.

[6] l
Cave
Your lamplight casts hundreds of shadows all over the cave. There are exits in the four cardinal directions.

You can see David, Carol, Bob, Alice and a Beast here.

[7] order
Order what action?
1 - Stop here for now.
2 - Run away.

[8] 2
Alice, Bob, Carol and David flee the area.

[9] l
Cave
Your lamplight casts hundreds of shadows all over the cave. There are exits in the four cardinal directions.

You can see a Beast here.[/spoiler]
The player can issue the command ORDER. The game will prompt them with a list of available orders, and the player chooses one. Currently, the extension includes 3 options:

  1. Continue, which causes people to follow the player.
  2. Stop, which causes people to stop following the player.
  3. Regroup, which tries to bring people to the location by repeatedly generating EXIT actions.

Obviously, the “run away” order is not built-in. I coded it as an example. Here’s what said code looks like:[spoiler][code]Definition: A person is afraid if it can see the beast

Table of Orders (continued)
Order Printed description Targeted people
flee “Run away.” –

When play begins:
Target flee at visible obedient other afraid people.

Giving an order to someone (called P) when the relevant order is flee:
Let place be a random adjacent room;
If place is a room:
Let thataway be the best route from the location of P to place;
If thataway is a direction:
silently try P going thataway;
If rule succeeded:
Silently try P waiting;
It is complied with;
It is not complied with.
For printing the failure to comply of someone (called P) when the relevant order is flee:
Say “[The P] appear[s] to be stuck here.”
For printing the compliance list of a list of people (called A) when the relevant order is flee:
Say “[A with definite articles] flee[list-based s of A] the area.”[/code][/spoiler]
Since very few games with this extension will fit into Z5, I’ve marked it as Z8 or Glulx only.

The extension has not yet been beta-tested; I’d appreciate it if the community could have a look. I’m particularly concerned about giving orders and following, in that order (changing the player is trivial and does not merit testing). Despite the lack of testing, I’ve tried to make its documentation as complete as possible; it should be understandable. Testers of the beta versions will be credited in the documentation (please specify how you want to be credited, or I’ll just use your username).

I’ve never actually seen anyone announce an extension for beta-testing here before, so if it belongs somewhere else, I’m sorry for posting in the wrong place. Thanks for reading all this!
Protagonists.txt (36.8 KB)

Sounds cool, but explicitly disallowing z5 because it might go over the size limits sounds a bit harsh. If there’s nothing inherently that would not work with z5, let the author make the decision which version to use.

No, I mean a redesigned version of Terror of the Sierra Madre, which has one room, two people, and a couple of other minor things, won’t fit into Z5 (I haven’t tried turning on memory economy, but seriously, there’s two people and a room, with a few extra rules. You’re going to turn on memory economy that early in your project?). It’s my opinion that you need to have two people and a room in order for the extension to be useful (it’s designed for “multiple playable people”, after all), so literally no-one would benefit by allowing Z5, and it is nice to let prospective authors know that it won’t fit.