[r95] Every choose(2, 6) Seconds

Bugs will be moved here once resolved.

Post » Sat Jun 16, 2012 7:39 am

This expression on event Every choose(2, 6) Seconds, it doesn't work, it only works 2 seconds as first value.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Sat Jun 16, 2012 8:37 am

Not sure what you mean by Every.
Might try int(tokenAt("2,6",int(random(1)),","))
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Jun 16, 2012 9:53 am

I'm sorry, i forgot to mention "System", there a pic what im talking about

B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Sat Jun 16, 2012 3:38 pm

I think it's expected since the choose(2,6) is evaluated each tick.
To hold during 6 seconds the choose(2,6) would have to return 6 each tick

You better do a

[code]Global number rate = 0
On Start of layout
-> Set rate to choose(2,6)
Every rate seconds
-> Set rate to choose(2,6)
-> do things[/code]
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Jun 16, 2012 4:08 pm

This is sort of a bug, Construct Classic would work as intended, but C2 doesn't. C2 will still evaluate the expression every tick, so it will more or less be "Every 2 seconds". @Yann's fix is the workaround. Will see if I can fix in C2 itself.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jun 16, 2012 4:33 pm

@Ashley, choose is very powerful ... i use it in my Compan360 project to generate random messages but i have notice something strange with safari which is not really a bug but a different way to "choose". If i use 2 instances of a same text object (second instance to create a shadow of the first instance object so with the same text) and set text to the object globally using choose("1","2","3") in safari the 2 instances of the text object can take different values on the same tick ! ... so i must put the choose result in a variable first and then associate variable to text to force the same value. This behaviour seems really safari specific ... but perhaps there is a way to embelled this temporary var use in C2 to provide the same way to choose to every browser ?naelian2012-06-16 16:50:31
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Sat Jun 16, 2012 4:40 pm

@naelian - have you tested other browsers? If it works the same in other browsers, it is not specific to Safari.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jun 16, 2012 4:52 pm

Yes, i never have to change my code using firefox or chrome or IE ... so i really think only safari do this ;-p ... but perhaps others browsers don't evaluate the choose function for each instances using a global approach on the first tick ... so it's not at all a safari bug but a lack in others browsers ;-p. In fact is not really important so you could "zap", it's just for users don't loosing time if experimenting the same issue.naelian2012-06-16 17:04:39
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Sat Jun 16, 2012 5:23 pm

@naelian - all browsers have very good standards-compliant javascript support, so this would really surprise me. I actually would think it works identically in all browsers and for some reason you've only spotted it in Safari. Still, if you think it's a bug make a new .capx showing it and make a new thread following the steps in 'how to report bugs' - sounds like a different issue to the one reported here.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jun 16, 2012 7:24 pm

Ok @ashley i will remove the variable use for safari behaviour and put a link toward this version with details in the good forum section ...
if i found no different behaviour with last C2 release between browsers i will simply apologize me here ;-p

I have already report bugs so i know how to do it (and refresh bug in firefox and safari link to invisible bottom layer :http://www.scirra.com/forum/r93-refresh-bug-safari-firefox_topic53120.html ...) ... but it's old bug is now corrected because you are good ;-pnaelian2012-06-16 19:37:50
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests