Super Newbie Question

So, I'm exploring the program(love it) and trying to build my first game. My question is where can I edit the default verbs and, like, someone asked a while ago, customize the Game Over function?

For example, when I use ask/say in the game, it returns 'blank saies nothing.' I'd like to edit that to 'says' instead of saies.


If you're using the desktop application, I find this an effective method which helps you to learn how the game treats commands and verbs whilst creating your own:

Down the left hand side where the game tree is, right at the bottom, there's a filter option. If you click on it, you can set the application to show the built in libraries. This will show you all the 'default' verbs and commands at the top of the tree, not just your created ones.

If you find the one you're looking for there and click on it, on the right pane you'll get the option to copy it, so you can create your own version of it, then you can edit it as you like.

For example, I like the LOOK command to clear the screen before it reprints the description of the room in my games. So I find LOOK on the command tree, copy it, and then edit the script by adding a simple clear screen function before the rest of the command plays out.

Doing it this way allows you to gradually build your own library of commands and verbs via a method that helps you learn as you go. It's cool to see how, for example, inventory works by studying the built in commands.


Surely this saies is a mistake that could be simply altered. I personally have no windows and work on Apple , which restricts me to online only. Can it be altered online? It’s been there a long time and it riles me how it got there in the first place every time I see it.


You would think so - but I'm not a developer. It is a very odd thing though 😊


Unfortunately, the "saies" is generated by a bug in the function Conjugate in the English language library. And the web editor doesn't allow you to modify functions. It's about the only thing that can't be done in the web editor, rather than just being harder.

To fix the verb without modifying it like this, you'd need to look into how verbs process the default message. Basically, the engine looks at the attributes defaulttext, defaulttemplate, and defaultexpression in that order until it finds one. I think (but not sure) that the "saies" message will be found in defaulttemplate, which might be a problem because the web editor also has issues editing templates.

I think (off the top of my head) the best way to do it might be (in the start script, or any script that runs before the verb is used):

speakto.defaulttemplate = null
speakto.defaultexpression = "CapFirst(object.article) + \" says nothing.\""

Thanks for the info, guys. I'm using the desktop version and I was looking in the conjugate rules; I saw this expression: EndsWith(verb, "y") and not EndsWith(verb, "ey")
and
Mid(verb, 1, Lengthof(verb) - 1) + "ies"

Else it just adds an S to the verb.

The way I am reading that expression, if the word ends in Y but not EY, the program will drop the Y and add IES. Otherwise, it just adds and S. If I am correct in understanding, could you add another and not EndsWith(verb, "ay") to fix that it so that SAY will return SAYS?


Yes, you could. Though that's still wrong for any verbs ending in '-oy'.
I don't think there's anywhere in the default templates that such a verb is used, but I think we should have a version which works with all verbs, so you can just use WriteVerb in your game wherever it's convenient rather than having to double check every time you add a new verb.

The version of this function I recommended looks like this:

    <function name="Conjugate" type="string" parameters="obj, verb">
      genders = LCase(obj.gender)
      if (genders = "he" or genders = "she") {
          genders = genders + ";it"
      }
      cmd = GetObject (verb)
      foreach (gender, Split(genders)) {
          if (not cmd = null and HasString (cmd, "conjugate_"+gender)) {
              return (GetString (cmd, "conjugate_"+gender))
          }
          dict = GetAttribute (game, "conjugations_"+gender)
          if (not dict = null) {
              if (DictionaryContains (dict, verb)) {
                  return (DictionaryItem (dict, verb))
              }
              foreach (ending, game.conjugations) {
                  if (Left (ending, 1) = "@" and EndsWith (verb, Mid (ending, 2))) {
                    return (Conjugate (obj, Left (verb, LengthOf(verb) - LengthOf(ending) + 1)) + DictionaryItem (dict, ending))
                  }
                  else if (Left (ending, 1) = "*" and EndsWith (verb, Mid (ending, 2))) {
                      return (Left (verb, LengthOf(verb) - LengthOf(ending) + 1) + DictionaryItem (dict, ending))
                  }
              }
          }
      }
      return (verb)
  </function>

If that were included in the core version, it would be nice because adding some word that's a special case no longer needs editing the code, so would be possible for people on the web version.

It assumes the game element will have a couple of stringdictionary attributes containing the actual grammar rules, like this:

    <attr name="conjugations_i" type="stringdictionary">
      <item><key>be</key><value>am</value></item>
      <item><key>'be</key><value>'m</value></item>
    </attr>

    <attr name="conjugations_you" type="stringdictionary">
      <item><key>be</key><value>are</value></item>
      <item><key>'be</key><value>'re</value></item>
    </attr>

    <attr name="conjugations_we" type="stringdictionary">
      <item><key>be</key><value>are</value></item>
      <item><key>'be</key><value>'re</value></item>
    </attr>

    <attr name="conjugations_they" type="stringdictionary">
      <item><key>be</key><value>are</value></item>
      <item><key>'be</key><value>'re</value></item>
    </attr>

    <attr name="conjugations_it" type="stringdictionary">
      <item><key>be</key><value>is</value></item>
      <item><key>have</key><value>has</value></item>
      <item><key>can</key><value>can</value></item>
      <item><key>mould</key><value>moulds</value></item>
      <item><key>*ould</key><value>ould</value></item>
      <item><key>must</key><value>must</value></item>
      <item><key>can't</key><value>can't</value></item>
      <item><key>won't</key><value>won't</value></item>
      <item><key>cannot</key><value>cannot</value></item>
      <item><key>@n't</key><value>n't</value></item>
      <item><key>'ve</key><value>'s</value></item>
      <item><key>'be</key><value>'s</value></item>
      <item><key>*ay</key><value>ays</value></item>
      <item><key>*oy</key><value>oys</value></item>
      <item><key>*ey</key><value>eys</value></item>
      <item><key>*y</key><value>ies</value></item>
      <item><key>*ss</key><value>sses</value></item>
      <item><key>*s</key><value>sses</value></item>
      <item><key>*sh</key><value>shes</value></item>
      <item><key>*ch</key><value>ches</value></item>
      <item><key>*o</key><value>oes</value></item>
      <item><key>*x</key><value>xes</value></item>
      <item><key>*z</key><value>zes</value></item>
      <item><key>*</key><value>s</value></item>
    </attr>

Yeah, I thought about that last night while I was trying to sleep. Would the clumsy band-aid approach then be to just append each vowel+Y rule to the end of that expression?

So, then, do I put the WRITEVERB function with the code you just posted? Sorry, still new at this and drawing on ancient C++and Java memory from high school.


The default templates use WriteVerb, and WriteVerb uses Conjugate. So if you fix Conjugate, everything else should work.

You can use WriteVerb in your own messages easily enough. WriteVerb(object, "stroke") or similar

I went and looked up stuff in a grammar textbook for mine, to make sure it handles more verbs correctly, like wash (add 'es'), press (add 'es'), and gas (add 'ses').
I included the two special cases from the original ("be" → am/is/are and "have" → have/has/have), and added abbreviated forms ("'be" → 'm/'s/'re, "'ve" → 've/'s/'ve) - though I think making those work with WriteVerb might need an extra line to remove the extra space.


According to 3 dictionaries I check, the plural of GAS is GASES (no double S) The S is only doubled for the past tense GASSED and the present participle GASSING. But then I am only using English and Australian dictionaries. Perhaps gasses is the American spelling?


In American spelling, "gasses" would be the present tense verb, and "gases" would be the plural noun.


In American spelling, "gasses" would be the present tense verb, and "gases" would be the plural noun.

OK, I've checked 3 English (British) dictionaries. One says both 'gases' and 'gasses' are in use for the plural. The others say that one of those spellings is a US variant, but disagree about which one.

So… there's some disagreement there.
But most dictionaries don't list the third person simple present for a verb; and I find different grammarians agree about which rules to follow.

That's the advantage of my function, I guess. Once you've got it set up, you can adapt it for your dialect or region by changing the elements in a dictionary, without needing to change the code again.

Though one thing I did come across was that verbs ending -o take an 'es', unless they end -oo. In which case maybe it should be:

      <item><key>*oo</key><value>oos</value></item>
      <item><key>*o</key><value>oes</value></item>

Unless that's a regional variation as well. (the only verb ending oo I can think of is "shoo", but I'm sure there are others)


Log in to post a reply.

Support

Forums