Jump to content

[LE] Completely confused between "ModActorValue" vs "SetActorValue" !.


Recommended Posts

I have three simple power up station that is supposed to add 10 point of permanent Health or Stamina or Magicka, but i'm confused between the "ModActorValue" and "SetActorValue" and although i had read a bounch of stuff online, it only resulted in more confusion...
My issue is that when i change this line:
ActorRef.SetActorValue(sWorkingAV, ActorRef.GetBaseActorValue(sWorkingAV) + fActorValueBoost)
Health - Stamina - Magicka will go from 100 to 110.
TO
ActorRef.ModAV(sWorkingAV, ActorRef.GetBaseActorValue(sWorkingAV) + fActorValueBoost)
Health - Stamina - Magicka will go from 100 to 210.
* The set value for a both is 10.
So what's the difference, and what should i actually use ?.
Plus i read in a lot of post that you should never use "ModActorValue", is that true and why ?.
Many thanks in advanced !

 

Link to comment
Share on other sites

I don't know if setav and modav work differently but you should never use forceav because you can't stack more buffs on it

I know about "ForceAV"... my issue is with setav and modav.

Link to comment
Share on other sites

ModAV modifies by that amount where SetAV sets it to that amount.

 

In your examples you would use the following to get 110:

ActorRef.SetActorValue(sWorkingAV, ActorRef.GetBaseActorValue(sWorkingAV) + fActorValueBoost)
 
ActorRef.ModAV(sWorkingAV, fActorValueBoost)

Set requires taking the base and adding what you want. While Mod just adds what you want. Mod is probably best in the long run.

 

 

 

EDIT: typo fix

Edited by IsharaMeradin
Link to comment
Share on other sites

ModAV modifies by that amount where SetAV sets it to that amount.

 

In your examples you would use the following to get 110:

ActorRef.SetActorValue(sWorkingAV, ActorRef.GetBaseActorValue(sWorkingAV) + fActorValueBoost)
 
ActorRef.ModAV(sWorkingAV, fActorValueBoost)

Set requires taking the base and adding what you want. While Mod just adds what you want. Mod is probably best in the long run.

 

 

 

EDIT: typo fix

So more or less, is actually the same...
Your advice is to use "ModAV" intead of "SetActorValue" ?.
* I saw the mistake after i ate (sWorkingAV, fActorValueBoost).
Thanks for replying !.
Edited by maxarturo
Link to comment
Share on other sites

ModValue is also thread safe. SetActorValue changes the base value, so keep that in mind.

I read this also in another post "ModValue is also thread safe", so i end up using "ModAV".
What i don't understand is why i keep finding post suggesting that you should never use "ModActorValue" in your script, none of those post justify the reason behind it, they just warn you.
Thanks for your reply !.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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