Announcement

Collapse
No announcement yet.

ARRAY - FIND NODE - get ALL identicals values and not only the first of the array

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

  • ARRAY - FIND NODE - get ALL identicals values and not only the first of the array

    Hello. Sorry to disturb with this, but i can't find a solution.
    The "find array" node of the blueprint seems to only get the first value found of the array, and not all the other one.
    How could i get all thoses in a new array ?





  • #2
    here, my problem

    Comment


    • #3
      Create a function called "GetValueInArray" which takes two parameters in: One array of the type of your value and one variable of the type of your value. It also has one parameter out, an array of the type of your value.

      When you need to retrieve the values from your array, you call your newly created function, you pass it your array and the value you want to retrieve.

      In your function, you loop through the array passed as parameter, you check if the value of the array is equal to the value you're looking for. If so, you add it to an array created as a local variable. Once finished looping, you plug your local variable Array as the return value of your function.
      [WIP - Plugin] Multiplayer Combat Editor
      A-RPG Sacred Swords
      Youtube Tutorials

      Comment


      • #4
        Originally posted by Yun-Kun View Post
        Create a function called "GetValueInArray" which takes two parameters in: One array of the type of your value and one variable of the type of your value. It also has one parameter out, an array of the type of your value.

        When you need to retrieve the values from your array, you call your newly created function, you pass it your array and the value you want to retrieve.

        In your function, you loop through the array passed as parameter, you check if the value of the array is equal to the value you're looking for. If so, you add it to an array created as a local variable. Once finished looping, you plug your local variable Array as the return value of your function.


        Thanks so much for your time and your response. I finally get how "for each loop" works.
        I hope i made this function as you told me. Even if i add mistakes, this one is functional :

        Comment


        • #5
          To be a real function, i add a "clear array" node at the begining.
          Otherwhise the results of the first function, is added to the second one, the 1st + 2nd to the third etc...

          Comment


          • #6
            You can create a "Local Variable" which is a variable that only exists in this function and gets reset whenever the function is called again.

            In your case "ArrayLocal" would be the local variable.
            [WIP - Plugin] Multiplayer Combat Editor
            A-RPG Sacred Swords
            Youtube Tutorials

            Comment

            Working...
            X