It looks like you're new here. If you want to get involved, click one of these buttons!
The baker waits patiently show pies
The baker waits patiently Apple Pie, Blueberry Pie, Lemon Cream Pie, hide pies
The baker waits patiently Apple Pie, Blueberry Pie, Lemon Cream Pie, Snozzberry Pie, hide pies
<<if $task 1 is 1>>\ <<display "job1">>\ <<if $task 1 is 2>>\ <<display "job2">>\ /*...*/ <<if $task 2 is 1>>\ <<display "job1">>\ <<if $task 2 is 2>>\ <<display "job2">>\
int task[5] = [1,2,1,0,0] for (int t =0, t<5, t++) { if (task[t] =1) { //do job1 } if (task[t] =2) { //do job2 } }
Comments
Based on the syntax of your example for point 3 I am going to assume you are using SugarCube 1.x, which has excellent documentation and I suggest you may want to read the section on macros.
note: I have added indents, extra line-breaks and line-break suppressions to the following examples to make them more readable, these can be safely removed.
RE: point 1 & 2
In your examples you don't state if the items shown in the pie list or "hide pies" item are markup links or not, so I am going to consider them plain text.
The following example uses an id'ed span element and the <<replace>> macro to display the list of pies both before and after an extra pie is added to the list.
RE: 3
The following example is a direct translation of your example using SugarCube's
<<for>> macro and <<if>> macro
I may need to ask some more questions after I read it, but that link to sugarcube documentation does look quite useful indeed. Sorry if I look like a complete noob, I'm only a rookie when it comes to twine, honest! =p
Remember to state your Story Format (name and version) when you create new Question threads for your other questions.
would work at all. Unless there's a way I can push all that into a string and get it to unpack at runtime?
A working copy of your example
There are a number of possible solutions to your question, one of them is to use a <<widget>> macro to create your own custom macro.
Place the following into a new passage with a widget tag and a nobr tag, it creates a buyable macro:
You can now use the buyable macro like so: