Zounds! I am awed by this pronouncement! I picked a really good year to start following and working in IF again! Humbling and encouragement both, from the fountainhead.
Have you seen my previous answer about compiling on Windows?
Yes, but i don’t like cygwin. I’ve had nothing but problems from it in the past and don’t want to go back there again.
But after that you can use PowerShell if you copy the cygwin1.dll file from your Cygwin installation
Ah! The start of the cygwin DLL poisoning.
Cygwin is the only solution I found.
Except that I’ve now managed to build it without Cygwin. And, i think, you might have the answer there for the test scripts. I need to run it in the shell window.
So that nearly worked. I got a better error message. Here are my suggested hacks;
inweb\Materials\platforms\windows.mkscript add
SHELL = bash
inweb\Chapter 6\Makefiles.w
No backslashes in Makefile paths.
oid Makefiles::pathname_slashed(OUTPUT_STREAM, pathname *P) {
TEMPORARY_TEXT(PT)
WRITE_TO(PT, "%p", P);
LOOP_THROUGH_TEXT(pos, PT) {
wchar_t c = Str::get(pos);
if (c == '\\') c = '/'; // JKJ <- add this
if (c == ' ') WRITE("\\ ");
else PUT(c);
}
DISCARD_TEXT(PT)
}
So then i get the latest everything, rebuild and it works.
# ../intest/Tangled/intest inform7 -show Acidity
Inform 7 v10.1.0 has started.
I've now read your source text, which is 70 words long.
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
I've also read Standard Rules by Graham Nelson, which is 32168 words long.
The 70-word source text has successfully been translated. There were 1 room
and 1 thing.
Inform 7 has finished.
[1] Acidity passed
So, is it possible to inter into “C” and build a game? Any instructions on this or shall i delve into the docs. thanks.
I’ve found some things that may not matter much for IDE users, but that seem problematic for external editor/command-line users.
When you pass one of the intools a project name, there isn’t a test that the directory even exists, let alone that it looks like a project. With inform7, if the directory doesn’t exist, it does error out promptly with “Unable to create Build folder for project: is it read-only?”. If it does exist, but has no Source subdir, the error is:
→ There doesn’t seem to be any location in this story, so there’s nowhere
for the player to begin. This may be because I have misunderstood what was
meant to be a room and what wasn’t: I only know something is a room if you
tell me explicitly (‘The Observatory is a room’) or if you imply it by
giving map directions (‘East of the Observatory is the Planetarium’).
++ Ended: Translation failed: 1 problem found
inbuild is more problematic: if you typo the project name, you still get output suggesting it worked, even naming specific non-existent locations. For the following, there is no aoeuaoeu directory:
$ inbuild -graph -project aoeuaoeu
[f24] aoeuaoeu/Build/output.ulx
--build-> [f23] aoeuaoeu/Build/auto.inf
--build-> [f22] aoeuaoeu/Build/auto.inf
--build-> [c0] Aoeuaoeu
--build-> [f12] aoeuaoeu/Source/story.ni
--build-> [c8] BasicInformKit
--use---> [c14] Basic Inform by Graham Nelson v1
--use---> [c15] English Language by Graham Nelson v1
--build-> [c9] CommandParserKit
--use---> [c18] Standard Rules by Graham Nelson v6
--use---> [c11] WorldModelKit
--use---> [c18] Standard Rules by Graham Nelson v6 q.v.
--build-> [c1] English
--use---> [c10] EnglishLanguageKit
--use---> [c15] English Language by Graham Nelson v1 q.v.
And there’s no validation that extension filenames match the extension’s internal declaration of its name, or version, or even that it ends .i7x. Any file with any name in an extension author directory can say it’s any version of any extension. I discovered this 'cause I’m an Emacs user who tends to end up with “filename~” backup files, and such a file was being included over another file whose name ended .i7x. Given that with semantic version numbers, it’ll be easy to accidentally get internal version numbers and the filename mismatched if you ever manually edit, this becomes a likely source of errors. I’m guessing the IDEs will ensure the user doesn’t ever have to type an extension filename explicitly. (This one is I7-2089.)
Any help on changing variables programmatically for format=C.
Specifically, i’d like to change the prompt before the game runs.
So first i have to split i7_run_process into two parts, otherwise no variable exist.
static void run_process_prepare(i7process_t *proc)
{
i7_initialise_memory_and_stack(proc);
i7_initialise_variables(proc);
i7_empty_object_tree(proc);
i7_initialiser(proc);
i7_initialise_object_tree(proc);
i7_initialise_miniglk(proc);
}
static int run_process(i7process_t *proc)
{
int tc = setjmp(proc->execution_env);
if (tc) {
if (tc == 2) proc->termination_code = 0; /* terminated mid-stream but benignly */
else proc->termination_code = tc; /* terminated mid-stream with a fatal error */
} else {
i7_fn_Main(proc);
proc->termination_code = 0; /* terminated because the program completed */
}
return proc->termination_code;
}
Then in main, i can access the prompt like this:
run_process_prepare(&proc);
i7word_t p1 = i7_read_word(&proc, i7_read_variable(&proc, i7_V_command_prompt), 1);
char* p = i7_text_to_C_string(p1);
if (p) fprintf(stderr, "prompt '%s'\n", p);
run_process(&proc);
However, i can’t just change the memory at p, since it’s the static string table. How would i go about assiging a new string value for the prompt variable.
This doesn’t work because the variable is actually the adresss
I don’t know why yet, but read_string (and maybe write_string) doesn’t work until i7_fn_Main has done some work.
You can call an external C function from I7’s when play begins and do the prompt change here.
Jarn Mound is a room.
When play begins:
call C begin;
say "Sir Arthur Evans, hero and archeologist, invites you to explore..."
To call C begin:
(- external__begin(0); -).
Before, I had just run a quick and dirty bash script to try compiling with the Friends of I7 extensions, and had only a crude view of the output. But now I’ve modified my extension smoketester to compile with v10.
Of the 414 extensions in the Friends repo, 298 compile under 6M62. (There are likely some that fail only because they need a table defined or an object of some particular kind. The smoketester adds the appropriate thing for a few extensions, but likely not all.)
In v10, 160 compile. As noted before, a large number of these are because of I6 Inclusions. Some reasons I haven’t mentioned yet:
The Standard Rules’ sections have different names and half of what used to be in the Standard Rules is now in Basic Inform, so things replacing sections of the Standard Rules mostly fail
In 6M62, if you said Include Version 10 of Awesome Extension by Brilliant Author that meant version 10 or higher. In v10’s semantic version numbering world, it means something whose major version number is 10: you’ll get the highest numbered version satisfying that criterion that’s in the extension dir in the project’s materials dir if there is one, then in External, then in Internal. So there are several things that would likely compile with just the version numbers of their inclusions updated.
A bunch of compilation attempts cause segfaults.
In 6M62, an I7 substitution within an I6 inclusion could directly invoke a phrase, i.e., with To decide what number is foo: [...], you could use (+ foo +). Seems you can no longer do this. The error message says “these brackets can only be used with constant values”, but it looks like variable names are ok.
I’ll try to say more about what doesn’t compile under v10 that did compile under 6M62 (and why) tomorrow.
To decide what number is foo (this is fooing): decide on 5.
To decide what number is bar: (- baz() -).
Include (-
[baz;
return ((+ fooing +) --> 1)();
];
-)
Lab is a room.
when play begins: say "[bar]".
which says “5” under 6M62 gets this compilation error in v10.
Problem. Something went wrong late in compilation, when working through the 'pipeline' of code-generation steps. (This should not normally happen unless your source text is making use of '(-' and '-)' and getting that wrong, or unless you are experimenting with non-standard pipelines.)
This catastrophically breaks Gender Options, which has to patch not a function, but a hardcoded data table ( Array LanguagePronouns table in EnglishLanguage.i6t ).
I may be able to work around this but it seems like it requires replacing practically the entire Parser to refer to a differently named table, just to effectively alter the table. Is there an easier way?
At this point, I would suggest adopting the fix I made into the core distribution, specifically, making it possible for inanimate objects to be something other than neuter.
In my opinion, this is suitable for the standard Inform release. This doesn’t change the default behavior significantly, because by default inanimate objects aren’t marked as male or female. (In fact, I think it doesn’t change anything unless parts of the Standard Rules are replaced.) It just makes it possible for extension authors to allow story authors to change things by creating inanimate objects with genders – such as, perhaps, a ship.
I will quote from Gender Options.i7x:
[Aw heck. After all that work below it turns out there's a conceptual error in the bitmask table --
it thinks all inanimate objects are neuter. Drop down to I6 and fix it. There may be a cleaner
method, but this is the least invasive, unbelievably.]
Include (-
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
! Gender Options replacement for Language.i6t: Pronouns
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
Array LanguagePronouns table
! word possible GNAs connected
! to follow: to:
! a i
! s p s p
! mfnmfnmfnmfn
'it' $$001000001000 NULL
'him' $$100000100000 NULL
'her' $$010000010000 NULL
'them' $$000111000111 NULL;
-) instead of "Pronouns" in "Language.i6t".
I should be able to rewrite the parts of Gender Options which replace the Standard Rules to replace parts of the reorganized Standard Rules instead, but trying to do a copy-paste rewrite on the entire I6 parser because I can’t replace one table is just demoralizing, so I hope this will be given consideration.
I think (but haven’t tried playing with this yet) that all the template hacking one might want to do could still be achieved with custom kits: see the inbuild manual. I’m not sure how well multiple modifications to the same kit might be expected to play with each other. v10 has a substantially changed architecture and I still have a lot to try to absorb.
That LanguagePronouns array lives in the English Language kit, and you cannot have duplicates.
So I think the only way right now would be to copy the English kit into the external folder and edit the copy, which will override the built-in one. But that requires several workarounds for the moment, see Updating translations for Inform 10.1.0.
EDIT: I’ve been informed that replacing a symbol other than a routine is supposed to work. I haven’t tried it, though.
Include (-
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
! Gender Options replacement for Language.i6t: Pronouns
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
Array LanguagePronouns table
! word possible GNAs connected
! to follow: to:
! a i
! s p s p
! mfnmfnmfnmfn
'it' $$001000001000 NULL
'him' $$100000100000 NULL
'her' $$010000010000 NULL
'them' $$000111000111 NULL;
-) instead of "LanguagePronouns ".