Baaleos Posted April 25, 2018 Share Posted April 25, 2018 I am looking at Remote Events Event OnInit() ; Register for Activate event from the secret door RegisterForRemoteEvent(SecretDoor, "OnActivate") EndEvent ; Special event to receive when the door is activated ; Note the type in the event name matches the type of the first parameter, and is also the script where the ; event is originally defined. Event ObjectReference.OnActivate(ObjectReference akSender, ObjectReference akActionRef) Debug.Trace(akSender + " was activated by " + akActionRef) EndEventWhich looks like it will allow me to do what I want without having to bind a script to every book in the game.However, I am unsure how to populate the first field of the RegisterForRemoteEventSince this field needs to be the book that is being read.Is there a way with Quest Alias' to make it match any book in the game?I am basically trying to get a script to fire when someone reads any book - just as a short cut to having to edit hundreds of form objects to add a script call. Link to comment Share on other sites More sharing options...
FrankFamily Posted April 25, 2018 Share Posted April 25, 2018 Isn't that a fallout 4 event? Link to comment Share on other sites More sharing options...
Baaleos Posted April 25, 2018 Author Share Posted April 25, 2018 Isn't that a fallout 4 event? OnRead exists in Skyrim as far as I know.at the moment, the only way I know to detect it is by attaching the event to the book itself.But remote events would be able to detect it - in theory.If I found a way to bind it to all books. Link to comment Share on other sites More sharing options...
FrankFamily Posted April 25, 2018 Share Posted April 25, 2018 (edited) The "RegisterForRemoteEvent + ObjectReference.OnActivate" I meant, I think that's new in Fo4 and won't work in skyrim Edited April 25, 2018 by FrankFamily Link to comment Share on other sites More sharing options...
Baaleos Posted April 25, 2018 Author Share Posted April 25, 2018 Ah... damn...Don't suppose anyone knows an alternative means of running a function onRead for all books? Link to comment Share on other sites More sharing options...
RichWebster Posted April 26, 2018 Share Posted April 26, 2018 What I would do is create a perk that fires off a script when the player activates a book. Link to comment Share on other sites More sharing options...
RichWebster Posted April 26, 2018 Share Posted April 26, 2018 Something like this: Perk main screen Perk entry conditions: Link to comment Share on other sites More sharing options...
RichWebster Posted April 26, 2018 Share Posted April 26, 2018 (edited) Extra: I have tested this and it works. If you want to catch books the player reads from their inventory, OnObjectEquipped fires for that. Attach this script to the player somehow and test it. Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Book Debug.Trace("This actor just equipped a book!") endIf endEvent Edited April 26, 2018 by B1gBadDaddy Link to comment Share on other sites More sharing options...
Baaleos Posted April 26, 2018 Author Share Posted April 26, 2018 Extra: I have tested this and it works. If you want to catch books the player reads from their inventory, OnObjectEquipped fires for that. Attach this script to the player somehow and test it. Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Book Debug.Trace("This actor just equipped a book!") endIf endEvent Thanks for solving that for me.Someone contacted me asking for assistance with getting their mod created.They were on the verge of going through every book form adding a script to it, but this solution is much easier. Link to comment Share on other sites More sharing options...
javaplaza Posted May 3, 2019 Share Posted May 3, 2019 (edited) what an awesome script Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Book Debug.Trace("This actor just equipped a book!") endIf endEvent Edited May 3, 2019 by javaplaza Link to comment Share on other sites More sharing options...
Recommended Posts