Comments (6)
I'm personally disinclined from hacking more syntax into hscript such as {&value1|value2|value3}
. One of the reasons for that is I find the difference between &, !, ~, etc. very confusing in Ink to begin with, and I'd rather replace it with something instantly readable like {shuffle(...)}
{onlyOnce(...)}
that doesn't obfuscate the type of flow being invoked.
from hank.
After looking over the Ink tutorial again, I see that you're right--the sleek syntax for alternative sequences is pretty great. I think I'll refactor fillHExpressions()
into a method fillBracketExpressions()
which calls two separate functions depending on whether the bracket contents start with the symbol for an alternative sequence, or not, in which case it will be parsed as hscript like before. I'm planning to allow the single-character symbols Ink uses, and also versions like 'shuffle' for a shuffle, etc. if the author wants more readability.
from hank.
Closed by 088c22d. Let me know if there are any problems.
from hank.
I see your point, and I think that makes sense. Then we could just expose those functions in HScript without needing to change anything about the current implementation. That's a plus.
Still, there are a couple things I don't like about it:
- You have to put your strings inside quotes for those functions, which means having to do escapes and things like that if you've got quotes inside of the strings. ( not a huge deal )
- I don't think that would very well with nested alternatives. Obviously you can achieve the same effect in other ways, but you would have to write more Haxe which works against the average user that you want to be able to write hank.
Edit: Another issue is if you want to support redirects inside of alternatives. That wouldn't work either. The advantage of alternatives in Ink is that they contain actual Ink content that resolves just like any other line content.
I'm not against making the syntax more clear, but I'm not so sure that making it so that the only way to resolve alternatives is to use HScript is such a good idea. It makes it a little too programer-y and limits what you might be able to do without having to write Haxe.
from hank.
Two specifications from WritingWithInk.md
that I predict will require careful attention:
Alternatives can be nested.
The Ratbear {&{wastes no time and |}swipes|scratches} {&at you|into your {&leg|arm|cheek}}.
Alternatives can include divert statements.
I {waited.|waited some more.|snoozed.|woke up and waited more.|gave up and left. -> leave_post_office}
from hank.
Turn this example into a testing example: https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#examples
from hank.
Related Issues (20)
- Port the Intercept HOT 1
- verbose testing option
- parser tests are flagging builds as broken HOT 1
- disambiguate choice conditions with a ? suffix
- -> END and ->->
- looping through divert target variables in hscript
- example for divert target variable of a labeled choice
- Local variables don't exist in embedded haxe
- test the new tokenize () method in Extensions HOT 1
- static extensions in hscript HOT 1
- raw text blocks
- builder macro to make example test output table HOT 1
- analyze memory usage
- Auto reload during story testing HOT 1
- Use parsihax HOT 1
- Allow wildcard * in testing transcripts
- Haxe 4 has built-in text file compilation macro HOT 1
- include parsed HScript expression in code block Hank expression HOT 1
- At parse-time, validate the story's variable, function, section and knot references
- Would be super cool: make a Fate Accelerated GM helper in Hank
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hank.