Jump to content

Problems scripting gold reward... Help me?


Lustborn

Recommended Posts

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).

Yup, the CK is just wonkey like that....

MiscObject Property Gold001 Auto

This will need to be added to the script file but outside of the fragment. After that, you should be able to click 'auto fill' in the property window, and the property will be filled automatically. If nothing happens after you click 'auto fill' (because the CK can be so wonkey...), then you have to add the property manually.

Edited by ripple
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).

Yup, the CK is just wonkey like that....

MiscObject Property Gold001 Auto

This will need to be added to the script file but outside of the fragment. After that, you should be able to click 'auto fill' in the property window, and the property will be filled automatically. If nothing happens after you click 'auto fill' (because the CK can be so wonkey...), then you have to add the property manually.

 

 

 

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.

I did what you both said, and the MiscObject thingy line is in the end of the full script, but it gives me this strange error now:

Starting 1 compile threads for 1 files...
Compiling "QF__0200623D"...
C:\Games\Steam\SteamApps\common\skyrim\Data\Scripts\Source\temp\QF__0200623D.psc(87,20): cannot name a variable or property the same as a known type or script
No output generated for QF__0200623D, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF__0200623D
Link to comment
Share on other sites

The message seems pretty self explanatory.

 

The thing is, there's nothing related to gold at all in the script anymore, I took it all out, and if I attemp to add the MiscObject property, it says "cannot name a variable or property the same as a known type or script"

Link to comment
Share on other sites

Here we go :)

 

QUEST FRAGMENTS

 

Stages are: 10, 15, 20 and 200

 

Stage 10:

SetObjectiveDisplayed(10, 1)
Alias_MapMarker.GetRef().AddtoMap()
;enable quest item
Alias_QuestItem.GetRef().Enable()
Alias_BossContainer.GetRef().AddItem(Alias_QuestItem.GetRef())
Stage 15:
;Player has the item
SetObjectiveCompleted(10, 1)
SetObjectiveDisplayed(15, 1)
Stage 20:
SetObjectiveCompleted(15, 1)
Alias_QuestGiver.GetActorReference().AddItem(Alias_QuestItem.GetReference())
Alias_QuestGiver.GetActorReference().SetRelationshipRank(Game.GetPlayer(), 1)
SetStage(200)
Stage 200:
If GetStageDone(20) == 0
FailAllObjectives()
EndIf
Stop()
Full Script from the scripts tab:
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 7
Scriptname QF__0200623D Extends Quest Hidden
;BEGIN ALIAS PROPERTY BossContainer
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BossContainer Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY QuestGiver
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestGiver Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY Dungeon
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Dungeon Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY QuestItem
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestItem Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY MapMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MapMarker Auto
;END ALIAS PROPERTY
;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
If GetStageDone(20) == 0
FailAllObjectives()
EndIf
Stop()
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN CODE
SetObjectiveDisplayed(10, 1)
Alias_MapMarker.GetRef().AddtoMap()
;enable quest item
Alias_QuestItem.GetRef().Enable()
Alias_BossContainer.GetRef().AddItem(Alias_QuestItem.GetRef())
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN CODE
SetObjectiveCompleted(15, 1)
Alias_QuestGiver.GetActorReference().AddItem(Alias_QuestItem.GetReference())
Alias_QuestGiver.GetActorReference().SetRelationshipRank(Game.GetPlayer(), 1)
SetStage(200)
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
;Player has the item
SetObjectiveCompleted(10, 1)
SetObjectiveDisplayed(15, 1)
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
GlobalVariable Property FavorReward Auto
GlobalVariable Property FavorCost Auto
Faction Property FavorCompletedFaction Auto
Faction Property Favor204QuestGiverFaction Auto

 

Link to comment
Share on other sites

That doesn't have the gold property, which is what I needed to be sure (I'm not yelling at you, just pointing out it doesn't have the property). So, I followed your setup, and it compiled fine before I made the new property. I added the property, and it still compiled fine (also, I learned properties can be filled from anywhere; everything in the quest shares the properties). My guess is that we didn't explain it clearly enough and you named the MiscObject property "MiscObject". The TYPE is MiscObject. The name should be "Gold001". So, my final script looked like this:

 

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 8
Scriptname QF_test_050293E3 Extends Quest Hidden

;BEGIN ALIAS PROPERTY BossContainer
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BossContainer Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY QuestItem
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestItem Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY QuestGiver
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestGiver Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Dungeon
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Dungeon Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MapMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MapMarker Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN CODE
SetObjectiveCompleted(15, 1)
Alias_QuestGiver.GetActorReference().AddItem(Alias_QuestItem.GetReference())
Alias_QuestGiver.GetActorReference().SetRelationshipRank(Game.GetPlayer(), 1)
SetStage(200)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
;Player has the item
SetObjectiveCompleted(10, 1)
SetObjectiveDisplayed(15, 1)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_6
Function Fragment_6()
;BEGIN CODE
If GetStageDone(20) == 0
  FailAllObjectives()
EndIf
Stop()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
SetObjectiveDisplayed(10, 1)
 
Alias_MapMarker.GetRef().AddtoMap()
 
;enable quest item
Alias_QuestItem.GetRef().Enable()
Alias_BossContainer.GetRef().AddItem(Alias_QuestItem.GetRef())
;END CODE
EndFunction
;END FRAGMENT

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

MiscObject Property Gold001  Auto   

 

 

 

It's missing a couple of lines, specifically, the factions and global variables. But the gold bit is is there. It's the very last line. And it compiled.

Link to comment
Share on other sites

That doesn't have the gold property, which is what I needed to be sure (I'm not yelling at you, just pointing out it doesn't have the property). So, I followed your setup, and it compiled fine before I made the new property. I added the property, and it still compiled fine (also, I learned properties can be filled from anywhere; everything in the quest shares the properties). My guess is that we didn't explain it clearly enough and you named the MiscObject property "MiscObject". The TYPE is MiscObject. The name should be "Gold001". So, my final script looked like this:

 

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 8
Scriptname QF_test_050293E3 Extends Quest Hidden

;BEGIN ALIAS PROPERTY BossContainer
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BossContainer Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY QuestItem
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestItem Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY QuestGiver
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_QuestGiver Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Dungeon
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Dungeon Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MapMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MapMarker Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN CODE
SetObjectiveCompleted(15, 1)
Alias_QuestGiver.GetActorReference().AddItem(Alias_QuestItem.GetReference())
Alias_QuestGiver.GetActorReference().SetRelationshipRank(Game.GetPlayer(), 1)
SetStage(200)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
;Player has the item
SetObjectiveCompleted(10, 1)
SetObjectiveDisplayed(15, 1)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_6
Function Fragment_6()
;BEGIN CODE
If GetStageDone(20) == 0
  FailAllObjectives()
EndIf
Stop()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
SetObjectiveDisplayed(10, 1)
 
Alias_MapMarker.GetRef().AddtoMap()
 
;enable quest item
Alias_QuestItem.GetRef().Enable()
Alias_BossContainer.GetRef().AddItem(Alias_QuestItem.GetRef())
;END CODE
EndFunction
;END FRAGMENT

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

MiscObject Property Gold001  Auto   

 

 

 

It's missing a couple of lines, specifically, the factions and global variables. But the gold bit is is there. It's the very last line. And it compiled.

Oh, no, I named it Gold001, and selected MiscObject type of property. I did like you told me to. :smile:

But the thing is, there must be somethign wrong with another part of the mod, because if there's nothing related to gold in the scripts, how the hell does it give me that error if I try to add the "MiscObject Property Gold001 Auto" line to the script? I just don't know. Myabe I will have to delete that quest and remake it. Argh why can't it be simpler? Lol.

I removed all properties and tried to add the MiscObject property for gold, and same error.

Yep. I will restart everything. ;-;

Thank you all for your help, sincerely! :smile:

Edited by Lustborn
Link to comment
Share on other sites

Well, before you restart completely, try two things.

 

First, try renaming Gold001 to something else entirely (like GoldRef) and see if it works.

 

Second, compile it and look closer at the error. It'll tell you what line it's on. The lines in Papyrus aren't visibly labeled, but you can still just count down them (or paste the whole thing into Notepad++) to find exactly which line is causing the error. For example:

Starting 1 compile threads for 1 files...
Compiling "X99_AutoStorageActivateScript"...
C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\X99_AutoStorageActivateScript.psc(88,20): cannot name a variable or property the same as a known type or script
No output generated for X99_AutoStorageActivateScript, compilation failed.

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

Pulling out the relevant line: "C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\X99_AutoStorageActivateScript.psc(88,20): cannot name a variable or property the same as a known type or script".

 

Now, ignoring irrelevant beginning: "X99_AutoStorageActivateScript.psc(88,20): cannot name a variable or property the same as a known type or script"

 

The parentheses tell me the error happened on line 88 at the 20th character on that line. So, if I go down to line 88, I see I have "MiscObject Property MiscObject Auto" (I know that's not what you did; just an example), and I know that variable name needs changed.

Edited by Xander9009
Link to comment
Share on other sites

  • Recently Browsing   0 members

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