Is there some list of Squiffy functions somewhere?

Kilyle
I've wrapped my head around "get" and "set" JQuery stuff, but now I want to increment a Squiffy variable (so that hitting my little side controls increases the variable as well as hitting Squiffy story passages). So I ended up getting it and then setting it. Is there a way to do that in one line using Squiffy functions like inc and dec, but from JavaScript?

...also, which variable is the turn count stored in? And is it possible to set that to zero or something, or would that screw things up? Does it change based on section?

cliffale
I'd like to know this too.

Alex
Take a look at the JavaScript file here: https://github.com/textadventures/squif ... emplate.js

It defines all the Squiffy functions that are available. There aren't very many. There's no JS equivalent of inc and dec but it wouldn't be too hard to add those (happy to accept a pull request for this if somebody else wants to do it!)

lir
You can create your own functions easily, just add a master section and a script at the top. For example to have a JS increment function:


[[]]:
squiffy.inc = function(attr) {
squiffy.set(attr, (squiffy.get(attr) || 0) + 1);
};


As for finding out which function are available, I recommend debugging in Chrome, and then seeing what is available in the squiffy object.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums