variable problem

Discussion and feedback on Construct 2

Post » Sat Feb 01, 2014 9:57 pm

I could not compare the variables.
for example,

Touch On Touched obj
    System variable1>6        Go to layout "game"
    System else               sprite1 Set visible


but it does not work. everytime it goes to game. value of variable1 does not matter.

How can i solve this problem?
B
11
S
3
Posts: 56
Reputation: 893

Post » Sat Feb 01, 2014 9:59 pm

actually, it does not work on mobile. it works on PC.
I export it with cocoonjs.
I guess after cocoon , it happens. but I m not sure.
B
11
S
3
Posts: 56
Reputation: 893

Post » Sun Feb 02, 2014 8:46 pm

??
B
11
S
3
Posts: 56
Reputation: 893

Post » Sun Feb 02, 2014 9:26 pm

@suatozkan1987, well, you're not giving us much information to go on. Looking at the code snippet you shared, it should definitely work on any platform. So, I'm pretty sure that you have a bug somewhere else...

If you would like more help, then sharing a CAPX might work, or at least more code.
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Mon Feb 03, 2014 7:06 am

Hello again:) problem code is in the circle .
everytime it goes to layout'Oyun4', even lev4<6.
B
11
S
3
Posts: 56
Reputation: 893

Post » Mon Feb 03, 2014 7:13 am

currentlevel = 3

the < 6 is always true, as the value only triggers when its 3. (its a sub of the currentlevel = 3)

The else should tigger when its bigger then 6, but that will never happen seeing as currentlevel is always three when it gets there.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Mon Feb 03, 2014 7:18 am

actually it works on computer(run on Construct 2). but after cocoon, it does not work. export with cocoon and run with cocoon launcher at iphone 5 , lev4<6 condition is does not work
B
11
S
3
Posts: 56
Reputation: 893

Post » Mon Feb 03, 2014 7:22 am

How is the content of Lev4 build ?

and are both int()'s   ?

Perhaps check what datatypees are in there.

Like, it will not work when you are trying to compare a text to an int.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Mon Feb 03, 2014 7:25 am

lev4 is number.
B
11
S
3
Posts: 56
Reputation: 893

Post » Mon Feb 03, 2014 7:30 am

[QUOTE=suatozkan1987] lev4 is number.[/QUOTE]


Then there must be something in your code causing the problem, might be an ideaa to post a link to a capx.

Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Niespor, warmty and 12 guests