azzendix Posted December 28, 2016 Share Posted December 28, 2016 (edited) Problem:I created the mod and use a book as option menu. I want to skip the "close a book" part after using menu. Any way to do it with a script? Detail:Here is an example screenshot from Violens mod.http://i.imgur.com/oa6bKx8.jpg General book menu Open inventory menu -> Read that book -> (the book open) -> (the message box show up) -> choose option and exit -> press Tab/Esc to close the book -> Back to inventory menu What I want to doOpen inventory menu -> Read that book -> (the book open) -> (the message box show up) -> choose option and exit -> (the book close automatically) -> Back to inventory menu This is my book script. Scriptname _TakeCare_Book extends ObjectReference Message Property _TakeCare_MainMenu Auto Message Property _TakeCare_Msg Auto _TakeCare_Quest Property _TakeCare_Quest_Property Auto Event OnRead() Utility.WaitMenuMode(1.0) Menu(0) EndEvent Function Menu(Int aiButton) If aiButton == 0 aiButton = _TakeCare_MainMenu.Show() If aiButton == 0 ; Turn ON message _TakeCare_Quest_Property.Status = 1 ElseIf aiButton == 1 ; Turn OFF message _TakeCare_Quest_Property.Status = 0 EndIf EndIf EndFunction Edited December 28, 2016 by azzendix Link to comment Share on other sites More sharing options...
Lisselli Posted December 28, 2016 Share Posted December 28, 2016 Make a "Done/Exit(this means add a third button to the message form as well)" button and use return. Return exits the function and auto-closes the book. Although it will not keep the inventory menu open. Link to comment Share on other sites More sharing options...
azzendix Posted December 28, 2016 Author Share Posted December 28, 2016 (edited) I put "return" to all three button. None of them auto-close the book. What am I doing wrong? Here is my current script. Scriptname _TakeCare_Book extends ObjectReference Message Property _TakeCare_MainMenu Auto Message Property _TakeCare_Msg Auto _TakeCare_Quest Property _TakeCare_Quest_Property Auto Event OnRead() Utility.WaitMenuMode(1.0) Menu(0) EndEvent Function Menu(Int aiButton) If aiButton == 0 aiButton = _TakeCare_MainMenu.Show() If aiButton == 0 ; Turn ON message _TakeCare_Quest_Property.Status = 1 return ElseIf aiButton == 1 ; Turn OFF message _TakeCare_Quest_Property.Status = 0 return ElseIf aiButton == 2 ; Exit return EndIf EndIf EndFunction Edited December 28, 2016 by azzendix Link to comment Share on other sites More sharing options...
lofgren Posted December 28, 2016 Share Posted December 28, 2016 Check out the black books from dragonborn. They do this. Link to comment Share on other sites More sharing options...
azzendix Posted December 29, 2016 Author Share Posted December 29, 2016 (edited) Checked it. Black book auto-close and back to 1st person view not inventory menu.I think It can be done with this code.(from creation kit website) Game.DisablePlayerControls(False, False, False, False, False, True) ; Ensure MessageBox is not on top of other menus & prevent book from opening normally. Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls Not really what I want but thank for the answer. Lisselli and lofgren. Look like it's a bit too far from my knowledge. I decide to leave it that way.(or use code above, at most) Edited December 29, 2016 by azzendix Link to comment Share on other sites More sharing options...
lofgren Posted December 29, 2016 Share Posted December 29, 2016 I think that will boot the player out of all menus, same as with the black books. Link to comment Share on other sites More sharing options...
Lisselli Posted December 29, 2016 Share Posted December 29, 2016 (edited) I put "return" to all three button. None of them auto-close the book. What am I doing wrong? Nothing. That was my mistake. Return works well when you're using a menu that is'nt invoked from opening a book. My mod doesn't use books. The code on that wiki is actually the old Oblivion way of making menus. It's much easier to just use separate menu "functions", than nesting a while loop.. if you think about trying the examples there. Edited December 29, 2016 by Lisselli Link to comment Share on other sites More sharing options...
Recommended Posts