Jump to content

Problems scripting gold reward... Help me?


Lustborn

Recommended Posts

Sooo... i'm trying to make a quest. You go, get an amulet for someone, you give him the amulet, he gives you a gold reward (double the value of the amulet) and gets to be your follower. I think I got everything right but the gold reward part. I've set this script for the last quest stage:

SetObjectiveCompleted(15, 1)
Alias_QuestGiver.GetActorReference().AddItem(Alias_QuestItem.GetReference())
Alias_QuestGiver.GetActorReference().SetRelationshipRank(Game.GetPlayer(), 1)
Game.GetPlayer().AddItem(Gold001, Alias_QuestItem.GetReference().GetGoldValue() * 2)


But when I try to compile the script, the following error appears:

Starting 1 compile threads for 1 files...
Compiling "QF__0200623D"...
C:\Games\Steam\SteamApps\common\skyrim\Data\Scripts\Source\temp\QF__0200623D.psc(47,25): Gold001 is not a variable
No output generated for QF__0200623D, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF__0200623D

 

I've searched on Google, and it seems I need to make an object property script thing to the gold. But I can't do it... I searched about it but everything I did went wrong >:I Can somebody help me?

 

Link to comment
Share on other sites

I think you are overly-complicating this. It seems that all you need is a dialogue option conditioned to appear only when 1) the player has the amulet in his/her possession, or 2) even simpler, only after the player has completed the quest stage for retrieving the amulet. Then you can attach a script fragment to the dialogue topic which will 1) remove the amulet and 2) add the gold reward, 3) complete the quest.

 

http://www.creationkit.com/Bethesda_Tutorial_Quest_Loose_Ends

Edited by ripple
Link to comment
Share on other sites

To actually answer the question, the error is exactly what it says. "Gold001" isn't a variable that you've set anywhere. Variables come in two version, normal, and properties. You need a property, which is just a variable which tells the rest of the script what you're talking about when you say "Gold001". Add this right under the script name "MiscObject Property Gold001 Auto" without the quotes on its own line. It'll make a property that you'll have to set (which you can do by clicking auto fill) in the properties box (there's a button to get to it where you right click the script and choose edit source).

  • Like 1
Link to comment
Share on other sites

To actually answer the question, the error is exactly what it says. "Gold001" isn't a variable that you've set anywhere. Variables come in two version, normal, and properties. You need a property, which is just a variable which tells the rest of the script what you're talking about when you say "Gold001". Add this right under the script name "MiscObject Property Gold001 Auto" without the quotes on its own line. It'll make a property that you'll have to set (which you can do by clicking auto fill) in the properties box (there's a button to get to it where you right click the script and choose edit source).

 

I've come across someone saying that, but where is the script for Gold001 so that I can set a property on it? xD I'm kind of new to all this scripting things.

Link to comment
Share on other sites

Sorry, I was in a hurry and misread your problem.

 


MiscObject Property Gold001 Auto

Should be inserted at the bottom of the script fragment, after

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Save your script fragment. After that, select the script file in the script window, and click 'properties.' This will open up another window that will allow you to fill the properties.

Edited by ripple
Link to comment
Share on other sites

Here's a pic to make things more clear if that didn't help. I forgot to put it in the pic, but make sure you compile after adding the new line and before clicking properties (so, between steps 1 and 2, click compile). I've never used quest script fragments. But that should do it.

 

http://i895.photobucket.com/albums/ac160/richard_l_homan/gold001property.png

Link to comment
Share on other sites

Here's a pic to make things more clear if that didn't help. I forgot to put it in the pic, but make sure you compile after adding the new line and before clicking properties (so, between steps 1 and 2, click compile). I've never used quest script fragments. But that should do it.

 

http://i895.photobucket.com/albums/ac160/richard_l_homan/gold001property.png

 

Oooooooh so THAT'S where I put it... I did see the property in the scripts tab but I was like "What am I supposed to do with this??". Thanks! I will try this now.

 

Sorry, I was in a hurry and misread your problem.

 

MiscObject Property Gold001 Auto

Should be inserted at the bottom of the script fragment, after

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Save your script fragment. After that, select the script file in the script window, and click 'properties.' This will open up another window that will allow you to fill the properties.

 

Haha it's ok <3 I actually was using the tutorial you mentioned for the quest. Thanks for the help!

Link to comment
Share on other sites

Alright, it gave out a different error this time! Not sure if progress, but it did change somehting!

 

Starting 1 compile threads for 1 files...
Compiling "QF__0200623D"...
C:\Games\Steam\SteamApps\common\skyrim\Data\Scripts\Source\temp\QF__0200623D.psc(62,0): no viable alternative at input 'MiscObject'
C:\Games\Steam\SteamApps\common\skyrim\Data\Scripts\Source\temp\QF__0200623D.psc(62,20): no viable alternative at input 'Gold001'
No output generated for QF__0200623D, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF__0200623D
I willbe searching this with Google, but if any of you can tell me what is wrong... Ugh scripting is weird. xD
Link to comment
Share on other sites

So, I've never done anything with quests (because the quest system is by far the worst of the entire series as far as usability is concerned). I stick with full scripts. WIth that in mind, I misinformed you. A property apparently can't be written into a script fragment. It has to be added either using the button "Add Property" or by typing it into the real script (which is probably what ripple meant).

 

To do it the first way, on your quest stage, click Properties, then Add Property. Its type will be MiscObject and its name will be Gold001. If it gives you an error saying it's already defined, you'll be forced to do it the second way.

 

To do it the second way, go to the scripts tab and right-click>Edit the script. There's be lots of lines that say not to edit between them. Ignore them entirely (as in, do what they say and don't edit between them). At the very bottom of the script, add the line I mentioned there. (If it said it was already defined, there'll probably be two lines here that are identical. Delete one.) The properties will need filled just like before. I don't know if it needs done in both places or just on the stage, but when you go back to the stage and click properties and fill them in, it should then compile.

 

[i actually had to learn this myself just now because, like I said, I've never worked with quests. At least, never with quest stages or fragments. A few aliases and lots of scripts, but never stages or fragments. So, I had no idea they were so strange. The system as a whole just seems confusing and dumb. By dumb, I don't mean "that's dumb". I mean it doesn't understand simple things (like declaring variables) when it really, really should.]

 

EDIT: I suppose I should point out the entire script fragment on the stage is exactly what you had to begin with. There should NOT be a line there for the property at all.

Edited by Xander9009
Link to comment
Share on other sites

So, I've never done anything with quests (because the quest system is by far the worst of the entire series as far as usability is concerned). I stick with full scripts. WIth that in mind, I misinformed you. A property apparently can't be written into a script fragment. It has to be added either using the button "Add Property" or by typing it into the real script (which is probably what ripple meant).

 

To do it the first way, on your quest stage, click Properties, then Add Property. Its type will be MiscObject and its name will be Gold001. If it gives you an error saying it's already defined, you'll be forced to do it the second way.

 

To do it the second way, go to the scripts tab and right-click>Edit the script. There's be lots of lines that say not to edit between them. Ignore them entirely (as in, do what they say and don't edit between them). At the very bottom of the script, add the line I mentioned there. (If it said it was already defined, there'll probably be two lines here that are identical. Delete one.) The properties will need filled just like before. I don't know if it needs done in both places or just on the stage, but when you go back to the stage and click properties and fill them in, it should then compile.

 

[i actually had to learn this myself just now because, like I said, I've never worked with quests. At least, never with quest stages or fragments. A few aliases and lots of scripts, but never stages or fragments. So, I had no idea they were so strange. The system as a whole just seems confusing and dumb. By dumb, I don't mean "that's dumb". I mean it doesn't understand simple things (like declaring variables) when it really, really should.]

 

EDIT: I suppose I should point out the entire script fragment on the stage is exactly what you had to begin with. There should NOT be a line there for the property at all.

Hahaha, the Creation Kit does seem a little weird to me, but I will do as you said!

Thank you so much for your time, there is really few things that need to be done now before I can publish the mod, so i want to make sure everything is right.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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