Question: Is there is something like and Array but can hold different types of data?

Hi All

Is there something like an array to hold different types of data.

If so, can I use it like an array?

Example:

i23^cimgpsh_orig.png

Depending on what you’re trying to do, you could use a struct for that.

I have for example 50 important people that I need to store this data for easy access later.

It sounds like what you’re after is a struct. You can set each of those fields inside the struct, and then in your BP, make an array of that struct, so you can store as many records as you want.

That sounds what I would want.

Except that I can only call Make/Break/Set - No Get

I think I can run off Make

Nope.

I may not be aware on how to do this. How could I fill this with random data - ignore names.

I thought about a loop, but no input for numbers for the array.

My Struct

b762f854c708fd2e73a7e66fcfefa59bbbbd4d6a.jpeg

Hello,

Make is to set the values in for every slot in your struct.
To “get” values from your struct you’ll first want to break it to be able to access every value in the struct. The break struct node contains all the actual data inside your struct.

To fill it with random data you’d want to use a loop indeed. In the body you’ll “make” the struct stored in that index of the array. If you make your array based on a random integer to get a random size for the array, you should first add a new element to the array in the body loop, just before the “make” struct. Please note I didn’t test this myself but this is how i’d do it.

Could you run me through exactly what you’re trying to do here? I have a bit of an Idea but I’m not sure I’m there 100%. Are you trying to store a set of predefined gladiator stats that the game will look up at runtime? Or are you trying to have the game randomly generate a set of gladiator stats on runtime?

OK

For testing I want to randomly fill data.

I was confused before, when I could not “GET” the struct.

Later on I would like to preset the data, for example, a New slave / Gladiator - to the one with all the glory.

In the game there would be over 300-400 gladiators I would need and randomly generate new ones as the old ones die.

This data would need to be called at any .

Okay, so for testing you can get away with attaching some “random float in range” nodes to each field input, and attaching the result to an “Add” array node. Put all this inside of a for each loop and you’ll have an array of randomised gladiators whenever the script is run.

Cheers

How do I make this array. I am seem to making them incorrectly .Any pics would help.

Here’s the basic setup.

A quick way to make an array var out of your struct is to just use the “Promote to variable” shortcut when dragging from the “add” node.

Just what i said earlier:

:slight_smile:

Thanks all

This will come in handy.

Also, Material Parameter Collections may be helpful for you to know about and make use of. Great tutorial thread here: Material Parameter Collections - Announcements and Releases - Unreal Engine Forums

OK, seems to be working for now.

Is there now away I can get my Name STRUT and generate random names?

Regards

like “**Make **an array and pick a **random **entry”? :wink:

Hi, cheers

Made Array

869b6fbd3c71dc78c1221e45b824865244a47524.jpeg

Thought this might work, but output is still Blue and will not plug into “Text” Field

3553f58996c57da6cd5dd9b11043aabc948f5d0f.jpeg

Regards