uhh @garden-ghoul (& @cinquespotted maybe? am i right that you do/did twine things??) &also at other mutuals im forgetting and/or the General Public– is there a good place to look at a lot of example syntax for twine?
i am extremely a novice and trying to teach it to myself off of the harlowe manual, but there’s a lot of basic-but-cool stuff (lots of them things i saw in some of the twines in the list-of-good-twines in ghoul’s game about games, which i am not far into but enjoyed btw!) which i understand in theory the syntax for, but am actually struggling with– like literally just how to connect variable value changes with clicks and/or ifs, which is the Most Basic, but none of the sample code in the manual actually shows how to stick macros together like that really, and all my educated guesses have not panned out
i’m trying to write a poem in it for a class, mostly, so it doesn’t have to do a lot of actual game stuff and can be heavily weighted toward stupid flashy text tricks (just like, replacers etc), and it will not be tragic if this is not a readily available resource, but if there’s a good body of existing work i could just sift through when i wanted to see how to actually put the macros into practice, that would be wildly helpful, so i didn’t get bogged down in the really basic shit so much.
as may be very transparent i know literally nothing about this, or the ~community, or whatever, so um– h elp?
Hmm, well, I managed to get where I got by reading the twine wiki, but it’s true that it does kind of suck a lot! Unfortunately I don’t have any resources with lots of good sample code so I’m gonna try and be a sample code resource. The bread and butter of my game was clickreplace, which I used like so:
At the end of the paragraph, some text I want to replace.
(clickreplace: “some text I want to replace.”)[What I want to replace it with.]Macros in general will be formatted like (macroname: function parameters)[what the function is going to do]. Another example you’ll probably want is set and if statements:
(set: $something=2)
(if: $something is 2)[Success]Prints “Success”. APPARENTLY you cannot use “if: $something=2″ because twine is stupid. you have to use its dumb natural language.
A tip is that if you want to check variables somewhere in a page, you must set them to some default value before this, otherwise your program will throw errors, and Twine’s debugging is totally useless.
If you want an event to change the value of the variable… the way I normally did that was I would put it inside the brackets of the function that had just activated, so that when the function activated I could set the variable to a new value.
Another fancy thing I like but haven’t used much is link-repeat, which is used a lot in 208 feet up the ruin wall. An example:
(set: $person to (a: “mother”, “son”, “brother”, “best friend”))
Your (link-repeat: “[(print: $person’s 1st)]<family|”)[(replace: ?family)[(set: $person to (rotated: -1, …$person))(print: $person’s 1st)]] has been kidnapped.This is very complicated. First you declare the variable $person, which is an array (you know because it says “a:”) of 4 strings. Then there’s text outside the link-repeat (”Your has been kidnapped”). Then there’s the link-repeat. FOR SOME AWFUL REASON you have to put the print command INSIDE A STRING… family is a sort of temporary variable that I don’t understand? Basically copy someone else’s code and fuck with it until it works… I’m so sorry
thank you!!!