Announcement

Collapse
No announcement yet.

Help: Structures

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

    Help: Structures

    Hi All

    I have made a strut out of 5 INTs. Now can I use that Strut in different BPs, or do I need a different Strut for each BP.

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	27.1 KB
ID:	1143816

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	48.7 KB
ID:	1143817

    Regards

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


    #2
    You can use the struct in any blueprint, but it won't retain it's values across blueprints, it's only the structure itself. I'm not sure why you would want to do that though, as there isn't much reason to use a struct for 5 ints since an array does the job. What are you actually doing with that struct?

    Comment


      #3
      Hi Mos

      Thanks again

      What I am looking at is:

      1) 5 produce (for testing)
      2) 5 (x2) widgets, 5 for buying and 5 for selling.
      3) I want to work out how many want to buy and sell.
      4) Work out which one wants to buy and sell
      5) Produce a 3D widget that will show that produce to the player.

      I can make the 3D Widget without an issue, it is just working out, what is up for sale, or what needs to be bought.

      This would run of variables, such as;

      The store is full or we need stock extra quickly.

      This would then relay down to price and availability.

      Regards

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

      Comment


        #4
        I might of worked it out "In my head"

        From a Each loop / Array Index, could I put a Bool to say yes or no.

        Thus at the end, Bool 1 could be yes or Bool 2 could be no?

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

        Comment


          #5
          You can create a variable of your struct type in any BP. To communicate it between different BP you can pass it as a regular parameter (float, int, object reference).
          If you want to have a single instance of your struct that can be reference by other objects. Add it as a variable to game mode blueprint for example and let the other BP's access it directly or using get/set functions.
          Youtube Channel

          Comment

          Working...
          X