Random not being Random

For questions about using Classic.

Post » Fri Feb 19, 2010 8:40 am

Hi people, it's me again!

I've got a little problem with the System Compare Random thing.
See here:



For some reason, nothing is happening when all conditions are met.
I deleted the "Random(1) equal to 0" Condition just to see what would happen and then everything in that one event sheet strangely works.

The basic Idea is to have the player scream in different ways each time he dies, that's why I tried doing it with the Random thing in the System Compare condition, but it's not working for some reason, even though it should according to this post: [url:2q6drbyc]http://www.scirra.com/forum/viewtopic.php?f=2&t=5456&hilit=Random#p43439[/url:2q6drbyc]

Does anyone have any ideas? Help would greatly be appreciated!

Thank you. :D

Regards,

Mr. Snoooley
B
3
G
2
Posts: 67
Reputation: 809

Post » Fri Feb 19, 2010 8:50 am

Random(1) will only return zero. You want to use random(2) to get 0 and 1. It generates a number between zero and given parameter, excluding the parameter itself, as the zero counts as a number too.

Like random(3) picks a random integer number from the 0,1,2 range.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Feb 19, 2010 9:25 am

Oops, stupid me. >_>

Works fine now, big thanks kind sir!

Regards,

Mr. Snooley
B
3
G
2
Posts: 67
Reputation: 809


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests