Announcement

Collapse
No announcement yet.

Basic math Blueprint func library - needed?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Basic math Blueprint func library - needed?

    Hi guys,

    I may have just overlooked it in the Blueprints, but I yet have not found any functions that would let us operate variables values in a simple manner.
    E.g. do this
    Click image for larger version

Name:	gvsdfvasldjf.JPG
Views:	1
Size:	21.7 KB
ID:	1137706

    instead of this

    Click image for larger version

Name:	khjkhk].JPG
Views:	1
Size:	33.8 KB
ID:	1137707

    Which is for me personally very time-saving. I created a BP func library for increment/decrement and compound operators and use it in my projects. Did I miss them somewhere, or if not, do you think it would be useful to release this BP func library as marketplace asset?

    Edit: to clearify, these are most of the funcs you would get in the library:
    +=, -=, /=, *=, ++, --, toggle bool (yes, even that. Did not find any native func which does that, lol), and also logic operators for numeric types.
    All of that would be for ints and floats. Some of compound operators may also be useful for strings, so I might add those as well.
    7
    Yes
    57.14%
    4
    No
    42.86%
    3
    Last edited by Lordink; 08-23-2014, 01:10 PM. Reason: Explanation added.
    Core i7-8700K @ 4.8 GHz
    2x ASUS GTX 970 STRIX SLI @ 1450/7600
    Z370 AORUS Gaming 7
    32 GB G.Skill Trident DDR4-3200
    EVGA 850 G2
    850 Evo 500 + 840 Evo 256

    #2
    The problem with things like this is that it's only setting "Score", as of currently there's no way to define the variable that is set within a given function. Because of this you could only use it for 1 variable and even then have to go through and change the variable it's setting. In the long term for something as simple maths its quicker just to get the set and the math modifier.
    Looking for blueprint tutorials? Then visit my blog... voxagon

    Comment


      #3
      Actually, no. The functions I am using set variable by reference, which means it would modify any variable you send them.
      So, no, it is not quicker, and I sped up my own work with bp math quite a lot with those functions.

      But, there is a bottom line. You can by accident modify the value of something that is part of native function, e.g.
      Click image for larger version

Name:	drgsdgdr.JPG
Views:	1
Size:	32.7 KB
ID:	1053857

      Have not tried that yet, it should actually work, but is odd, as it brings to this code side effects and makes the language not-so 'pure' in terms of programming style. But that's the cost.
      Last edited by Lordink; 08-23-2014, 01:57 PM.
      Core i7-8700K @ 4.8 GHz
      2x ASUS GTX 970 STRIX SLI @ 1450/7600
      Z370 AORUS Gaming 7
      32 GB G.Skill Trident DDR4-3200
      EVGA 850 G2
      850 Evo 500 + 840 Evo 256

      Comment

      Working...
      X