x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Combine 2 array elements into one array element

hi,

see pictures below the arrays are shown and their details .

i want to create an array of string type Called "NumLetts" and populate it with string elements : a1,b1,c1,d1....a2,b2,c2,d2 .....a8,b8,c8...h8 . ...

...populating them all by hand would be tedious , so what's the best way to go about automating the process ,??

i thought maybe creating 2 separate arrays one being of integer type called "Numbers" ,the other being string type called "Letters" , and populate the first with the integers 0,1,2...6,7,8 then populate the second one with strings a,b,c,d..g,h .

the next step would be to criss-cross combining each element from the 2 arrays into a new array of strings which is array "NumLetts" forming elements like a1,b1 ..g7..h8 . .and so ( how to do this i don't know i mean combining 2 elements of 2 arrays into 1 element in a new array .)

Thank you .

alt text

alt text

alt text

Product Version: UE 4.19
Tags:
leeters-array.jpg (107.9 kB)
numbers-array.jpg (116.1 kB)
more ▼

asked Jun 02 '18 at 10:58 PM in Blueprint Scripting

avatar image

Carter10
19 3 6 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Here you go. The automated version of the process. All you have to do is type "abcdefghijklmnopqrstuvwxyz" into the "Alphabet" variable and the computer will take care of the rest.

alt text

more ▼

answered Jun 03 '18 at 02:13 AM

avatar image

Nebula Games Inc
5.4k 28 9 14

avatar image Carter10 Jun 03 '18 at 03:57 AM

hi, Ohhhh...you are a genius , i can't thank you enough or give you back anything for this , you saved my life , i appreciated .

Though now the real issue for me or let's say a confusion rather( idon't know if it's even possible at all) :

when you get this array is stored in a variable "Num Letter Array" and you can reuse it as long as the button g is pressed , the point is you need the flow of events to make up the storage of this array .

Let's put it this way when you create a new array variable in the " Myblueprint" left side panel and populate it with elements ,initialize it, i should say, then it will be this every time you get it inside the graph it does not require something to fire it off ...

......and that's what i want , to turn the result of the automation you did into an array variable that behaves like a new one created so i can put it wherever i need without worrying about firing events to make it up again .

I came up with same results after a tedious approach and it is stored as yours in this array called "Final Store" see picture below , but only at run time i get the array populated , when i get out of play the array is empty .

alt text

avatar image Nebula Games Inc Jun 03 '18 at 04:17 AM

I honestly have no clue what you are trying to do now. What I created for you is a way to automate making a "string" of variables that goes "a1,b1,c1.....a2,b2,c2...etc" You can have that go as high as you would like depending on the "number" you increment up to and when you decide to cut it off. My basic set-up which is just showing you HOW to do something like this, it is by no means specific for your particular situation is just every click of the "G" key will add an entire alphabet string with the next incremented number. So hitting "G" twice will create an array from a1 through z2. This is entirely created in a blueprint so once you close the game, turn off the computer etc, exit the "play in editor" all the data goes away. It can be re-created at runtime the next time you hit G. You can have this automatically create an array at runtime without having to hit G, by using "event begin play" or some other event that doesn't require user input to fire this off. None of those options however will give you an "array" of data that you can use wherever you like once you close the editor. If you want an actual "array" of data saved that you can pull back out the next time you play the game like a high score you want to keep track of you are getting into save/load game data issues. You can definitely "save" the array you created to the hard drive and access it during another play using "save game to slot" and "load game from slot". But all of that will take a bunch more blueprinting to set-up. Again, very confusing post you just made but hopefully this answers something for you.

avatar image Nebula Games Inc Jun 03 '18 at 04:24 AM

Also you don't need to "press G" to use the array once it is created. Just drag the "array variable" created from the "G" button press out into the event graph and use it wherever you like in that blueprint. All the data is there, holding down G does nothing. Pressing G creates an additional string of data and adds it to the array. So you can use the array once you hit G the first time and it will have a list of strings from a1-z1. And by "use the array" I mean set up logic for it based on what you would want to do when the array is populated. There is absolutely no way to "populate the array" by automation and use it without running the code ie. "play in editor". If that is what you want then you absolutely have to manually enter the data. You can't ask for something to generate automated data if you don't turn on the automation which would be "playing" the game.

avatar image Carter10 Jun 04 '18 at 01:57 AM

..Yeah absolutely your latest comment sums it up that's what i was trying to do quote: "populate the array" by automation and use it without running the code " ,

it was dumb from me to think that i can store the result from the temporary automated array to a static initialized array that i can just get into the graph and find it populated as if it was by hand .

Thank you for you clarifications helping me wipe out the confusion about temporary variables.

i was planning to post these pictures for you to understand what i was trying to do but after your latest post there is no need for them :

alt text

alt text

alt text

alt text

alt text

avatar image Carter10 Jun 06 '18 at 12:40 AM

Hi,

One last thing how to tie this array alphanumeric to mesh pieces so i can reference them by a1.a2...h8. See this Posted Question instead : https://answers.unrealengine.com/questions/797123/numeric-index-to-alphanumeric-index.html .

So i moved from this post to a new posted question to keep things tighter .

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question