Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Inform 6] Verbs

75 views
Skip to first unread message

Rickard Hultgren

unread,
Mar 30, 2013, 9:01:36 AM3/30/13
to
Hi,

Is it possible to write what word combinations should give a certain answer in the objects's "before"? In the case below I want to get the answer "bla bla bla." after writing "a big car" or "dog elephant fish", but I get "Error: Expected assignment or statement but found <constant>" from the compiler on "'a big car' 'dog elephant fish':".


Thanks advance for reply!


NPC one "one" one_room1
with psa_variable = false ;
before [;
'a big car' 'dog elephant fish':
print "bla bla bla.^" ;
self.psa_variable = true ;

Rickard Hultgren

unread,
Apr 2, 2013, 6:31:20 PM4/2/13
to
Sorry for not clarifying my question in the previous post, but I search for a way to write the code below without adding the xxxSub-thing.

NPC one "one" one_room1
with psa_variable = false ;
before [;
'a big car', 'dog elephant fish':

David Griffith

unread,
Apr 2, 2013, 9:35:11 PM4/2/13
to
I can barely figure out what this code is supposed to do.

--
David Griffith
davidmy...@acm.org <--- Put my last name where it belongs

Rickard Hultgren

unread,
Apr 3, 2013, 3:39:49 PM4/3/13
to
Is there any way to right the code below without adding 'palpation of prostata'Sub, 'prostata palpation'Sub, PSASub and 'prostate specific antigen'Sub?

NPC patientone "one" one_room1
with prostata_palp_variable = false ;
psa_variable = false ;
before [;
'palpation of prostata', 'prostata palpation':
print "irregular, hard.^" ;
self.prostata_palp_variable = true ;
'PSA', 'prostate specific antigen':
print "75 ng/ml.^" ;
self.psa_variable = true ;

rpresser

unread,
Apr 3, 2013, 6:14:07 PM4/3/13
to
On Wednesday, April 3, 2013 3:39:49 PM UTC-4, Rickard Hultgren wrote:
> Is there any way to right the code below without adding 'palpation of prostata'Sub, 'prostata palpation'Sub, PSASub and 'prostate specific antigen'Sub?

I don't know the answer, unfortunately, but let me say I can't WAIT to play your game. Er .... maybe that's overstating the case. :)

Andrew Plotkin

unread,
Apr 3, 2013, 10:02:07 PM4/3/13
to
As I said in my previous post, you are handling the punctuation wrong
here. You've actually got it wrong enough that the compiler is giving
you misleading error messages. (There's no such thing as 'string'Sub
in Inform.)

Properties in an object are separated by commas, not semicolons.

Clauses in a before routine are meant to refer to actions, not topic
strings.

If you're trying to get an NPC to respond to spoken commands (like
"patientone, PSA") then you need to use an orders property, and look
at the NotUnderstood action. This is described in chapter 18 of the
Inform Designer's Manual. The exercises in that chapter may be helpful.

If you're trying to do something else, you'll have to explain further.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Rickard Hultgren

unread,
Apr 7, 2013, 7:50:14 AM4/7/13
to
Yes, I try to get the NPC-object to respond to commands. I suppose I should do something like this:

NPC patientone "one" one_room1
with prostata_palp_variable = false ;
psa_variable = false ;
orders [;
NotUndersttod:
string=parse_routine(WordLength,WordAddress);
if (string =='palpation of prostata' || 'prostata palpation'):
print "irregular, hard.^" ;
self.prostata_palp_variable = true ;

...and a parse routine

Am I on the right track?
0 new messages