false problem

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

false problem

Postby FuzzyLogicBrain » Thu May 26, 2011 8:47 pm

if statements seem to have trouble with boolean. or am i doing it wrong?
Code: Select all
{scene.my.blah==false}?{e.this/geom.color=e.other/geom.color}:{}
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: false problem

Postby TC42 » Thu May 26, 2011 8:54 pm

That is why I use the original boolean-- 1s and 0s 8-)

Also, use color=e.geom.color, not e.this.color=e.geom.color
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: false problem

Postby electronicboy » Thu May 26, 2011 10:34 pm

try using := instead of ==

Generally when an if code dosnt work, that is the first thing i check as i dont understand the ='s and havnt got round to learning them :D
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: false problem

Postby FuzzyLogicBrain » Thu May 26, 2011 11:30 pm

electronicboy wrote:try using := instead of ==

Generally when an if code dosnt work, that is the first thing i check as i dont understand the ='s and havnt got round to learning them :D

hmmm..
TC42 wrote:That is why I use the original boolean-- 1s and 0s 8-)

Also, use color=e.geom.color, not e.this.color=e.geom.color

1s and 0s! duh i do that too :P what if it was the other object, not this object?
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: false problem

Postby Someone Else » Thu May 26, 2011 11:31 pm

You want this:
Code: Select all
{!scene.my.blah} ? {color = e.other.color} : {}


a = 2 means "Set the value of a equal to 2."
a == 2 means "Check if the value of a is 2."
a := 2 means "Create a new variable with identifier a and value 2."
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: false problem

Postby electronicboy » Fri May 27, 2011 1:10 am

Someone Else wrote:You want this:
Code: Select all
{!scene.my.blah} ? {color = e.other.color} : {}


a = 2 means "Set the value of a equal to 2."
a == 2 means "Check if the value of a is 2."
a := 2 means "Create a new variable with identifier a and value 2."


Thanks for telling me what they mean :)

And as you can tell, i havnt really learn much thyme :D
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: false problem

Postby Someone Else » Fri May 27, 2011 3:44 am

I'm actually not completely sure about :=, but you use friction := 2 in spawning, so I made a guess.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: false problem

Postby FuzzyLogicBrain » Fri May 27, 2011 10:57 am

but whats the (!) about?¡
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: false problem

Postby Someone Else » Fri May 27, 2011 9:51 pm

When put right before a boolean, ! means "not".

{collideWater} ? {} : {} means "if collideWater is true..."
{!collideWater} ? {} : {} means "if collideWater is not true, or false..."

    The full list of IF operators:
  • == means "If the values are equal"
  • != means "If the values are not equal"
  • >= means "If the first value is greater than or equal"
  • <= means "If the first value is less than or equal"
  • > means "If the first value is greater"
  • < means "If the first value is less"
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: false problem

Postby Chronos » Fri May 27, 2011 10:57 pm

Someone Else wrote:I'm actually not completely sure about :=, but you use friction := 2 in spawning, so I made a guess.

This has been explained so many times (mostly by me). := is ONLY used in spawning (well, creating new variables, actually, but that's what you do when you spawn something).
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: false problem

Postby FuzzyLogicBrain » Sat May 28, 2011 12:36 am

Someone Else wrote:When put right before a boolean, ! means "not".

{collideWater} ? {} : {} means "if collideWater is true..."
{!collideWater} ? {} : {} means "if collideWater is not true, or false..."

    The full list of IF operators:
  • == means "If the values are equal"
  • != means "If the values are not equal"
  • >= means "If the first value is greater than or equal"
  • <= means "If the first value is less than or equal"
  • > means "If the first value is greater"
  • < means "If the first value is less"

Oh snap! Thanks for the explantion!
{!badExplantion}?{compliment}:{troll}
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: false problem

Postby Someone Else » Sun May 29, 2011 5:30 pm

Thanks... though, actually, you want something more like
Code: Select all
scene.my.reply = {!scene.my.badExplanation} ? {"compliment"} : {"troll"}
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: false problem

Postby FuzzyLogicBrain » Sun May 29, 2011 6:55 pm

O-o Lol? Dude are you a perfectionist?
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: false problem

Postby Someone Else » Sun May 29, 2011 7:03 pm

Yes.

But this is off-topic.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: false problem

Postby FuzzyLogicBrain » Sun May 29, 2011 8:55 pm

no, this....... IS.......... SPAAARRRTAAA! yeah, so it is.
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 3 guests