Script to openread a book?

Post » Thu Jun 21, 2012 7:03 pm

Is it possible to have a book or note in the players possession display the content via a scripted method?

I would like to display some help text to users of my mod and thought using a book is a great way to display the information, but I don't want them to have to read the book manually. I want to script open it from a message box option.

Any pointers?
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Thu Jun 21, 2012 10:46 am

If it's an alias, BookAlias.Activate(Game.GetPlayer()) will open the book whether it's in their inventory or not.
User avatar
Lady Shocka
 
Posts: 3452
Joined: Mon Aug 21, 2006 10:59 pm

Post » Fri Jun 22, 2012 12:28 am

If it's an alias, BookAlias.Activate(Game.GetPlayer()) will open the book whether it's in their inventory or not.

Thank you, Justin.

Could you expand on Alias in Papyrus terms. How do I make my book an alias? How do I link an alias to my mod quest?

I basically just want to force show a note, when they click on the 'credits' menu option. Or force read a book, when they click on the' help' menu option.

Trying to make the user interface a little more user friendly ;o)

Thanks for all directions.
User avatar
Sabrina garzotto
 
Posts: 3384
Joined: Fri Dec 29, 2006 4:58 pm

Post » Thu Jun 21, 2012 12:37 pm

In your quest's "Aliases" tab, add two Reference, one filled with PlayerREF found in (any) cell and the other a created book form "In" your PlayerAlias. If the Book has no name, it won't show up as an inventory item, but you can force the player to read it with 'BookAlias.GetReference().Activate(Game.GetPlayer())'. Not sure, however, about detecting when in the Help or Credits menus.
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Thu Jun 21, 2012 9:48 pm

In your quest's "Aliases" tab, add two Reference, one filled with PlayerREF found in (any) cell and the other a created book form "In" your PlayerAlias. If the Book has no name, it won't show up as an inventory item, but you can force the player to read it with 'BookAlias.GetReference().Activate(Game.GetPlayer())'. Not sure, however, about detecting when in the Help or Credits menus.

That is perfect mate. Thank you so much.
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm

Post » Thu Jun 21, 2012 11:02 pm

Not having much luck getting this working! I created the QuestAlias for the Player (specific reference = PlayerRef to NPC_Player).
I then created another alias for the book and linked that to the player alias (create reference to object MyBook, level easy, create in Player alias)

I then created two properties in the script:-

ReferenceAlias Property MintyHelpBookAlias AutoReferenceAlias Property MintyCreditNoteAlias AutoFunction ShowHelp()   MintyHelpBookAlias.GetReference().Activate(Game.GetPlayer())EndFunctionFunction ShowCredits()   MintyCreditNoteAlias.GetReference().Activate(Game.GetPlayer())EndFunction

But I just get the following errors when trying to call ShowCredits()
Spoiler
[06/09/2012 - 12:27:16PM] error: Cannot call Activate() on a None object, aborting function callstack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowHelp() - "MintyQuestScript.psc" Line 92[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowHelp() - "MintyLightningConfigScript.psc" Line 381[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 52[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37[06/09/2012 - 12:27:16PM] warning: Assigning None to a non-object variable named "::temp10"stack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowHelp() - "MintyQuestScript.psc" Line 92[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowHelp() - "MintyLightningConfigScript.psc" Line 381[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 52[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37[06/09/2012 - 12:27:18PM] error: Cannot call Activate() on a None object, aborting function callstack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowCredits() - "MintyQuestScript.psc" Line 97[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowCreditsMenu() - "MintyLightningConfigScript.psc" Line 369[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowDebugMainMenu() - "MintyLightningConfigScript.psc" Line 113[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 54[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37[06/09/2012 - 12:27:18PM] warning: Assigning None to a non-object variable named "::temp14"stack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowCredits() - "MintyQuestScript.psc" Line 97[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowCreditsMenu() - "MintyLightningConfigScript.psc" Line 369[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowDebugMainMenu() - "MintyLightningConfigScript.psc" Line 113[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 54[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37[06/09/2012 - 12:27:18PM] error: Cannot call Activate() on a None object, aborting function callstack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowCredits() - "MintyQuestScript.psc" Line 97[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowCreditsMenu() - "MintyLightningConfigScript.psc" Line 369[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowDebugMainMenu() - "MintyLightningConfigScript.psc" Line 113[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 54[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37[06/09/2012 - 12:27:18PM] warning: Assigning None to a non-object variable named "::temp14"stack:[MintyLightningQuest (3A000D62)].mintyquestscript.ShowCredits() - "MintyQuestScript.psc" Line 97[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowCreditsMenu() - "MintyLightningConfigScript.psc" Line 369[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowDebugMainMenu() - "MintyLightningConfigScript.psc" Line 113[Active effect 1 on  (00000014)].MintyLightningConfigScript.ShowMainMenu() - "MintyLightningConfigScript.psc" Line 54[Active effect 1 on  (00000014)].MintyLightningConfigScript.OnEffectStart() - "MintyLightningConfigScript.psc" Line 37

Any help is much appreciated.
User avatar
Schel[Anne]FTL
 
Posts: 3384
Joined: Thu Nov 16, 2006 6:53 pm

Post » Thu Jun 21, 2012 4:49 pm

OK, sorted it. It was the order the alias, and I have to dismiss my menu before the book opens. Many thanks for the help Justin. I will put you in my ShowCredits()
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am


Return to V - Skyrim