loosen script

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

loosen script

Postby FuzzyLogicBrain » Fri Apr 29, 2011 5:51 pm

what is the on collide or on laser hit script, to loosen an 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: loosen script

Postby Someone Else » Fri Apr 29, 2011 9:47 pm

I don't think there is one. However, if there is, it would look like this:
e.geom.loosen
Why?
e.geom.liquefy (if I spelt it right) liquefies the object.
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: loosen script

Postby TC42 » Fri Apr 29, 2011 9:48 pm

You can try changing the density to +inf to glue, and the normal density to unglue.
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: loosen script

Postby FuzzyLogicBrain » Fri Apr 29, 2011 11:39 pm

Hm hm! I'm sorry, I didn't quite explain clearly enough, to loosen a geom from a HINGE, not glued to unglued. Sorry. :oops:
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: loosen script

Postby Dare » Sat Apr 30, 2011 3:12 am

Use scene.my.* variables to set a value for the impulse break limit of the hinge, then when the object is hit by the laser make the scene.my.* variable = 0, therefore instantly breaking the hinge.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: loosen script

Postby Someone Else » Sat Apr 30, 2011 4:30 am

That works. But it still doesn't quite give the same effect as Geometry Actions/Loosen.
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: loosen script

Postby Dare » Sat Apr 30, 2011 5:43 am

Someone Else wrote:That works. But it still doesn't quite give the same effect as Geometry Actions/Loosen.

Didn't you read his post? He wants to loosen it from a hinge.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: loosen script

Postby Someone Else » Sat Apr 30, 2011 6:19 am

I read the post.

I also want to access the Geom Actions / Loosen thing via Thyme.
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: loosen script

Postby FuzzyLogicBrain » Sat Apr 30, 2011 9:44 pm

the thing is, im am SPAWNING the hinge, several times over, so i cant have varibles. and i agree totally with Someone Else
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: loosen script

Postby TC42 » Sun May 01, 2011 2:00 am

so i cant have varibles

Yes, you can. I forget how to spawn with dynamic variables though. Doesn't it have something to do with geval?
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: loosen script

Postby Someone Else » Sun May 01, 2011 6:39 am

Try this code:
Code: Select all
    scene.my.hinge1 = +inf;
    scene.my.hinge2 = +inf;
    Scene.addBox({
        geomID := 28536;
        pos := [15.0, -5.0];
        size := [6.0, 2.0]
    });
    Scene.addBox({
        geomID := 28535;
        pos := [11.0, -5.0];
        size := [6.0, 2.0]
    });
    Scene.addBox({
        geomID := 28534;
        pos := [7.0, -5.0];
        size := [6.0, 2.0]
    });
    Scene.addHinge({
        geom0 := 28536;
        geom0pos := [-2.0, 0.0];
        geom1 := 28535;
        geom1pos := [2.0, 0.0];
        impulseLimit := {scene.my.hinge1};
        size := 0.7359517
    });
    Scene.addHinge({
        geom0 := 28535;
        geom0pos := [-2.0, 0.0];
        geom1 := 28534;
        geom1pos := [2.0, 0.0];
        impulseLimit := {scene.my.hinge2};
        size := 0.7359517
    })

It declares two scene.my variables,
spawns three boxes joined together by two hinges,
and the hinges have their individual impulse break limits set to the variables.

Note that if you run this code, then in another, later collision that still happens while the boxes are falling, set scene.my.hinge1 and scene.my.hinge2 to 0, the hinges will not instantly break. Instead, they will hold together until the boxes hit something. Then the hinges will break and the boxes will fly apart.
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: loosen script

Postby FuzzyLogicBrain » Sun May 01, 2011 8:43 pm

huurrr... no, thanks
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 1 guest