Announcement

Collapse
No announcement yet.

Only count trees in a Trace

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

    Only count trees in a Trace

    I need some logic help... I'm trying to count trees

    I can count all the items around the Player. I can get the string for each item. How can I filter the string so I only get entries containing "spruce"?

    These trees are a procedurally generated instance; counting Actors doesn't work.

    Ultimately, I want to be able to filter for specific items the user can type in as a string - "spruce", "stone", "house" etc.
    Attached Files
    LinkedIn | Insta | YouTube | SoundCloud | valkyrie-sound.com | Sound Design, Composition, Production

    #2
    Originally posted by Valkyrie_Sound View Post
    I need some logic help... I'm trying to count trees

    I can count all the items around the Player. I can get the string for each item. How can I filter the string so I only get entries containing "spruce"?

    These trees are a procedurally generated instance; counting Actors doesn't work.

    Ultimately, I want to be able to filter for specific items the user can type in as a string - "spruce", "stone", "house" etc.
    I see you have 'contains' there, what's wrong with that?

    Comment


      #3
      That's the bit I was stuck on - you can get a True / False result if a scanned item contains "spruce" in its name string... but how do you count how many times that is True or False?

      I was looking to do something like this: "IF string contains "spruce" THEN +1 to Total" But once I'd gotten the True / False result I couldn't figure how to count it...

      I've managed to get around it with help from Loraash on Reddit which lets me apply a filter using custom collision.

      If you know how to do this with the Boolean output from the contains node though I'd appreciate knowing how could be useful for other projects!
      LinkedIn | Insta | YouTube | SoundCloud | valkyrie-sound.com | Sound Design, Composition, Production

      Comment


        #4
        Originally posted by Valkyrie_Sound View Post
        That's the bit I was stuck on - you can get a True / False result if a scanned item contains "spruce" in its name string... but how do you count how many times that is True or False?

        I was looking to do something like this: "IF string contains "spruce" THEN +1 to Total" But once I'd gotten the True / False result I couldn't figure how to count it...

        I've managed to get around it with help from Loraash on Reddit which lets me apply a filter using custom collision.

        If you know how to do this with the Boolean output from the contains node though I'd appreciate knowing how could be useful for other projects!
        I can count 'cubes', for instance, like this:

        Click image for larger version

Name:	countcubes.JPG
Views:	34
Size:	267.5 KB
ID:	1772136

        Comment

        Working...
        X