Quote: "I have no idea what you are trying to do with that code.
"
Neither do i.
No really, what i am trying to do in its simplest form is make something that is a UDT array, not pick its own number.
So i set up 6 people for example. They all number 1 - 6.
Eventually at some point person 4 is going to decide he wants to kick the crap out of someone. That person cant be himself, that would just be daft. So he has to pick a number that isnt him.
The way i did it initially wasnt good enough as it went into a loop and that paused the game for a split second, something which i do not want.
What i did was put it in a repeat until loop.
Pick a random number and keep repeating it until person(a).number is NOT the random number that is chosen. When this occurs that number will be the sufficient choice.
Now using that array in my last bit of code my idea was much more simple than moving bits of the array around everywhere, im not sure why i would do that.
Basically if i can get it to randomise 2 numbers then the first one should be enough, if it matches the person number then use the second number instead. Only problem with this is it could pick 4 twice. Now using what i thought you were telling me was to pick a random number out of the array then populate an array with it.
Then delete that number from the array so in no way shape or form will that number be duplicated.
So now i have one array with two completely different numbers.
Now the above formula works. Is the first element in the aarray equal to person(a).number? Yes then pick the second because it wont be, if it isnt then pick the first element of that array.
Thats what i thought anyway, but i am having trouble in general with it because i think i have the idea nailed down but the implimentation isnt right.
I think i got the impression of this from the
Array1(10) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Array2((2) 0,0 (or empty i suppose, just use array insert at bottom to fill it)
Pick a random number, delete from array (it picks 8)
Array1(9) 1, 2, 3, 4, 5, 6, 7, 9, 10
Array2(2) 8, 0
Pick another number from the above (it picks 5)
Array1(8), 1, 2, 3, 4, 6, 7, 9, 10
Array2(2), 8, 5
Now is the person(a).number equal to the first element? Yes then use the second, no then use the first.
Is this what you were trying to say?