seansimonanimation / Screentastic

A Twine 2 Story Format for creating Interactive Screenplays.
MIT License
14 stars 0 forks source link

Variables in Screentastic #5

Open bennybuddy opened 4 years ago

bennybuddy commented 4 years ago

Hi seansimonanimaion,

I'm trying out your Screentastic code in Twine, and I can't figure out how to get variables to work. As far as I can tell they don't work the way they usually do in any of the default Twine languages. Should variables be working here?

Thanks.

seansimonanimation commented 4 years ago

Hi! Thanks for trying out Screentastic. Screentastic is designed solely to format content into screenplay format, similar to apps such as Final Draft and Celtx. It is entirely focused on handling things like page margins and creating appropriate spacing, and as such don't handle traditional twine-style variables.

The only built-in keywords are for formatting how your text is displayed. Here they are: "sketch>>" Activates sketch mode "sch>>" Scene header "tra>>" Scene transition "cha>>" Character dialogue, name section "dia>>" Character dialogue, dialogue section "act>>" action block "par>>" Parenthetical "link>>" Link to another section

There have been no plans to include variables as I didn't see a need for them when designing Screentastic. Could you give a little more info about your use case?

bennybuddy commented 4 years ago

Thank you for clarifying the current functionality. I really appreciate the automatic formatting you've added to Twine, I'm well versed in Final Draft and Celtx so it was very exciting for me to discover someone had created an easy way to format Twine scripts to have the extremely specific universal screenplay appearance.

The systems design of the project I'm currently building in Twine has some moments where a number of past decisions aggregate to automatically change the course of the script in the present, so in order to put those conditional parts of the script in, I'd need to have variables active to be able to set the condition properly. So for now, I've sort of used a combination of CSS and setting/printing spaces in order to roughly recreate the formatting built into Screentastic. That said, the Screentastic keywords and other features are great, and it would be very cool to be able to use Screentastic with the variable functionality! Others also might find value out of variable tracking.

One other feature that I've hard coded into my version is a "progress bar" baked into a footer node to give the reader a sense of how far they are into the full script. Not sure if that's something you'd want to consider for Screentastic as well.

Thank you again for responding, hope all is well!

seansimonanimation commented 4 years ago

Actually, that progress bar sounds like a great idea! If you could fork it, I can test and merge.

As for variables, that is something I can look into.

Thinking aloud, we'd need to create a way of declaring and calling variable types that is syntactically consistent with Screentastic's markup .Perhaps var>>[type: int, str, float, bool, arr]>>[name]>>[data]. We'd also need to create a function call to parse the passage and change data as it is loaded... And then there's the ifs and whiles which are required to make variables usable. It's definitely possible, though there's a lot that would need to be done so it probably wouldn't be shippable any time soon.

The other issue is printing and output... I included printing capabilities so that screenplays generated by Screentastic can be used for pitching concepts, as well as for physical archival purposes (The screenplay library at the SWGA comes to mind...) The PDF output provided by PDFMake and dynamic text possibilities provided by variables don't play well. The only real way I can see to keep error handling relatively graceful is to disable PDF functionality for writers who include variables... or at least give a warning.

bennybuddy commented 4 years ago

So unfortunately I'm using variables to create the progress bar (it's also kind of janky right now, I'm basically modifying code for a health bar to increase by one every click using the footer tag functionality, you basically set a value for $maxHealth equal to the number of clicks/nodes in the script, embarrassing screenshots attached)

Totally heard about the need to write code for the variables that works with the Screentastic markup. And yeah I can definitely see how printing to a PDF would be incompatible (or at least difficult) with conditional text.

Anyway, thanks for considering! For now I might keep using my cobbled together code for my project, but I'll certainly keep following Screentastic in case variables become a feature at some point down the line.

CSS code Footer node Final progress bar