Quote Posted by Sacrond
How can I make scroll buttons, which I can take it in inventory? I noticed, that only books and poster scrolls work as button, but can't create scroll, which you can take to inventory and then read and activate some scripts.
Quote Posted by Yandros
So, I've been meaning to post this for a long time and this is the perfect thread. In
Drymian Codex, I've created a couple of metaproperties which have proven really useful for handling books and scrolls. As Larry pointed out, the
StdBook script responds to
FrobWorldEnd, which means it only works when frobbing the book in the world and also that books don't by default get moved into your inventory.
StdScroll responds instead to
FrobInvEnd, meaning scrolls can only be read in inventory, which is why their FrobInfo properties are set up to move them to your inventory and then trigger the script when frobbed there.
But sometimes you want a scroll to be read when frobbed in world, and not moved to inventory - such as a poster scroll. And sometimes you want a book moved to inventory when frobbed in world because it's an important item for the player to keep, and it needs to be read from inventory. So I created these two Metaproperties:
M-BookToScrollEngine Features > Frob info:
Move, Script, NoneS > Scripts:
StdScroll, , , , Don't inherit=uncheckedM-ScrollToBookEngine Features > Frob info:
Script, None, NoneS > Scripts:
StdBook, , , , Don't inherit=uncheckedNow if you have a scroll you want to be read in world, just add
M-ScrollToBook to it. And if you have a book you want moved to inventory and read when frobbed there, just add
M-BookToScroll. Additionally, I suppose you could leave the Scripts props out of the metaproperties if you added them both to both archetypes (i.e. add StdScroll to Book(-22) and add StdBook to Scroll(-1286)).
Aside: Before someone mentions it, yes,
Don't inherit can also be checked (and perhaps should be for aesthetic reasons), but leaving it unchecked also works; the script on the archetype won't ever be triggered due to the change in Frob info.
So scrolls should already go to your inventory by default, but if yours was a book and you changed its model to a scroll, it still has the StdBook script and you would get book properties. As for making it trigger something when frobbed in inventory, don't use StdButton. That's what (
) TrigInvFrob is for.