Announcement

Collapse
No announcement yet.

How do I check for a certain item in an array Index?

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

    How do I check for a certain item in an array Index?

    [IMG][/IMG]


    Having a little trouble getting my random item spawner to check for a certain index in the array. (check for a specific item). I would like my array to check to see if Item 4 gets spawned in the world so I can get the Print String to print out Yes the Noob has spawned in the Urn if the array spawns 4, or NO the noob is not if it spawns some other random item. I'm using a print string to see if the code actually works before I hook it up to the widget to display on the screen.

    Can someone here show me what nodes I need to put in to check the index to see if Item 4 has spawned?? As I don't know how to set up a branch check with an array index yet on my own so I'm asking if anyone here knows how to set the array check up. It only needs a few nodes, but I don't know what those nodes are that I need to pull out in order to get it to do the checking.

    The other thing I would also like to know how to do, (Optional), is set up a 1 in 200 chance of an
    certain item to spawn also in the array as well so I can spawn a rare item after a certain amount
    of spawns.

    I'm doing an RPG game.
    Last edited by tozan; 07-14-2017, 03:49 AM.

    #2
    I am not sure but you could put a branch afterwards and get displayname i think. And if text is equal to text = true.
    Or from the item array. If the spawned item is = to 4 then set it to true and print string with the spawned item connected to the printstring

    Comment


      #3
      And the optional thingy.
      I think there is a random integer within range or something like that. So you can put min 1 and max 200. And Get the output and check if it will get lets say it got 55 and put it to a branch to check if integer is equal to 55 then it wil be true

      Comment


        #4
        Originally posted by tozan View Post
        I'm doing an RPG game.
        I think what you need is something like this ( == equal class node), and select item4...


        then add a branch etc
        Attached Files
        Last edited by unit23; 07-14-2017, 04:16 AM.
        Reallusion Unreal Engine Community Manager / LEGENDS of EPICA [Twitter] [Facebook] [YouTube] [Vimeo]

        Comment


          #5
          Originally posted by tozan View Post
          The other thing I would also like to know how to do, (Optional), is set up a 1 in 200 chance of an
          certain item to spawn also in the array as well so I can spawn a rare item after a certain amount
          of spawns.
          These three should accomplish it:

          Click image for larger version

Name:	Untitled.png
Views:	1
Size:	76.7 KB
ID:	1131122

          Comment

          Working...
          X