Community
SCI Programming => SCI Syntax Help => Topic started by: NilG on January 15, 2019, 12:24:05 PM
-
Hi All, I have another newbie question. The forums here, the tutorials, and the SCI Documentation links have all been great, and I've been learning a lot, but it seems like I keep turning around and getting caught up on the simplest of things :-\
If I want to Print from a text resource, I believe that I just need to Print (a b) where a is the text resource number and b is the entry. However, when I try this in my script like so:
(if (Said 'look>')
(if (Said '/bed') (Print "5 2"))
(if (Said '/dresser') (Print "5 4"))
(if (Said '/floor') (Print (5 7)))
(if (Said '/rug') (Print (5 9)))
"bed" and "dresser" correctly display the numbers (I was just making sure the rest of the syntax was alright), but if I try to compile while floor and rug aren't commented out, I receive an "Expected an expression" error. As the attached shows, I do have a text resource for 005, and it's got 15 entries so far to cover any of the attempted calls. I tried putting 005 in lieu of 5, though I don't think it should matter, but no luck.
Do I need to call or reference text resources somewhere before I can use them in the script? Or am I just doing something all sorts of wrong? Thanks!
-
Just at a glance I notice that you have 1 extra closing parenthesis on the "floor" and "rug" lines.
-
Aah, an extra parentheses set altogether around the resource #s, it looks like; works if I change them to
(if (Said '/floor') (Print 5 7))
no parentheses around the 5 7
I thought I tried that, but I'm guessing I forgot to save the script before trying to compile like a complete rookie. :-[
Thanks again!
-
Ah yes I see now. You had the last two in parentheses instead of quotes. Didn't notice that. Glad you got it working.