How do I use a variable ind choose() or random()

Get help using Construct 2

Post » Tue Apr 08, 2014 8:00 pm

Hi there fellow constructors

quick question... is it possible to use a variable value as one of the numbers in expressions like random() or Choose() ?

for instance like:

globalnumer "SPAWN" = 10

blahh -> blah -> set animation frame to " random(0, SPAWN)


I've tried a few versions of this and can't get it to work . :/
Image
Get it on Google play or play on papio.nu
B
11
S
2
Posts: 79
Reputation: 786

Post » Tue Apr 08, 2014 8:28 pm

int(random(0,SPAWN+1))
(random doesn't include the top value - check the manual for details).
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Tue Apr 08, 2014 8:31 pm

int.... int.. int.. DAMNIT I knew that (sort of) :D Thanks a bunch !!!
Image
Get it on Google play or play on papio.nu
B
11
S
2
Posts: 79
Reputation: 786


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests