How do I Copy a random value from a column and add it

Get help using Construct 2

Post » Sun Jul 06, 2014 6:27 pm

I am making a game which uses a lot of attributes for different people.

I have set up the arrays I am just trying to randomize values and random generate names. I have made an array consisting of 100 first names and 100 last names but having problems of copying a random name from the first array to another array.

Any help would be great not really used arrays much and am struggling with trying to get the randomization I want.

Thanks
B
5
S
1
Posts: 37
Reputation: 449

Post » Mon Jul 07, 2014 7:44 pm

First off, have you read Arrays for Beginners? (https://www.scirra.com/tutorials/307/ar ... -beginners). It has everything you need to know to create, populate, and retrieve values from arrays.

Second I don't follow the question as you say you're trying to copy a random name from the first array to another array. You can use the firstnames.At() to get the first name value and copy anywhere you want (even using the Random() function to get the value).

If you can post a screenshot or a better description of what you're trying to do that might help more to answer the question (if you don't find the answer on the Arrays for Beginners tutorial page).
B
17
S
5
G
2
Posts: 39
Reputation: 1,846

Post » Wed Jul 09, 2014 9:14 am

Well basically I wanted to make a random name generator with a first and last name. I thought I could do it with an array and just got it to choose a random name of the list but it's not worked how if thought it would.
B
5
S
1
Posts: 37
Reputation: 449

Post » Wed Jul 09, 2014 9:50 am

Quick example. Ignore start of layout stuff that is just a quick way for me to populate the array with names.

randomnamesfromarray.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests