Jump to content

Problems scripting gold reward... Help me?


Lustborn

Recommended Posts

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.

 

Great! Thanks for that, I didn't actually realize it would show the line that contains the error

Link to comment
Share on other sites

  • 3 years later...

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.

 

 

I did what your pic did (Since I have a similar problem) placed it at the beginning (before the if 'statement', before endIf, and after that.) All of them come up with this message.

 

Starting 1 compile threads for 1 files...
Compiling "TIF__04019D3D"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,0): no viable alternative at input 'MiscObject'
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,20): no viable alternative at input 'GoldBase'
No output generated for TIF__04019D3D, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__04019D3D

 

 

Here's my script as of now.

if (Game.GetPlayer().GetGoldAmount() >= 10000)
	; lines to remove gold from player then adds key to player
	Game.GetPlayer().RemoveItem(GoldBase, 50)
	Game.AdvanceSkill ("Alchemy", 1.0)
Elseif (Game.GetPlayer().GetGoldAmount() < 10000)
	; lines to remove gold from player then adds key to player
	Debug.Messagebox("Sorry you don't have enough Septims.")
MiscObject Property GoldBase Auto
endif

And since it won't compile I can't check properties, and when I remove it, and click on the properties tab (and the RemoveItem bit) I for some reason can't add or edit properties (it shows up, but all of it's greyed out).

 

 

Edit:

 

Sorry for dropping into the subject. But since I have the same basic problem, I thought I'd use this thread instead of making a new one.

Edited by TheGreatEater
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.

 

 

I did what your pic did (Since I have a similar problem) placed it at the beginning (before the if 'statement', before endIf, and after that.) All of them come up with this message.

 

Starting 1 compile threads for 1 files...
Compiling "TIF__04019D3D"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,0): no viable alternative at input 'MiscObject'
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,20): no viable alternative at input 'GoldBase'
No output generated for TIF__04019D3D, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__04019D3D

 

 

Here's my script as of now.

if (Game.GetPlayer().GetGoldAmount() >= 10000)
	; lines to remove gold from player then adds key to player
	Game.GetPlayer().RemoveItem(GoldBase, 50)
	Game.AdvanceSkill ("Alchemy", 1.0)
Elseif (Game.GetPlayer().GetGoldAmount() < 10000)
	; lines to remove gold from player then adds key to player
	Debug.Messagebox("Sorry you don't have enough Septims.")
MiscObject Property GoldBase Auto
endif

And since it won't compile I can't check properties, and when I remove it, and click on the properties tab (and the RemoveItem bit) I for some reason can't add or edit properties (it shows up, but all of it's greyed out).

 

 

Edit:

 

Sorry for dropping into the subject. But since I have the same basic problem, I thought I'd use this thread instead of making a new one.

 

Have a look at the script I posted near the end of page 2. It shows where the property should be placed. Properties MUST be places OUTSIDE of any events or functions. It can't go inside the if statement. It can't even go inside of the event or function that the if block itself is inside of. If you post the entire script you've got, I can show you quickly where it should go. However, there's a much easier way. Instead of typing it in manually, just open the properties box for the script and add a new one that way. Then if it still doesn't work, show us the script you've got then.

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.

 

 

I did what your pic did (Since I have a similar problem) placed it at the beginning (before the if 'statement', before endIf, and after that.) All of them come up with this message.

 

Starting 1 compile threads for 1 files...
Compiling "TIF__04019D3D"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,0): no viable alternative at input 'MiscObject'
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D3D.psc(16,20): no viable alternative at input 'GoldBase'
No output generated for TIF__04019D3D, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__04019D3D

 

 

Here's my script as of now.

if (Game.GetPlayer().GetGoldAmount() >= 10000)

; lines to remove gold from player then adds key to player

Game.GetPlayer().RemoveItem(GoldBase, 50)

Game.AdvanceSkill ("Alchemy", 1.0)

Elseif (Game.GetPlayer().GetGoldAmount() < 10000)

; lines to remove gold from player then adds key to player

Debug.Messagebox("Sorry you don't have enough Septims.")

MiscObject Property GoldBase Auto

endif

And since it won't compile I can't check properties, and when I remove it, and click on the properties tab (and the RemoveItem bit) I for some reason can't add or edit properties (it shows up, but all of it's greyed out). 

Edit:

 

Sorry for dropping into the subject. But since I have the same basic problem, I thought I'd use this thread instead of making a new one.

 

Have a look at the script I posted near the end of page 2. It shows where the property should be placed. Properties MUST be places OUTSIDE of any events or functions. It can't go inside the if statement. It can't even go inside of the event or function that the if block itself is inside of. If you post the entire script you've got, I can show you quickly where it should go. However, there's a much easier way. Instead of typing it in manually, just open the properties box for the script and add a new one that way. Then if it still doesn't work, show us the script you've got then.

 

 

 

Okay. Added the GlobalVariable you had on Page 2.

 

The Error I get with that in it is:

 

Starting 1 compile threads for 1 files...
Compiling "TIF__04019D48"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D48.psc(17,0): no viable alternative at input 'GlobalVariable'
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__04019D48.psc(17,25): no viable alternative at input 'GoldBase'
No output generated for TIF__04019D48, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__04019D48
_____________
____________
The code attempt is:
if (Game.GetPlayer().GetGoldAmount() >= 10000)
	; lines to remove gold from player then adds key to player
	Game.GetPlayer().RemoveItem(GoldBase, 50)
	Game.AdvanceSkill ("Alchemy", 1.0)
Elseif (Game.GetPlayer().GetGoldAmount() < 10000)
	; lines to remove gold from player then adds key to player
	Debug.Messagebox("Sorry you don't have enough Septims.")
endif
GlobalVariable  Property GoldBase Auto

Basically a quickie fragment. Looks to see if player has X gold. if so removes it and when I get this fixed. will advance numerous Skills at once. With higher rates (through Dialog Choices) equaling a greater advancement of said Skills (and it should go to show in the above code, that I'm both new to scripting and not all that good at it atm XD. But I'm learning ^_^.)

Link to comment
Share on other sites

Remove the last line. Comment out line 3 (the on the removes 'goldbase'). Compile. Then, look for a button that says Properties and click it. Find where it says to add a new property. Name the new property "Gold001" and make sure its type is "MiscObject". Click okay and it should add the property. Click the property on the left and click auto fill on the right. Click okay to close the properties window. now uncomment the line that refers to goldbase and change goldbase to "Gold001" and try to compile again.

Link to comment
Share on other sites

Remove the last line. Comment out line 3 (the on the removes 'goldbase'). Compile. Then, look for a button that says Properties and click it. Find where it says to add a new property. Name the new property "Gold001" and make sure its type is "MiscObject". Click okay and it should add the property. Click the property on the left and click auto fill on the right. Click okay to close the properties window. now uncomment the line that refers to goldbase and change goldbase to "Gold001" and try to compile again.

 

 

I'll try that later today and let you know how it goes. Thanks for the reply though.

Link to comment
Share on other sites

property areas grey, and won't let me add to it.

Alright, then we'll need to go to the source.

 

Is this being done in a quest? If not, is it dialogue?

If this is a quest, then you'll need to go to the Scripts tab. There, you should be able to see a script that handles ALL script fragments from the quest stages. Select that script and open its properties. Add a new one like described before.

 

If this is for dialogue, then you'll have to let me know, because I don't know off-hand how to do that.

Link to comment
Share on other sites

It was in dialog. Although I might try questing it. Atm I'm just putting it on hold while I work on other parts of the mod that I can make some progess in (it leaves me feeling much less frustrated).

 

When I get back to that I'll repost. But I do want to thank you for your replies and your time. I appreciate it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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