Problem with airFrictionMult = NaN

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

Problem with airFrictionMult = NaN

Postby art-e-fact » Sat Nov 21, 2009 4:36 pm

The following script spawns circles that should disappear after some collisions through "e.this.airFrictionMult = NaN". This does seem to work fine, but at the same time every loose or hinged object, regardless if it is in the same collisiongroup or not, does disapoear too. Is there any way to avoid this?

Code: Select all
(e)=>{
     scene.addCircle({         
          color := [0.2, 0.2, 0.2, 0.0];         
          size := 0.5;         
          density := 0.005;         
          pos := e.pos;         
          collideSet := 1;         
          controllerAcc := 0.05;         
          OnCollide := (E)=>{{controlleracc > 0.01} ? {controlleracc = controlleracc - 0.01} : {e.this.airFrictionMult = NaN}}})}
art-e-fact
 
Posts: 2
Joined: Tue Sep 01, 2009 12:11 pm

Re: Problem with airFrictionMult = NaN

Postby standardtoaster » Sat Nov 21, 2009 5:20 pm

AFAIK this is a known bug. Instead of using airFrictionMult try using density = 0.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Problem with airFrictionMult = NaN

Postby art-e-fact » Sat Nov 21, 2009 9:00 pm

That works great, thanks alot. :thumbup:
art-e-fact
 
Posts: 2
Joined: Tue Sep 01, 2009 12:11 pm

Re: Problem with airFrictionMult = NaN

Postby standardtoaster » Sat Nov 21, 2009 10:05 pm

Your welcome. Although, I don't know why airFrictionMult set to NaN delets everything that isn't attached to the background. :|
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Problem with airFrictionMult = NaN

Postby link145632 » Wed Nov 25, 2009 7:41 pm

well if im correct this makes the air kinda go crazy because phun reads NAN as 0 and it is a irregular number, as so it doesent know what to do and causes it to displace evreything intiul it gets to the "black border of death" ;)
HYDRO THYMER!
link145632
 
Posts: 26
Joined: Thu Sep 24, 2009 12:24 am
Location: Catching waves on the internet

Re: Problem with airFrictionMult = NaN

Postby RA2lover » Mon Nov 30, 2009 1:15 pm

nope. you can avoid it by having it to have its collision group removed before setting airfrictionmult to NaN...
but remember air needs to be on for it to work.
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: Problem with airFrictionMult = NaN

Postby KarateBrot » Mon Nov 30, 2009 2:13 pm

link145632 wrote:well if im correct this makes the air kinda go crazy because phun reads NAN as 0 and it is a irregular number, as so it doesent know what to do and causes it to displace evreything intiul it gets to the "black border of death" ;)


NaN isn't read as 0 in Phun or Algodoo. NaN is a defined value. It's the short form for "not a number". For example you get NaN if you divide integer values with 0 for example 3/0 = NaN.
If airfrictionmult is 0 the geometry is just not affected by air friction.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Problem with airFrictionMult = NaN

Postby RA2lover » Mon Nov 30, 2009 5:09 pm

but is still affected by air buoyancy
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


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests

cron