Transfer array vars then have that var deleted?

Get help using Construct 2

Post » Mon Nov 17, 2014 4:15 am

I have a starting array, a list of character names, so they are text, not numbers.
I want to randomly choose a character name from this first array, then add that name to a new array.
I want to be able to do this many times throughout the game, without randomly choosing the same name twice.

Essentially, I want to randomly choose a name, add that name to a new list, and permanently delete it from the first array so it can never be picked again.

I've been reading array tutorials all day, and I haven't gotten a clear, clean way to do this.
Last edited by Gagaween on Mon Nov 17, 2014 8:57 pm, edited 1 time in total.
B
6
Posts: 12
Reputation: 274

Post » Mon Nov 17, 2014 8:57 pm

116 views and no one knows the answer?
Maybe my question isn't clear?

I want to have a pre-built array of character names.
I want to randomly choose a name from that array.
I then want to move that name to another, empty/new array.
I then want the name that was chosen to be permanently deleted from the original array so it can never be picked again.
B
6
Posts: 12
Reputation: 274

Post » Mon Nov 17, 2014 9:20 pm

Hope it helps
choose_random_names.capx


edit: slight mod
choose_random_name_2.capx
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Nov 17, 2014 9:57 pm

I will check these out right away.
Thank you!
B
6
Posts: 12
Reputation: 274

Post » Mon Nov 17, 2014 10:04 pm

Says I can't open these.
Your version is 187, mine is 184.
I only see 184 as the current updated version (I even re-installed to be sure).
B
6
Posts: 12
Reputation: 274

Post » Mon Nov 17, 2014 10:06 pm

oh it's the 187 beta version
https://www.scirra.com/construct2/releases/r187

here:
the relevant stuff is in event 5
the arrays are set to 0 width in the properties
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: JarkeyBacon, Shoda and 6 guests