also is there a way to add books to a bookshelf
Scriptname MyBook extends ObjectReferenceObjectReference Property TheItem AutoEvent OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) if (newContainer == Game.GetPlayer()) Game.GetPlayer().DropObject(TheItem,1) endifEndEvent
ScriptName _S_MyBookActivatorScript Extends ObjectReference ReferenceAlias Property pBook AutoEvent OnActivate(ObjectReference akActionRef) pBook.GetRef().Activate(Game.GetPlayer())EndEvent
Alias_BookActivator.GetRef().Enable()
Scriptname MyBook extends ObjectReferenceEvent OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) if (newContainer == Game.GetPlayer()) Game.GetPlayer().DropObject(Self, 1) endifEndEventYou don't actually have to make a property if the script is attached to the object your dropping.
ScriptName _S_MyBookActivatorScript Extends ObjectReference Book Property pBook AutoEvent OnActivate(ObjectReference akActionRef) ObjectReference pBookRef = Game.GetPlayer().PlaceAtMe(pBook, abInitiallyDisabled = true) if pBookRef != none pBookRef.Activate(Game.GetPlayer()) pBookRef.Delete() endifEndEvent
Scriptname MyBook1 extends ObjectReferenceObjectReference Property ReadBook AutoEvent OnLoad() BlockActivation() SetMotionType(Motion_Keyframed)EndEventEvent OnActivate(ObjectReference reader) ReadBook.Activate(Game.GetPlayer())EndEventand this code on MyBook
Scriptname MyBook extends ObjectReferenceMessage Property ChoiceMessage AutoObjectReference Property TheItem AutoObjectReference Property Storage AutoEvent OnLoad() SetMotionType(Motion_Keyframed)EndEventFunction ReadMyBook(bool fromWorld) int choice = ChoiceMessage.Show() if (choice == 0) ; do nothing elseif (choice == 1) ; Choice 1 code else ; WTF endifEndFunctionEvent OnEquipped(Actor reader) Utility.WaitMenuMode(2.0) ReadBlockActivation() Blocks normal activation processing on MyBook1 but the UI still shows you and read it and the OnActivate events stills fires
SetMotionType(Motion_Keyframed) stops both books from being moved by the player
i put Mybook1 int my cell where the player can read it
i put a playerchest in the cell where the player can not get to it and i put MyBook on top of it
ReadBook Property in the MyBook1 script is set to the MyBook Object
TheItem Property in the MyBook script is set to the MyBook Object
Storage Property in the MyBook script is set to the PlayerChest
i added the TheItem.MoveTo(Storage) as the ChoiceMessage would not show if i left the book in the chest so for a book with no ChoiceMessage it sould works with out the TheItem.MoveTo(Storage)