Jump to content

Problem with Papyrus script...


DanielUA

Recommended Posts

I want to edit LoveInterestFINScript. Here it is

 

  Reveal hidden contents

 

What I want to do is to change line

Int GoldEarnedAmount = 100

to

Int GoldEarnedAmount = Utility.RandomInt(15, 35)

But when I try to compile it I have a mistake

  Quote

C:\Program Files\steam\steamapps\common\skyrim\Data\Scripts\Source\LoveInterestFINScript.psc(10,23): no viable alternative at input 'Utility'
C:\Program Files\steam\steamapps\common\skyrim\Data\Scripts\Source\LoveInterestFINScript.psc(10,30): required (...)+ loop did not match anything at input '.'
C:\Program Files\steam\steamapps\common\skyrim\Data\Scripts\Source\LoveInterestFINScript.psc(10,4): Unknown user flag Utility

 

Can anyone fix it to me?


 

Link to comment
Share on other sites

You can't call a function--like Utility.RandomInt--outside of another function or event. So in this case you'd need to do what you want inside the OnUpdateGameTime() event block. The simplest way would be remove the line about GoldEarnedAmount from the top of the script and move it down to just above the line where it gets used...

 

MarriageGoldEarned.SetValue(MarriageGoldEarned.Value + GoldEarnedAmount)
...like so...

 

Int GoldEarnedAmount = Utility.RandomInt(15, 35)
MarriageGoldEarned.SetValue(MarriageGoldEarned.Value + GoldEarnedAmount)
Or even just combine them and do

 

MarriageGoldEarned.SetValue(MarriageGoldEarned.Value + Utility.RandomInt(15, 35))
Link to comment
Share on other sites

  • Recently Browsing   0 members

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