# Story telling extension \[early preview\]

**URL:** <https://forum.makecode.com/t/story-telling-extension-early-preview/1733>\
**Category:** Arcade\
**Created:** [April 18, 2020, 2:26am UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733 "2020-04-18T02:26:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)\
**Post date:** [April 18, 2020, 2:26am UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733/1 "2020-04-18T02:26:57Z")

</div>

## EDIT: @richard took this idea and went further building an awesome new extension: [https://github.com/riknoll/arcade-story](https://github.com/riknoll/arcade-story) Expect a post about this sometime eventually (nudge nudge @richard :P) I recommend using that one over this one.

I’m experimenting with an extension based on @richard’s awesome Holodate game: [https://makecode.com/\_hV0JuePrW5bb](https://makecode.com/_hV0JuePrW5bb)

the goal is to make story-telling easier, and to use that awesome text typer.

Here’s the extension currently: [https://github.com/darzu/arcade-words](https://github.com/darzu/arcade-words)

Here’s a sample:

> **[the knight and the monster](https://arcade.makecode.com/68930-18600-70366-72203)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

 ![2020-04-17 19.25.30](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/d2099412d763f456f9367ddf08fe10c6b903ffe7.gif)

There will likely be a lot of changes coming still, as I’m not too happy with the APIs yet. “start story” is weird. “say” not pausing is weird. Setting colors and speed globally is weird. But even so, you can make some pretty cool stuff.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 19, 2020, 10:32pm UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733/2 "2020-04-19T22:32:20Z")

</div>

It looks amazing!

The only thing I don’t understand about the example you provided is that you need to put those blocks inside a start story block. What is the point of that??

---

<div class="post-metadata">

**Author:** ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)\
**Post date:** [April 21, 2020, 3:35pm UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733/3 "2020-04-21T15:35:07Z")

</div>

Yes, this is admittedly awkward and there’s not a simple explanation, and it has to do with the internals of how MakeCode works. I’m still looking to see if there’s a better design.

Technical reason:

It has to do with how On Start works. Because users might depend on code running in On Start before any other code in their program (like variable initialization, etc), On Start is “blocking” meaning if you “pause” in On Start the whole program pauses and waits, so the game engine can’t render or run update logic.

What “start story” does is spins up a background thread effectively that makes the subsequent calls non-blocking to the main game loop. This allows us to use pause to time the story telling.

@jwunderl please correct me if I’m wrong

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [April 21, 2020, 3:56pm UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733/4 "2020-04-21T15:56:07Z")

</div>

On start isn’t blocking, we just move game update events (and a few others) so that they are registered after on start (e.g. [https://makecode.com/\_epmJx3hyVPHD](https://makecode.com/_epmJx3hyVPHD) see that pressing a is reflected on screen even before that pause is up, and that the sprite shows up). It’ll still run the update and render logic, just any of those events registered in blocks won’t be added until after on start finishes.

I would imagine this is actually what you generally want with a story though ( / that you don’t generally want to spin another fiber for this) - if you have an on game update loop that spawns enemies, you dont want it running while you’re talking to the professor to start the story. It should be fine to just drop the wrapping block?

---

<div class="post-metadata">

**Author:** ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)\
**Post date:** [April 21, 2020, 4:06pm UTC](https://forum.makecode.com/t/story-telling-extension-early-preview/1733/5 "2020-04-21T16:06:07Z")

</div>

Oh interesting, I had that backwards. Thanks Joey.

Then I need to debug what goes wrong when I move the logic to the On Start. I was seeing very odd behavior.
