pin two global variable

Discussion and feedback on Construct 2

Post » Tue Jun 28, 2016 8:19 am

https://
drive.google.com/open?id=0BxuM6uiMrxpqaHlCMktFbUdyLWM

see this and then exit the game and back again. you saw "amount" after 10 second subtract . and the "build time" (for exp is 28). the system don't calculation this 2 second of "build time".
I should pin this two variable together . when "amount" is 4 "build time " is 40 . and when "build time" go to 30 subtract 1 of "amount, "build time=10" subtract another one. and when go to 0 subtract another one.
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Tue Jun 28, 2016 12:30 pm

Dont store the amount. It is changing while offline. Buildtime can be negative !

On item 'time' get
set buildtime to max(0 , (ItemValue - awaytime))
set amount to (buildtime) - (round(buildtime/10) *10)
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jun 28, 2016 8:14 pm

thanks bro
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Wed Jun 29, 2016 2:34 pm

i set those you are said. "build time" is perfect but "amount" has problem.

when build time is (last number < 5) :
94 ,844 ,54, 1014 : "amount"= 4
23 , 2543 , 3 , 83 : "amount"= 3


when build time is (last number >= 5) :
99 , 1059, 729 : "amount"= -1
597, 67 , 337 , 4597 : "amount"= -3

when build time is (last number = 0) :
"amount"= 0
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Wed Jun 29, 2016 2:36 pm

99Instances2Go wrote:Dont store the amount. It is changing while offline. Buildtime can be negative !

On item 'time' get
set buildtime to max(0 , (ItemValue - awaytime))
set amount to (buildtime) - (round(buildtime/10) *10)




i set those you are said. "build time" is perfect but "amount" has problem.

when build time is (last number < 5) :
94 ,844 ,54, 1014 : "amount"= 4
23 , 2543 , 3 , 83 : "amount"= 3


when build time is (last number >= 5) :
99 , 1059, 729 : "amount"= -1
597, 67 , 337 , 4597 : "amount"= -3

when build time is (last number = 0) :
"amount"= 0
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Wed Jun 29, 2016 7:41 pm

The "on exist" triggers every tick, everything got calculated every tick. Because those things just are in the Local Storage = true.
I should have used ceil(), my error, forgot you made it zero based.
That 10 seconds trigger did things wrong, if the local storage returns a build time like 7 seconds (3 of 10 done previous time) it still took 10 seonds in stead of 7.

Hope i corrected everything in this, else yell.

https://www.dropbox.com/s/2051txbqsderb ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jun 29, 2016 10:13 pm

thanks for your help :)
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Thu Jun 30, 2016 2:41 pm

i test it but here is a problem and i can't fix it . when we start and click to buy and then exit the game and back again we don't have problem .
1: don't touch any thing and exit again for 10 seconds , when games open our total change , refresh game(or click play on C2) total return to true number.
2: don't touch any thing and refresh game the amount come back again, build time too.
i'm exporting to apk file and i'm testing on device (the problems had exist)

i try to say the system when build time = 0 ,set total = itemvalue + amount ,but this is have problem too.
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Thu Jun 30, 2016 3:22 pm

And with those exceptions in place ?

https://www.dropbox.com/s/5j3qvloug3nzi ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 30, 2016 9:18 pm

the problem is that : we set MaxWhileGone towice .
the first time we set amount value to it and the second time we set total amount + MaxWhileGone

you can see it when you set the MaxWhileGone to text. you can see then when amount value = 0 , MaxWhleGone is not zero . we should set MaxWhileGone to zero when device or browser refreshed. i used on start of layout but not working . and i change place of "on get: time with amount" not working again.
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Syazanie Amirin, Yahoo [Bot] and 9 guests