Jump to content

Skyrim-Papyrus Scripting Help


Wolfzomby

Recommended Posts

To all modders willing and able to help:

 

I am currently working on a simple quest mod to practice my modding abilities and I've been going through some tutorials on YouTube to help with papyrus scripting. I've also been looking at the wiki and while papyrus is similar to java, it's different enough and too new (to me) for me to completely comprehend overnight.

 

Essentially, what I want to happen is this:

 

0 - quest has not begun

10 - an NPC asks for a letter to be delivered to another NPC, player agrees, and quest stage advances.

20 - Player delivers letter to recipient NPC and quest progresses to stage 20 and ends

 

so far, I understand how to advance the quest through dialog and I am working with the scripts for the recipient NPC (the tutorial I was looking at involved his NPC dying to advance the quest). This is the code I have so far:

 

Event OnDeath(Actor killer) //This is the wrong event heading. I do not know what I need in place of this.

zabamundSabineQuestProperty.SetObjectiveDisplayed(20)
zabamundSabineQuestProperty.SetStage(20)
EndEvent

 

Any advice and help (other than RTFM) is appreciated. Until then, I will continue to look for answers. Thank you very much.

 

-Wolfzomby

Link to comment
Share on other sites

That doesn't require an event. You simply put the code that would be in the event WITHOUT THE EVENT in the END part of the response (you'll find the End box in the Info window containing your NPC responses).

 

You'll first have to put in a ; then close the window with ok, then reopen it and then paste in your script or else you won't be able to fill properties.

Link to comment
Share on other sites

I see. Then what is the command to force add/remove the letter from the player's inventory? I feel that the Giving NPC must have it in his inventory in order to give it. I feel it would be a function/method along the lines of Player.addItem(letter) and then Sabine.additem(letter) but then it seems there will be two copies of the letter floating around.

Link to comment
Share on other sites

When giving item to player and item is not on NPC:

 

Player.AddItem(TheItem)

 

When giving item to player and item is on NPC:

 

TheNPC.RemoveItem(TheItem,Quantity,true,Player)

 

When taking item from player:

 

Player.RemoveItem(TheItem)

 

If you want the item to be on the NPC after taking it from the player (perhaps for realism)

 

Player.RemoveItem(TheItem,Quantity,false,TheNPC)

 

Be sure to replace the psuedo variables with what you actually use.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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