Jump to content

[Workshop] Decrease Happiness


Zorkaz

Recommended Posts

I assume you are modifying Actor Value in which case you should add an "s" to the beginning. sWorkshopRatingHappiness.

If directly trying to subtract doesn't work, how about trying:

 

Actor player = Game.getPlayer()

Float i = player.GetValue(sWorkshopRatingHappiness)

Float x = 20.0

 

player.SetValue(sWorkshopRatingHappiness, (i - x))

 

-----

 

Although, this *should* work:

Actor player = Game.getPlayer()

Float i = player.GetValue(sWorkshopRatingHappiness)

 

player.SetValue(sWorkshopRatingHappiness, (i -= 20))

 

Also, ConsoleUtil is a great F4SE plugin that lets you access the Console in various ways. If it still refuses to work, using this you can execute:

 

(EDIT: some typos)

 

ConsoleUtil.ExecuteCommand ("player.SetAV sWorkShopRatingHappiness " + (i - x))

or ("player.ModAV sWorkShopRatingHappiness -" + x)

Link to comment
Share on other sites

From my experience in general, AVs are troublesome with negatives, like you need Detrimental mgef and can't ADD negative modifier in OMODs. Maybe similar happens when workshop fetches a negative rating AV too and treats it as zero, even if tha's scripted processing? Just an assumption though.

Link to comment
Share on other sites

I'm using this on a workshop item. Sadly any script using actor values requires you to use an Actor. Hence a script can't directly alter the value on a workshop object.

 

It does show that the workshop happiness is going down, with a down arrow. But the value still stays 80 as before

Link to comment
Share on other sites

(6) The daily happiness change has a cap of 20% the desired change in value (WorkshopScript.happinessChangeMult). Example: it can take upto 17 WorkshopDailyUpdate cycle game days to slowly increase workshop happiness from base 50 to the capped 100 target.

Link to comment
Share on other sites

I haven't examinated the happiness calculation that well but "WorkshopBonusRatingHappiness = - 20" should work.

 

WorkshopScript:

updateData.totalHappiness = updateData.totalHappiness + updateData.bonusHappiness

The happiness calculation starts from line 958, WorkshopScript, function DailyUpdateConsumeResources.

 

Did you try placing a lot of these "depressive" workshop objects? An interior workshop might be better for testing, especially if it has less resources.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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