true/false problem
4 posts • Page 1 of 1
true/false problem
Hi !
I know that it's basic but I've still got problem with it...
So can anybody explain to me this true/false thing on simple example ?
I have scene.my.var = 0
on colide with one box it changes to 1
on colide with second box it changes to 2
And I need status display on the other box. If it's 1 it should display for example "yes", for 2: "no".
So I type something like this: scene.my.stat = scene.my.var == 1 ? {"yes"} : {"no"};
But status on the third box isn't refreshing. To see this change I have to type this function again manually... So where is my problem ?
I know that it's basic but I've still got problem with it...
So can anybody explain to me this true/false thing on simple example ?
I have scene.my.var = 0
on colide with one box it changes to 1
on colide with second box it changes to 2
And I need status display on the other box. If it's 1 it should display for example "yes", for 2: "no".
So I type something like this: scene.my.stat = scene.my.var == 1 ? {"yes"} : {"no"};
But status on the third box isn't refreshing. To see this change I have to type this function again manually... So where is my problem ?
- drharvey
- Posts: 2
- Joined: Thu Dec 03, 2009 3:39 pm
Re: true/false problem
you can avoid using if-statements by making the boxes to change the status too.
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-
RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
Re: true/false problem
Ok, I just figured out where was the problem... I should type function in "onColide" not in console. Now my status is refreshing
Sorry for bothering.
Sorry for bothering.
- drharvey
- Posts: 2
- Joined: Thu Dec 03, 2009 3:39 pm
Re: true/false problem
drharvey wrote:Hi !
And I need status display on the other box. If it's 1 it should display for example "yes", for 2: "no".
So I type something like this: scene.my.stat = scene.my.var == 1 ? {"yes"} : {"no"};
But status on the third box isn't refreshing. To see this change I have to type this function again manually... So where is my problem ?
Incorrect code. Use this: scene.my.stat = {scene.my.var == 1 ? "yes" : "no"}
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests