# Random randomness

Get help using Construct 2

### » Sun May 20, 2012 9:14 pm

Your capx is messed up as it is not choosing a random house... You are doing something about letters.
Maybe it would be better if you told us exactly what you want to accomplish.
If you want him to appear at a random house, use the capx I sent you. What about mine isn't working for you?
To choose from a set of parameters, use the choose() function.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

### » Sun May 20, 2012 9:21 pm

yeah sorry ive not made it very clear

what i want is the post man to go about delivering his letters, so six in this one.
i want then to be able to spawn an object at a random drop off, so between 1-6 in the letters variable

(the last capx i posted was the wrong one, ill try and find it....)

here we go

example2
darksteeldanger2012-05-20 21:27:48
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

### » Sun May 20, 2012 9:44 pm

You want to generate the random number once at the start of the layout. The way you're doing it, you're comparing letters to a new random number every tick.

postman.capx
B
53
S
28
G
18
Posts: 1,520
Reputation: 24,905

### » Mon May 21, 2012 7:16 am

@ ramones

yeah so how do i generate that number? your capx wont work for me im getting document error
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

### » Mon May 21, 2012 7:52 am

ok a good nights sleep and a fresh pair of eyes later, ive managed to sort it out.....thanks to everyone that helped me

heres what i did in the end.....example3
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

### » Mon May 21, 2012 7:52 am

I don't know what you're trying to do. Here's a 'random' explanation: int(random(5)) gives you a number between 0 and 4. int(random(5,10)) will give you 5 to 9

Your events doesn't make sense to me

EDIT: we posted at the same time >_<
Oh now I get what you wanted to do7Soul2012-05-21 07:54:09
B
82
S
21
G
15
Posts: 1,038
Reputation: 15,092

### » Mon May 21, 2012 10:24 am

its was really simple in the end. it just took me ages to get my head round it
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Previous