Community
SCI Programming => SCI Syntax Help => Topic started by: robbo007 on May 22, 2026, 05:43:20 AM
-
Hi guys,
I was reading through the SCI0 changes/updates file and saw this. Does this work in SC? What syntax is correct as TurnIfSaid and GoToIfSaid are not accepted?
9/22/89 Pablo: GOTOSAID: The end of "not close enough".
TurnIfSaid is a new version of Mark Hood's procedure for making ego
face whatever was mentioned. For example if the user types "look chair"
ego will turn in place to face the chair before getting a response.
GoToIfSaid is similar but, as the name implies, it moves ego to a
specified point or object vicinity before reprocessing the Said event.
These procedures are only useful if sortedFeatures are in use. Grooper
and avoider are used to turn and move.
* This takes up ZERO bytes if you don't use it.
-
Considering they're both script functions, not engine or language features, the only reason they wouldn't be accepted is if you simply don't have that script file (https://github.com/sluicebox/sci-scripts/blob/main/iceman-dos-1.033/src/n954.sc), or forgot to use it.
As for how it's used, looking at Sluicebox's decomp here's an example from [?]Codename ICEMAN[/i]'s beachHuts3.sc: ((Said '[/door]>')
(cond
((TurnIfSaid self event 'look/*'))
((Said 'look[<at]') (Print 12 3) ; "This is the door to hut #2.")
Note that this is hutDoor::handleEvent, so self is the hut door.
So it makes sure to turn toward the door if you need to turn toward it first, which stops the cond block. If you're already looking at the door, this condition fails and (Said 'look[<at]') gets a turn.
This script is also known as GotoSaid.sc in the leaked Larry 3 and 5 code, though it's unused there. The proper definitions of both IfSaid functions are: (GoToIfSaid obj event theTargetOrX theDistanceOrY optSpec)
(TurnIfSaid obj event optSpec)
-
ok thanks. I'll have a play around with this.
Regards.