Extension issue


I’ve been away a while (but now I’m back so sorry about the foul stink) and I had some useful code which I could think about putting into an extension.

… but how do I make an extension? What’s the important things to keep in mind?

here’s a clippy thing to show you what kind of stuff it makes.

name and location.ulx (627 KB)
and I wanna finish up my apology/letdown generator which gives you reasons to get out of something like “i have to teach the pig accountancy” or “i’d rather drag my testicles across broken glass” and all

anyway, for pointers, please hook me up.

I could just post the code but then you’ll have to work it into the games yourselves and that’s a pain. plus i’d rather it be an extension so i appear in the credits. yes i’ve an ego. yes, that’s the thing you smell.

Check out chapter 27 of Writing with Inform and this set of extension guidelines.

I was actually hoping for ideas beyond that so my stuff doesn’t get in the way of the user’s stuff.

They’re helpful but I was hoping for things to do and things not to do because hoo boy sit down let me tell you a story.

Well, you read the thing. You saw how an extension is structured.

You have to name all of your rules.
You need to name things uniquely enough so that an author won’t clash with your namespace.
Your text responses need letters after them (A)

You want to avoid changing wholesale basic actions and behaviors unless the extension is specifically designed and documented about changing it (like Trinity Inventory restructures how inventory works and won’t surprise someone if they include it.)

You also want to make the extension as “generic” as possible. For example, your random name and address generator is cool, but you’d want to make it so an author can format the output how they want. For example, say I have a game where you’re in a waiting room and random names are called. Ideally your extension would let me just include it and then insert text - “The receptionist calls out: ‘[rand-last]? [rand-first] [rand-last]? You’re next.’” As you can see by this example, there would need to be a way to generate a person and then have tokens to say parts of their name a couple of times before randomly generating a new person.

can i use names that only make sense to the extension but won’t get in the way of when the user names stuff? like “let x be” creating a “temporary” x?

text responses with (letters) ? i don’t follow.

i don’t restructure, i only add. so that won’t be a problem.

and yeah it generates in portions and wholes at the same time so you can pick and choose, and it won’t reassemble a thing until told to.

No. You need to name things uniquely enough so that an author won’t clash with your namespace.

See §14.10. Responses and §14.11. Changing the text of responses.

I’ve tried understanding that a few times but … I got no idea what it’s for. Good news though. I’m pretty sure none of the things I’m gonna include will feature that.

I hope.

You just need to give your rules a name, and then supply a sequential letter with each response.

Before an actor doing something stupid (this is the stop people from doing something stupid rule): if the current action is dangerous: say "I'd rather stick my head in a hornet's nest!" (A) instead; otherwise if the current action is ill-advised: say "[We] should speak to someone about [our] violent tendencies!" (B) instead; otherwise: say "It would be more constructive teaching physics to a chicken." (C) instead.
That lets authors who use your extension change the responses with a simple statement:

The stop people from doing something stupid rule response (B) is "Yeah, and monkeys might fly out of my butt!"