Jump to content

Quest Script for reward's after quest


jefthereaper

Recommended Posts

k, so im trying to make a script of the vanilla game give more then 1 reward after the quest is over.

Problem is, not 1 site tells me how to make a script, everybody just sais "this is what scripting is" they dont tell how to make it, they just tell us what scripting is as if explained in a dictionary.

meaning that not a single site, even the official Bethesda ones tell me how to create a script or understand existing scripts!

all i can make now is a activator saying "hello, my first script"! and thats basically where the tutorials end -_-'

 

up to now i want to add a new quest reward to the script,

i already have:

 

Game.GetPlayer().AddItem(***)

 

now where i have the *** is the item i want the game to add to the player, but what name should i put there?! just the normal ID for a item wont work, so how im i supposed to know how to name the item? (for example IronSword, wont work, how do i have to name my iron sword to make it work?)

 

sorry if it all sounds like jibrish, im just very stressed out by the fact that there are a billion tutorials on making scripts, but all those tutorials are totaly random and useless course those scripts have no usefully purpose at all, not to mention large missing holes in the tutorials so that even if the guy explains you how to make it, you wont know what to do course you never learned those things in the first place, (and i mean seriously, if there is a tutorial on making statue's teleport all over the place then why is it too much asked to explain how to add a quest item?)

 

i hope somebody answers soon course i need this for about 20 mods im working on, but at this rate with all the missing tutorials i wont ever get them finished :facepalm:

Link to comment
Share on other sites

I'll try to explain as best I can. The problem tho is that one tutorial on how to build a script may not work for another script since each script is unique. This is why the tutorials go over the basics of what the commands do and they do explain the basics of how to put something together. i.e. the "hello, my first script" tutorial.

 

At any rate...

 

You start out with a script name and what type of script it extends i.e. Actor, ObjectReference etc...

 

Then you list out any properties and/or variables that you need to define for your script to work.

 

In your case you need something like:

 

MiscObject Property SomeMiscObjectIWantToGive Auto

The big long phrase/word SomeMiscObjectIWantToGive is what you will use throughout the script to reference the object you are rewarding the player with. Then after you've gotten your script to compile you set the properties by highlighting the script and pressing the properties button. It is here when you select the property for SomeMiscObjectIWantToGive that you actually assign the specific item, leveled list or whatever.

 

Keep in mind that there are different property types depending upon what you are wanting to give. Ingredients are in the Ingredient property, potions are in the Potions property.

 

This will give you a visual reference to Papyrus and it has helped me figure out some things that I otherwise would have stumbled about doing.

http://skyrim.nexusmods.com/mods/13430

 

I can't go into specifics on how to make the script for a quest as I've never done that, but I do have experience with adding and removing items.

Hope this has helped to some extent at least.

Link to comment
Share on other sites

Thanks! I just tried what you said but it still fails when saving the script,

but the new mod/script visual file's you linked too seem interesting, so i will give it a try, thanks for the quick reply ^^

 

btw i really like those tests in your signature, tough mine seem to reveal a darker side of me XD

Edited by jefthereaper
Link to comment
Share on other sites

This is a sample script which may compile but shouldn't be used like this. It explains two possible methods of getting an item into an inventory. You have to pick the method you want and adapt it to your script

 

 

Scriptname AddOneItemToAContainer extends ObjectReference
{Adds one item to a designated container. Note containers include actor inventories.}

Import Game

;Ingredient Property for the item we are going to give
Ingredient Property IngredientItem Auto

;Container Property for the container that the item is going into
ObjectReference Property EndingContainer Auto

;Container Property for the container that the item is coming from
ObjectReference Property StartingContainer Auto

;this event is used when an actual container is activated, but other things like quests would need to use a different event
;this event uses the RemoveItem command -- RemoveItem requires the item to be already present in the starting container
Event OnActivate(ObjectReference Someone)
 Actor Player = GetPlayer()
 Int NumOnHand = 0
 If Someone == Player
   NumOnHand = StartingContainer.GetItemCount(IngredientItem)
   If NumOnHand >= 1
     ;Using False allows the text display to indicate that the item was transfered
     ;Here we check to see if the starting container has the number that we want.  in this case any amount over 0
     StartingContainer.RemoveItem(IngredientItem,NumOnHand,False,EndingContainer)
   EndIf
 EndIf
EndEvent


;this event is used when an actual container is activated, but other things like quests would need to use a different event
;the event uses the AddItem command -- AddItem creates the item out of thin air unless it is a reference item
Event OnActivate(ObjectReference Someone)
 Actor Player = GetPlayer()
 If Someone == Player
   ;Using False allows the text display to indicate that the item was transfered
   ;Here we hard set the # of the item to give to 1
   EndingContainer.AddItem(IngredientItem,1,False)
 EndIf
EndEvent

 

Maybe this will help a bit more....

Link to comment
Share on other sites

I am curious as to how you figured it out because I have a mod that does something similar only at the end of the thane quests. I figured out that the quest aliases are where the changes are made and also how to properly add the items in scripts sections was a real pain but I also want to add one thing to the list of stuff to buy for breezehome and just haven't gotten around to it yet still working on breezehome.
Link to comment
Share on other sites

well you just to to the script (the one that takes care of everything that happens in the quest) and simply eddit properties

 

then in the list add a new property (Misc item, book spell, watever you are adding) and name it something special (like "MSpellBook")

then say oke and go to the new entry you made in the list, click it and give it the item you want it to give in the list.

 

then say oke to everything and now click edit source on the script

now go to the place in the script where the reward is given to the player (you will require to know how scripts work to recognize it)

and re type the same line under it, but with the name you made earlier (MSpellBook) as your reward entry (so the game knows that is the reward you should get)

 

be carefull tough, i am not sure if the way i explain it is clear enough nor your intentions on how to alter the script (the main reason i alter these scripts is course i know what im doing at this point and i know it cant break the game nor make incompatibilities)

 

if you want to use this for changing items to gain for Breezehome then this script i just explained here is totally not going to work

Edited by jefthereaper
Link to comment
Share on other sites

Yes I understood what you are saying and thanks for posting that. That is what I did when I first made my thanes reward mod but what I learned the hard way was to look at and copy exactly what was already there and understand how it all works together which I still don't know much of but I do understand how quest aliases work now for favor quests like becoming thane of a hold. What I was hoping to see in your post was something I missed or have not tried yet but you did things the same way I did in relation to what I wanted to know.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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