Skip to main content

Pages and books

Recipe pages, food pages and the books they go in are in Alta.Pages in Root.Township, with the page providers at the top level (no namespace). The server owns which pages exist and which the town has found; books and pages sync from it.

How pages work​

A page isn't an asset of its own. It's a PageData: a provider (what kind of page) plus the thing it's about.

A page is identified everywhere by the pair (provider id, page hash).

GlobalPagesManager​

Alta.Pages.GlobalPagesManager, a NetworkEntityBehaviour singleton (GlobalPagesManager.Instance). The list is built and kept on the server and saved with the world.

MemberWhat it doesNotes
IEnumerable<(int, uint)> AddedPages { get; }Every page the town has found, as (provider id, hash).Starts with each collection's InitialPages.
void AddPage(PageData)Adds a page by its data.Server only.
void AddPage(int providerID, uint hash)Adds a page; raises PageAdded if it's new.Server only.
event Action<(int, uint)> PageAddedA new page was found.Server. Every book listens and adds the page if its collection has it.
static bool IsNew(int providerID, uint pageHash)Not found yet.
void DissolvePage(PaperPageInstance, Interactor)The effect of a loose page flying into the player.Client.

So adding a page to the town is one call on the server, and every book that can hold it picks it up. The console's progress commands do this (ProgressCommandModule).

Books and loose pages​

TypeWhat it is
Alta.Pages.BookA book pickup. Pickup, Collection, IsOpen, Open(), Close(), TurnLeft(bool isSkipping = false), TurnRight(...), AddNewPage(PageData) (server only), DuplicatePage, BookRemovePage. Fills itself from AddedPages when the server creates it. Holding one blocks the hand's stick from moving you.
Alta.Pages.PageInstanceA page inside a book or on paper: Book, Data, Set(PageData), event Action<PageInstance> OnChangedPage.
Alta.Pages.PaperPageInstanceA loose page you find. On the server, an original page (not a duplicate) that's been grabbed refuses docks and further grabs, and when it's let go it's added to the town's list and destroyed; clients play the dissolve effect. AutoAdd(PlayerController) does the same from code.
Alta.Pages.PinboardA board that shows a set of pages.
Alta.Pages.BookSpawner, BookRestrictor, PositionRestrictor, MouldRestrictorSpawning books and keeping them in place.
Alta.Pages.Glyph, GlyphInstanceThe pictures on a page. Item.Glyph is an item's picture.

Hooking it​

See also​