true/false problem

About advanced scenes, and the Thyme scripting language used in Algodoo.

true/false problem

Postby drharvey » Thu Dec 03, 2009 3:57 pm

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 ?
drharvey
 
Posts: 2
Joined: Thu Dec 03, 2009 3:39 pm

Re: true/false problem

Postby RA2lover » Thu Dec 03, 2009 5:13 pm

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
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: true/false problem

Postby drharvey » Thu Dec 03, 2009 5:20 pm

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.
drharvey
 
Posts: 2
Joined: Thu Dec 03, 2009 3:39 pm

Re: true/false problem

Postby Kilinich » Thu Dec 03, 2009 8:26 pm

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"}
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests