DukePatrick Posted July 26, 2017 Share Posted July 26, 2017 In Skyrim I think I did this by using player.ACTIVATE(mybook) on a book in a hidden cell. Can I avoid this in Fallout 4? is there a better way? I tried this: Game.GetPlayer().EquipItem(mybook) where MYBOOK was a baseobject and it compiled but did not work in game. Link to comment Share on other sites More sharing options...
TheDungeonDweller Posted July 26, 2017 Share Posted July 26, 2017 I'm thinking use OnItemAdded and then activate the book that way. Link to comment Share on other sites More sharing options...
Hoamaii Posted July 26, 2017 Share Posted July 26, 2017 Assuming your book is not a Static form, but is either a Book (or Note - my CK's not open right now so I don't remember how they're called): PlayerRef.Activate(MyBook) should make the player add the book to its inventory. Once it's in inventory, PlayerRef.EquipItem(myBook) should make you read it. If it's not already in the player's inventory, you probably need both lines: PlayerRef.AddItem(MyBook, 1)PlayerRef.EquipItem(MyBook) Both referencigng the Book form as a property. Haven't tried it with books, but it works fine with potions and food - so I'd assume it's probably very similar for books in FO4. Link to comment Share on other sites More sharing options...
DukePatrick Posted July 26, 2017 Author Share Posted July 26, 2017 Assuming your book is not a Static form, but is either a Book (or Note - my CK's not open right now so I don't remember how they're called): Haven't tried it with books, but it works fine with potions and food - so I'd assume it's probably very similar for books in FO4. Yeah... I assumed the same thing but no it did not work when I used Game.GetPlayer().EquipItem(mybook).Yes the book was already in inventory. I do get a message that the book was added (after the above runs) to my Inv but I do not see two books in my inv only the one I have already put in. Interesting to note that PlayerRef.EquipItem(MyBook) would not compile ... (the playerRef part)!However using Game.GetPlayer() it would compile. Link to comment Share on other sites More sharing options...
llamaRCA Posted July 26, 2017 Share Posted July 26, 2017 This is how I did it: 1) I gave the player a quest objective to read the note 2) I set up a note and 1) added a message (done in the lower left hand corner of the form) 2) added the FeaturedItem keyword and 3) added a script that completes the quest objective when the note is taken into the player's inventory. Event onRead() if llamaAffinityQuestVengeance.GetStageDone(25) == false llamaAffinityQuestVengeance.SetStage(25) endif EndEvent3) When the player picks up the note the message is displayed as on overlay (I added my note to the player's inventory when I wanted them to get it so they never had to pick it up. When it's added to the player's inventory the featureditem stuff kicks in and it's displayed on the screen immediately along with my message). My message adds additional information and isn't a duplicate of the note's contents, but it could just duplicate the note if it isn't too long. You can never force the player to read the note no matter what you do. I did it this way because the message is text on screen and because they don't have to do anything to get that (like click on the note in their inventory which even if they do they still don't have to read it). I figured giving them the text without any effort on their part increases the chances that they'll read it. I added the quest objective hoping that would communicate to them that the info in the note was important and they should read it. Link to comment Share on other sites More sharing options...
Hoamaii Posted July 26, 2017 Share Posted July 26, 2017 Interesting to note that PlayerRef.EquipItem(MyBook) would not compile ... (the playerRef part)!However using Game.GetPlayer() it would compile. Oh, maybe you just forgot to set your properties right. For playerRef to return, you need to set an "Actor Property PlayerRef Auto" - and fill it with the player in the properties tab. You can never force the player to read the note no matter what you do. Maybe it means the "read" procedure is hard-coded in the .swf files then if EquiItem doesn't work for notes? Link to comment Share on other sites More sharing options...
DukePatrick Posted July 26, 2017 Author Share Posted July 26, 2017 Oh, maybe you just forgot to set your properties right. For playerRef to return, you need to set an "Actor Property PlayerRef Auto" - and fill it with the player in the properties tab. PlayerRef is definitely set up properly because the rest of the script works fine using PlayerRef. The entire rest of the mod is done with NO quest, I really do not want to involve an entire quest just for this note. But thank you anyway llamaRCA and for using some of your time to write all that to try to help me. I guess I will just drop the book in a hidden cell and use a remote "activate" like I did in Skyrim. If that will not work I will just give the player a pop up to tell them to read the note. Link to comment Share on other sites More sharing options...
Hoamaii Posted July 26, 2017 Share Posted July 26, 2017 What kind of form are you attaching your script to? Link to comment Share on other sites More sharing options...
llamaRCA Posted July 26, 2017 Share Posted July 26, 2017 Oh, maybe you just forgot to set your properties right. For playerRef to return, you need to set an "Actor Property PlayerRef Auto" - and fill it with the player in the properties tab. PlayerRef is definitely set up properly because the rest of the script works fine using PlayerRef. The entire rest of the mod is done with NO quest, I really do not want to involve an entire quest just for this note. But thank you anyway llamaRCA and for using some of your time to write all that to try to help me. I guess I will just drop the book in a hidden cell and use a remote "activate" like I did in Skyrim. If that will not work I will just give the player a pop up to tell them to read the note. That's just one step of how I did it. You wouldn't need the quest to set it up that way if you saw any advantage to having a message popup on screen. @Hoamaii - I mean that we literally cannot force the player to read the content, nor can we detect if/when the player reads it. When you click on a note in your Pipboy it brings it up for you to look at, but you don't have to read a single word on that page before you close it again. Edit: for clarity Link to comment Share on other sites More sharing options...
DukePatrick Posted July 27, 2017 Author Share Posted July 27, 2017 OK....so this works: ObjectReference rbook = Playerref.placeatme(mybook)rbook.Activate(PlayerRef)rbook.disable()rbook.delete()rbook = none :dance: Link to comment Share on other sites More sharing options...
Recommended Posts