Author Topic: SCI0: GoToIfSaid ?  (Read 13 times)

0 Members and 1 Guest are viewing this topic.

Offline robbo007

SCI0: GoToIfSaid ?
« on: Today at 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?

Code: [Select]
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.



Offline Kawa

Re: SCI0: GoToIfSaid ?
« Reply #1 on: Today at 06:16:04 AM »
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, 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:
Code: [Select]
((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:
Code: [Select]
(GoToIfSaid obj event theTargetOrX theDistanceOrY optSpec)
(TurnIfSaid obj event optSpec)

Offline robbo007

Re: SCI0: GoToIfSaid ?
« Reply #2 on: Today at 09:49:45 AM »
ok thanks. I'll have a play around with this.
Regards.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.035 seconds with 21 queries.