Announcement

Collapse
No announcement yet.

I need to spawn objects based on whats inside of an array.

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

    I need to spawn objects based on whats inside of an array.

    Hi there, This is my base inventory system thing.
    -I created an Object array, that is adds the objects the player traces to into the array" Try One MOO time"
    -Based off of this I Am using a special machine(From my game) that will spawn the the object based on what the array contains, using the "Contains Item" on my array node.(Shown Below)

    2 problems are:
    1:The item spawner only works once throughout the game and never works a second time. meaning i can spawn in either objects based on the first coin i picked up...But only once.

    2:On my actor array, look at contains items....There are none to pick from. So i have to use a "cast to Node" and get the object from that to plug into the "Contains Item Node" Is there a better way to do this?


    Click image for larger version

Name:	Fixed.png
Views:	2
Size:	395.6 KB
ID:	1144342

    #2
    I got you on this one.

    Just learnt it

    I need to boot UE4 and get some details for you

    Narg
    http://www.seven-mountains.eu/

    Comment


      #3
      Ok

      First up for me, my locations/vectors, here are 2 out of ten.

      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	56.9 KB
ID:	1066534

      Then put them in to 2 arrays are they are for different things for me.

      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	79.4 KB
ID:	1066535

      I set it up so they only spawn if the have stock, so the "Stock" array

      Set a Variable - Current Location Selling. set to 0 / +1 after each loop

      Set a branch, if 0 Stock then skips that section of the array

      I then got my Location Array and did the following.

      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	65.6 KB
ID:	1066536

      And in the end set Current Location Selling VAR back to 0 again.

      Narg
      Last edited by Narghile; 02-16-2015, 08:01 AM.
      http://www.seven-mountains.eu/

      Comment


        #4
        HI

        Also, I forgot to mention, when I destroyed, I found I needed to rebuild the arrays for some reason, but this was for widget and the data shown on the widgets.

        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	33.0 KB
ID:	1066537

        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	36.9 KB
ID:	1066538

        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	66.2 KB
ID:	1066539

        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	83.8 KB
ID:	1066540



        Narg
        Narg
        Last edited by Narghile; 02-16-2015, 07:59 AM.
        http://www.seven-mountains.eu/

        Comment


          #5
          okay well how did you add an object to the array? Since my adding objects to arrays are empty.Click image for larger version

Name:	Untitled.png
Views:	1
Size:	404.2 KB
ID:	1066557

          Comment


            #6
            Hi

            I would probably set an array for "References", when you run the loop you should be able to pull that reference from another array and spawn.

            Example, you have 4 items

            You have a bool on the branch depending on what you want to spawn.

            When the loop get the tick of approval, it spawns. Hopefully

            Not sure if this is what you are looking at or I may have it all wrong.

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	64.0 KB
ID:	1066605

            Narg
            http://www.seven-mountains.eu/

            Comment

            Working...
            X