Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sugarcube and scripts

So I seem to be having problems with scripts and sugarcube. I am a noob with twine so be gentle, but I am a technologist, so feel free to hit me upside the head when doing it.. I thought maybe it was the one script I am using, but I am now seeing it trying others, so I am obviously missing something easy.

I have done some forum and google searching to no avail...

I am using sugarcube r3402 and twine 1.4.1

If use a script (in my case playsound) and yes I changed the "StoreArea" to "store-area" already. I have defined my sound in the Storyinit already <<set $noise = "hit13.mp3">>

and call it in another passage using <<playsound $noise>> I get an error when running that says "Error: cannot execute macro <<playsound>>: undefined is not a function"

So then I tried another script and I get the same error.

So do I need to define these scripts as macros elsewhere that I am missing? I have the code stored in a passage tagged as a script...

Any guidance or materials to read is appreciated.

tks
biff

Comments

  • That should work.  Let me check and see what's going on.

    Found the problem.  It seems that I got a little this happy in r3250 and changed some references I shouldn't have.  The issue has been fixed in the repo and will be in the next release.

    That said, there's no reason to wait for the next release, since the part of the script that's failing is unnecessary in SugarCube anyway.  As a completely safe workaround, you can do this:

    FIND: (line 34 from the downloaded file)

    var s = eval(d.fullArgs());
    REPLACE WITH:

    var s = c[0];
  • Awesome thanks....I maintain a linux distro and give free support all the time, so I appreciate and understand the work involved in responding to requests such as this...its appreciated.

    biff
  • Just an FYI...I went ahead and built from the repo as I was having issues with other scripts also, so rather than continually asking to have you look at others scripts I figured this was more sensible.

    After that they are all working like a charm...nice

    biff
Sign In or Register to comment.