Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

By default, the Ply renderer doesn't have the deck, cards, or any local widgets in scope when it evaluates a Lil fragment, so it can't manipulate parts of the deck.

If you're using "twee.render[story passagename vars]" directly like in this demo, "vars" can be a dictionary containing arbitrary bindings, including references to the widgets of the current card.

The PlyPlayer contraption has similar functionality, but it is less flexible; you can read and write its .vars attribute, but this feature is only designed to store data that can be serialized in a field's .data attribute, not references to deck parts.

The easiest way to have Ply stories interact with a surrounding deck is to use the passage[] event that the PlyPlayer emits every time it visits a new passage. By keeping deck-influencing logic separate from the Ply story itself the story will still be entirely playable within the Twine editor. There's some relevant discussion in this thread.

Does that help at all?

(+1)

Yes! This is super helpful. Should've figured it was a scope thing :p. Many thanks!