Quest Reward Problem

Post » Tue Jun 19, 2012 10:43 pm

I have an NPC that is supposed to give the player 500 gold for every bug jar they turn in. What I want to happen is that every time you turn in a jar, without changing the quest stage, it gives him the jar and you 500 gold. How can I do that?
Do I just write a scipt extending AliasReference?
User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Tue Jun 19, 2012 4:03 pm

Yeah, you have to create AliasReference of gold
User avatar
Raymond J. Ramirez
 
Posts: 3390
Joined: Sun Oct 14, 2007 8:28 am

Post » Tue Jun 19, 2012 4:28 pm

Yeah, you have to create AliasReference of gold

I tried adding this script to the dialogue:


Scriptname InsectTurnIN extends ReferenceAlias  Alias Property TBJBurke  Auto  Alias Property Insect  Auto  MiscObject Property Gold01  Auto  Int Property Quantity = 500 Auto  function giveBug()	TBJBurke.GetReference().AddItem(Insect.GetReference())	Game.getPlayer().addItem(Gold01, Quantity)endFunction

and I get these errors

Starting 1 compile threads for 1 files...
Compiling "InsectTurnIN"...
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\InsectTurnIN.psc(12,13): GetReference is not a function or does not exist
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\InsectTurnIN.psc(12,43): GetReference is not a function or does not exist
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\InsectTurnIN.psc(12,28): none is not a known user-defined type
No output generated for InsectTurnIN, compilation failed.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Tue Jun 19, 2012 10:51 am

:biggrin: You can do this the easy way.
Scriptname InsectTurnIN extends ReferenceAliasMiscObject Property Gold01  Auto
But this
Game.getPlayer().addItem(Gold01, 500)
you have to write in the dialogue

If it doesn't work, rename Scriptname InsectTurnIN extends ReferenceAlias on this Scriptname InsectTurnIN extends ObjectReference
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Tue Jun 19, 2012 7:00 pm

:biggrin: You can do this the easy way.
Scriptname InsectTurnIN extends ReferenceAliasMiscObject Property Gold01  Auto
But this
Game.getPlayer().addItem(Gold01, 500)
you have to write in the dialogue

If it doesn't work, rename Scriptname InsectTurnIN extends ReferenceAlias on this Scriptname InsectTurnIN extends ObjectReference

Even after removing the Gold line, it still gives me the same errors. I tried both extending and importing ObjectReference, no help/
User avatar
asako
 
Posts: 3296
Joined: Wed Oct 04, 2006 7:16 am

Post » Tue Jun 19, 2012 5:00 pm

The first two errors are because of this line:

    TBJBurke.GetReference().AddItem(Insect.GetReference())

The type Alias does not have a GetReference() function. Maybe you meant to make these properties type ReferenceAlias? The third error is kinda bogus since it is just complaining about GetReference() returning nothing, but it can't find the function anyhow so it doesn't know what it returns.

I am concerned with this piece:

function giveBug()	TBJBurke.GetReference().AddItem(Insect.GetReference())	Game.getPlayer().addItem(Gold01, Quantity)endFunction

Do you ever call giveBug() anywhere?
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Tue Jun 19, 2012 10:07 pm


The type Alias does not have a GetReference() function.

What I did is what they show in the tutorial for making a quest on the wiki (see Bendu Olo, under the objectives part)
They show it using aliases with getreference. Why can't I?

Also, I do not know what you mean by 'calling' giveBug. Usually what I do is include the code within the script, and then basically repeat it in the Papyrus fragment.
User avatar
Haley Cooper
 
Posts: 3490
Joined: Wed Jun 14, 2006 11:30 am


Return to V - Skyrim