Calling a rule from I6 code, with params

OK! I think everyone reading appreciates this insight about the role of LanguageIsVerb() in the Spanish I6 library, so thank you for detailing it here.

The good news is that I’m pretty sure that the example that I put together does what you want:

  1. The expected verb word position is converted to a snippet.
  2. The snippet is passed as a parameter to the SearchingFor rules, where it is converted to a text variable via automatic casting from snippet to text.
  3. The SearchingFor rules retrieve the auxiliary response entry, which should be a verb in the infinitive that is found in the game dictionary.
  4. The SearchingFor rules use the DictionaryWordFromText() routine (via an I7 phrase) to identify the dictionary word address corresponding to the auxiliary response entry.
  5. The SearchingFor rules pass back (i.e. “produce”) the dictionary word address (which stores it in a built-in array).
  6. The dictionary word address is retrieved and used as the return value for LanguageIsVerb().
1 Like

Would it help if this were possible? With the caveat that if you try to do this for a word that already has a #dict_par2 value, it would be a compile error.

1 Like

In your original post about the Dictionary directive, you said that #dict_par2 can’t be “sensibly” set in source code, and I agree. The normal value found in that dictionary parameter is the inverted numeric ID value of a nameless “true verb” – an identity assigned by the compiler based on its processing of the I6 Verb directives. That identity isn’t available to the author, so I don’t see any way to determine it in advance and make use of it in source code. (If I’m being short-sighted, by all means let me know.)

If you’re looking at that source code, though, I think it would be nice to be able to use a backpatched value within a Dictionary directive parameter. For example, to be able to say:

Constant DICT_VERB = 1;
Constant DICT_BIT5 = 32;

Dictionary 'leap' (DICT_BIT5+DICT_VERB) 'jump'; ! second parameter currently rejected

or

Dictionary 'xyzzy' 0 selfobj; ! second parameter currently rejected

That might make it easier to use #dict_par3 productively.

I concur with this logic. Sigh.

I guess the next step that way is to put in a feature request for Inter to support Verb statements. With a note saying that this would be helpful for translating the I7 system to other languages. (If, in fact, it is helpful! I’m only really following the I6 part of this discussion.)

This can’t work because the three #dict_par values are 8-bit fields (Z-code) or 16-bit (Glulx). A dict word value, or a backpatched value in general, is 16-bit (Z) / 32-bit (G).

Aw, dangit. Kind of an important detail!

I guess the “abomination” code method of storing an index to a word array isn’t such a bad solution to that type of problem, then.

@sarganar: Did the example code that I posted above actually solve your problem? If not, please let us know what’s still not working so that we can help.

Hi! I had not time to try. And last wednesday my laptop died. I hope this weekend, I can implement it. Stay tuned!

Hello there! Finally I could try the @otistdog code and it fitted so well to solve my problem.
Thanx!!

1 Like