Hello, I’m trying implement an old-school command ANALYZE something, which lets a player undertake further analysis (eg. fingerprints, chemical analysis) with a time delay. This is similar to what Infocom does in Deadline by having Sgt Duffy go off to the lab to analyze something at the player’s request. But I have encountered some Inform7 syntax challenges when trying to pass parameters and have a delay. I have a static table of objects with the corresponding results of Sgt Duffy findings. Conceptually what I’m trying to do is:
[code][pseudo code]
analyze(prop)
if prop is in the table of analysis
say “Duffy enthusiastically takes the item to analyze.”
call analysis completed (prop) in four turns;
else
say “Duffy skeptically takes the item to analyze.”
call analysis completed (prop) in four turns.
analysis completed (prop)
if prop is in the table
say “Duffy reports on the [prop] and says [result corresponding to prop in table]”.
[/code]
However, it hasn’t worked out as I hoped! Any ideas here are welcome. I’ve put a minimal code example below but it gets lots of compiler errors. I’m sure this is something boneheaded, but I’m not seeing and need to get on a plane in a couple of hours.
"Parameter passing" by Zack
Section - Analyze Command
[ Provides the player the ability to ANALYZE different items and find more clues, such as fingerprints, chemical analysis etc. ]
The player is in the Hotel Room.
Hotel Room is a room. "You're at the San Moreno Inn, room 108. You've got a desk, a dresser, a nightstand. You've stayed in plenty of worse dives. The bathroom is to the east."
Gun has description "It's a gun."
Brown wallet has description "It's a brown wallet."
Matchbook has description "It's a matchbook."
Gun, brown wallet, matchbook are in the hotel room.
Analyzing is an action applying to one thing. Understand "analyze [something]" as analyzing.
carry out analyzing something (called the prop):
say "Sgt Duffy steps silently by your side. [run paragraph on]";
if there is a item of prop in the Table of Analysis:
let result be the results corresponding to an item of prop in Table of Analysis;
let clue be the clues corresponding to an item of prop in Table of Analysis;
say "Duffy nods energetically. 'I'll have the boys in the lab analyze [prop] and see what they can find.' Sgt Duffy walks out of your view.";
[ the following line gives an error on four turns from now ]
Have analysis of prop done [in four turns from now];
else:
say "Duffy looks at you skeptically. 'You want me to analyze [prop]? Ok, I'm on it.' Sgt Duffy shuffles out of your sight dejectedly."
[ how do you pass parameters and have the actions be delayed?]
To Have Analysis of (a prop - a thing) done:
if there is a item of prop in the Table of Analysis: [ gives an error]
[the following line gives an error]
let result be the results corresponding to an item of prop in Table of Analysis;
say "'We've analayzed [prop]. [result]'[line break]".
[ This table provides results from Duffy's analysis of objects.
The note field is used for "try noting ..." to trigger a possibly new clue.
These clues have not been added yet and the note words not verified]
Table of Analysis
item clues results
gun "gun" "It's your lucky day. They found your fingerprints all over it."
brown wallet "brown wallet" "What a surprise --it's got your fingerprints all over it."
matchbook "matchbook" "It's got Tony's fingerprints on it as well as Monica Robner's."