Jump to content

Papyrus Scripts Needed


Recommended Posts

I'm making a quest mod and at one point you have to go talk to an old wizard. He's supposed to give the player a book but I'm not sure how to do that. The book is in his inventory but I don't know how to get it to the player's. If anyone could shed some light on the situation, it would be much appreciated.

Link to comment
Share on other sites

You just need to write a papyrus script fragment for the dialogue entry (assuming he gives the book while talking). First create the fragment script with a dummy value by just typing

;

into the Papyrus Fragment block (for either the Begin or End fragment) then press the Compile button. That should add a new TIF script to the box on the right. Highlight it and press the Properties button then add a property for your book (using the Book type). Then go back to the fragment block and replace the semicolon with something like this (but using your book property name of course) and press the Compile button again.

akspeaker.RemoveItem(TheSpecialBookPropertyYouCreated, 1, false, Game.GetPlayer())

That line should remove the book from the speaker and give it to the player.

Link to comment
Share on other sites

I went to go do what you said and kept getting this:

 

Starting 1 compile threads for 1 files...
Compiling "TIF__0200A5FA"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(17,14): script property D23LoreBook already defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(17,14): script variable ::D23LoreBook_var already defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(17,14): script property D23LoreBook already has a get function defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(17,14): script property D23LoreBook already has a set function defined
No output generated for TIF__0200A5FA, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__0200A5FA
Link to comment
Share on other sites

Set the dialogue fragment block to set the next stage [ie GetOwningQuest().SetStage(10)] and place this fragment in that stage with 'Wizard' and 'book' being whatever you alias' are called:

 

Alias_Wizard.GetReference().RemoveItem(Alias_book.Getreference(),1,False,Game.GetPlayer())

debug.notification("Book added")

Link to comment
Share on other sites

Set the dialogue fragment block to set the next stage [ie GetOwningQuest().SetStage(10)] and place this fragment in that stage with 'Wizard' and 'book' being whatever you alias' are called:

 

Alias_Wizard.GetReference().RemoveItem(Alias_book.Getreference(),1,False,Game.GetPlayer())

debug.notification("Book added")

I did what you said and I get this when trying to compile:

 

Starting 1 compile threads for 1 files...
Compiling "TIF__0200A5FA"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(19,14): script property D23LoreBook already defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(19,14): script variable ::D23LoreBook_var already defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(19,14): script property D23LoreBook already has a get function defined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0200A5FA.psc(19,14): script property D23LoreBook already has a set function defined
No output generated for TIF__0200A5FA, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__0200A5FA
Link to comment
Share on other sites

Need to see the whole script to help you here ...

 

The error is telling you the "LoreBook" is being define more then one time. The error happen at line 19. 14 spaces down the line ... that's a no no

 

What Dogrules showed you was the raw command how to pass the book from the "wizard" to the player.

Link to comment
Share on other sites

That's the errors you got from the first suggestion ie akspeaker etc. So you still have that line in a quest fragment block somewhere. Remove it and try again and just use the fragments I suggested.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...