Author Topic: Printing from Text Resources  (Read 81 times)

0 Members and 1 Guest are viewing this topic.

Offline NilG

Printing from Text Resources
« 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!



Offline MusicallyInspired

Re: Printing from Text Resources
« Reply #1 on: January 15, 2019, 01:16:30 PM »
Just at a glance I notice that you have 1 extra closing parenthesis on the "floor" and "rug" lines.
Brass Lantern Prop Competition

Offline NilG

Re: Printing from Text Resources
« Reply #2 on: January 15, 2019, 01:36:40 PM »
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!

Offline MusicallyInspired

Re: Printing from Text Resources
« Reply #3 on: January 15, 2019, 04:42:10 PM »
Ah yes I see now. You had the last two in parentheses instead of quotes. Didn't notice that. Glad you got it working.
Brass Lantern Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.085 seconds with 23 queries.