[IFID number] and other from [banner text] (reopened!)

Hi! I’m recycling a thread, don’t mind me. it’s the same sort of question anyway.

when i use banner text, i get

but is there a way to get just that line, or those parts, without actually using [banner text]?

I know there’s a way to [IFID], that’s what this thread was about.

original message:

I thought using say "[IFID number]"; would produce its IFID number… like it does with the rest of the stuff mentioned in the Library Card under Index.

So I can have all the things,

from the banner text, to all the extensions used… but only mentioning them once. and the full banner text, with IFID, mentions a few extensions.

I can solve all of this - if there’s a way to summon Cthulhu and have him recite the IFID number when called.

and I feel like §25.14 is lying to me.
[IFID] doesn’t work. :frowning:

so there’s no answer? damn.

To quote Section 25.14:

The IFID isn’t something you can directly access in your code, since it isn’t part of the story file.

It seems like it ought to be, though. Even if it’s not stored in the z8/ulx file itself, nothing prevents Inform from substituting it at compile-time. Feature request…?

The IFID is defined on an external file that Inform creates when you create a project. It’s just an UUID. You can copy it from the project’s library card and define it as a say phrase in your code, if you want to use it as such:

To say IFID: say "1974A053-7DB0-4103-93A1-767C1382C0B7".

There’s code in the VERSION command (the ANNOUNCE_STORY_FILE_VERSION_R function) which prints the IFID.

is there a way to be all liketo say IFID: try announcing story file version R.or something?

Because I’m not familiar with the back office part of the code.

Requesting IFID is an action out of world. Understand "IFID" as requesting IFID.
Carry out requesting IFID: follow the IFID announcement rule.

The IFID announcement rule translates into I6 as "IFID_ANNOUNCEMENT_R". 

Include (-
    for (ix=8: ix+2 <= UUID_ARRAY->0: ix++) print (char) UUID_ARRAY->ix; 
    print "^^";

Home is a room.

Test me with "ifid".

Monkeying around with I6 is usually the last resort, though, as there’s no guarantee the underlying I6 implementation will remain the same in future versions of Inform 7.

do i need the I6 line? just curious.

Yes. This is how it works, line by line:

  1. We create the Requesting IFID action, and make the parser recognize what it means.
  2. The Requesting IFID action is given meaning, in that invoking it triggers a rule we’re going to create, the “IFID announcement rule”. At this point we’ve not yet defined what that rule means; we haven’t even created it.
  3. This line is the key: it tells I7 that the “IFID announcement rule” exists (thus creating it), and that it refers to an I6 routine. It specifies that the corresponding I6 routine will be named IFID_ANNOUNCEMENT_R.

The rest should be reasonably straightforward: it’s basically cribbed from the ANNOUNCE_STORY_FILE_VERSION_R function in ZMachine.i6t, which in that respect is identical to the routine in Glulx.i6t. Which is nice since we don’t need two separate versions of the routine.

Anyway, if you’re at all unsure of I6 hacks, don’t use them. There’s a reason the manual recommends all alternative solutions before I6 hackery.

It would be easier to do it as a phrase instead of an action:


Btw, this would be a great question to ask on IF Answers, so then the alternative solutions can be voted on. :slight_smile:

I know, which is why I asked if I need the I6 line :slight_smile:

Thanks though!

If you’re asking whether there is a way to do the same thing without I6, then no, the variables you need are not currently exposed to I7.

this wouldn’t run. :frowning: sadly. or is there more than just this one line?

Presumably, Dannii’s use of IFID_ANNOUNCEMENT_R means that it triggers the IFID_ANNOUNCEMENT_R I6 routine from my example. So you’d need to include that.

when i use banner text, i get

but is there a way to get just that line, or those parts, without actually using [banner text]?

I know there’s a way to [IFID], that’s what this thread was about.

To say I7 version:
	(- PrintI6Text(NI_BUILD_COUNT); -).
To say I6 library version:
	(- PrintI6Text(LibRelease); -).
To say I6 compiler version:
	(- inversion; -).

Include (-	
[ GetReleaseNumber i;
	@aloads ROM_GAMERELEASE 0 i;
	return i;

[ PrintSerialNumber i;
	for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i;

To decide what number is the release version:
	(- GetReleaseNumber() -).

To say serial number:
	(- PrintSerialNumber(); -).

Man, I thought I could figure out bits of it if i saw more of it. It just… It’s like it’s random. O.O

These aren’t exposed to Inform 7 by default, since you’ll almost never need to access them directly. These are some wrappers around bits of I6 code taken from the code to print the banner text.

Every turn when Draconis mentions I6 code: say "I appreciate it. But I'd rather steer clear from I6 voodoo doodoo because [one of]reasons[or]it scares me[at random]."; now WesLesley is hiding under the bed.


1 Like