Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Where do player stat equations go?

Really dumb question but where do the equations for a player's stats go? Is it just tied to the setter? Say for example I have Attack Speed stat that has a Base of 1x and a Modifier of +20%. The final attack speed would simply be 1 + 0.2 = 1.2x speed. Would I have a third variable AttackSpeedFinal that gets set whenever AttackSpeedBase OR AttackSpeedModifier gets changed?

Product Version: UE 4.18
more ▼

asked Feb 09 '18 at 09:04 PM in Blueprint Scripting

avatar image

23 1 3 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You could do that or you could do the calculation on demand (when you need the final value). If it's not too complex and not running every tick, it shouldn't put too much of a load on the CPU.

To calculate it once and use the result on demand, create a function that sets each stat rather than setting the variables directly. There you can also add functionality that updates any dependent variables using the calculation. Then you can set a stat from anywhere and be sure the final calculations will be correct.

more ▼

answered Feb 09 '18 at 09:10 PM

avatar image

4.5k 32 79 42

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question