The source text to my game currently is over 43000 words long. Is this too long, and how long is recommended? I know that memory limitations must be taken into account at some point. Thanks.
Don’t worry about length limitations, or memory limitations if you’re compiling to Glulx rather than zcode (which is the default if you’re using the latest versions).
There is a project that hit some bugs in the compiler because the source text was longer than it could handle, but the source was literally millions of words long. There are other sorts of memory limits that can occasionally be hit in bigger projects, but you can change them as you go along (the compiler would give you a not super helpful message about how to do that–don’t worry, you can come back to the forum to ask what you need to do). But it’s not that likely you’ll encounter that.
So the recommended length for the source text is however long it needs to be.
Thanks Matt. I am using Glulx, and I am about 3 or 4 major puzzles(each with some minor puzzles) away from ‘finishing’. I do recall reading about a 60000 word limit, but that you could expand it. Thanks
If your game is large you may hit certain types of compiler limits (like number of dictionary entries, number of objects, number of static strings, etc.). But you can raise these pretty much arbitrarily, so they’re not really a cause for concern.
There is no limit on how long your source code can be, or if there is it’s so high as to be meaningless. My current WIP is closing in fast on 150,000 words. My last published game was somewhere around 160,000, I think.
Wow, thanks, Mike. Another question–how do you turn off the score notifications–I have looked all over the manual, and I can’t seem to find the rules connected to that. It does say that I can change the message/response–which is really what I want to do, because I want to write the notification into the story, but I can’t find the specific rule/standard response. Thanks a lot.
Use no scoring.
Does that allow me to write the notifications myself, while printing the score in the status line?
No, that just stops it printing notifications. I’m not 100% sure about how you’d do the notifications yourself.
To change the status line, I think you could do something like:
When play begins:
now the right hand status line is "[put your new score variable here]"
The “Use no scoring” directive will turn off scoring entirely. If you just want to write the notifications yourself, there are a few different ways to approach it.
The score award notification is what is known as a ‘response’, and its particular name is “announce the score rule response (D)”. If you just want to change the default response, you can do this:
The announce the score rule response (D) is "That's [number understood in words] fresh point[s] in your pocket, for a total of [score]."
BTW, “[number understood]”, in this context, is the number of points that were just awarded.
If you want to do something more complicated, you can also write a rule for it:
Rule for issuing the response text of the announce the score rule response (D) when the score is greater than 90:
let points left be 100 minus score;
say "Your score is now [score]; only [points left in words] point[s] left to go!"
Read up sections 14.10-14.12 and 18.15 in the documentation for more info about responses.
Hey Mike, Thanks. Where can I find that rule? I looked all over the Index, I thought. I did find the testing command RULES, and went into the game and noticed a ‘notify score changes rule’ after I did something that increased the score. Does that have anything to do with it?? I’ll try your suggestions.
The notify score changes rule that you mention is listed in the turn sequence rulebook and applies when the score changes during the course of play.
The announce the score rule that Mike mentions is part of the carry out requesting the score rulebook and applies when the player explicitly types “score”.
Interestingly, the template routine called by the notify score changes rule (NotifyTheScore) makes use of the lettered responses attached to the announce the score rule, so modifying those responses as Mike suggests should handle both cases.
You can find both of these rules by searching in the Standard Rules (File -> Open Installed Extension -> Graham Nelson -> Standard Rules).
In the Index, the notify the score rule is under Rules Index -> (St) Standards -> The top level -> turn sequence rules … rulebook.
The announce the score rule would conceptually be in the Index under Rules Index -> (St) Standards -> Rules governing actions -> carry out … rulebook, but, as the Index says if you click on the carry out rulebook, “Carry out rules are tied to specific actions, and there are too many to index here.”
When you need to change a response text and can’t find the rule for it, one handy way to do this is to start up your game and type RESPONSES ALL at the command prompt. This will list every single rule response from the Standard Rules and every extension that you’re using in your project. You can then search through the output for the text that you’re trying to modify and find out what rule it comes from. (In this case, you’d have been lucky–the announce the score rule responses are listed near the bottom, so they’re easy to find.)
Responses aren’t listed explicitly in the documentation or the index, possibly because there’s a hell of a lot of them, and because not all of them make much sense out of context. One way to find the one you’re looking for is to use the RESPONSES ALL command, as matt w just mentioned.
Another handy trick is to add this line of code:
Before issuing the response text of a response (called R): say " [bold type][R]:[roman type] ".
This causes the game to print the name of a response immediately before printing the response itself. You can comment the line out when you don’t need it.
Thank you all—I ended up using Mike’s suggestion–I went to the beginning of my code and typed –
Gooddeed is text that varies.
The announce score rule response (D) is "You just earned [number understood] points!...for [gooddeed]!"
Of course, gooddeed describes, metaphorically, what the player just did to earn the points.
I changed my ‘increase score’ routines accordingly, re-value-ing ‘gooddeed’ before the ‘increase score’ instruction in each.
Now it works like a charm!