Speech helper function
maybe a possible helper function
so the yaml system does one thing good in that it's pretty unboilerplatey
brainstormin
so how about a helper function. maybe it's on its own thing or it's on the speech goodies. yahoo
- typescript
yield * s.batch( DabricCharacter, "hello, world", { face: "smile" }, "i'm smiling, as set by line state", "so i'm not smiling anymore", OtherCharacter, "and just like that i'm another character", );
however javascript is pretty boilerplatey as well. yaml is like a lot more sexy tbh. like
- yaml
- c: DabricCharacter - hello, world - face: smile - hah - hahahaha - c: OtherCharacter - HAHAHAHAH
so i'm not sure. maybe there's some nice way i can get it in js?
ah. template strings. they have that weird function thing right?
- ts
yield * s.batch` ${DabricCharacter} hello, world face: smile hah hahahah ${OtherCharacter} HAHAHAHAH `;
it's kinda unneat? no syntax highlighting on the
face: smile
oh! got it. so a tagged template function (i think it's called) can also see the raw form of the string, like with the escapes unprocessed. on top of that there's no syntax errors! isn't that insane?
- ts
yield * s.batch` ${DabricCharacter} hello, world \face: smile hah hahahah ${OtherCharacter} HAHAHAHAH `;
yeah but that only highlights the
f
. lmaomaybe
- ts
yield * s.batch` ${DabricCharacter} hello, world ${{ face: "smile" }} hah hahahah ${OtherCharacter} HAHAHAHAH `;
but boilerplate
okay, maybe the boilerplate in the above example isn't that bad. it's three key strokes. even then there's nothing stopping me from adding a typescript snippet.
also the template method is better because while it gives a tad bit more boilerplate for setting characters and such, it removes pretty much all boilerplate for saying something. Saying something is king here. so it stays