Jump to content

how to add and subtract Global variable's value for approval points through scripting?


LadyOfFrost

Recommended Posts

New to modding (and specifically scripting!) and I'm currently trying to make a follower mod. I'd like to have approval/disapproval points using global variables, but I don't know how to add and subtract the value only how to set it to a specific value. What I'd like is 0-100 value and then certain choices would add or subtract points to the value.

 

So for example if my GlobalVariable ID is Follower_Approval and I want it to add 5 to the already existing value, how would I go about this? Or is there another way to make an approval system work in an easier way?

Link to comment
Share on other sites

For Global, if in a script you have

GlobalVariable Property Follower_Approval Auto
Float Points  = 5.0

and it is filled with proper FormID in the script properties

One option is:
Follower_Approval.SetValue(Follower_Approval.GetValue() +  Points)

Not sure if this function is SKSE - and how old - but you can also:
Follower_Approval.Mod(Points)

I have seen a number of ways of handling such things.

Set up a faction, add player to it, and value is player's rank in that faction.

Set up a chest in some inaccessible location, and add stuff to it.  Item counts represent values. 

  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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