Possible to determine the name of an action from an action number?

Followup to this post about Inform 7:

I7 generates an I6 table array which holds all possible actions a player can take. It’s formatted like this:

a screenshot of the Inform 6 code used to specify the ActionData array

The actions in this array are specified using ## notation, which seems to be automatically converted to an “action number” by Inform 6. Is it possible to determine the name of an action associated with a particular action number at runtime? For example, something like this?

PrintAction(##Inv); ! would print "Inv"

It’s the SayActionName() routine.

That I7 generated routine prints a human-readable name for the action, like “taking inventory”… is there a way to get the exact name (keyword?) of the action? Like “Inv” rather than “taking inventory”?

Or perhaps a way to change the “human-readable name” to match the exact name of the action in I7?

You talk about Inform 7, but tag the post as Inform 6. Not sure what you want.

For the Inform 6 library, you can do print "The action is ", (DebugAction) ##Inv, ".^"; but it requires DEBUG to be defined.

1 Like

This is exactly what I needed. Thanks!