Object delete code
18 posts • Page 1 of 1
Object delete code
Setting density := 0 crashes phun/algodoo, but i want my object to delete!
solution: set airFrictionMult:= -inf and the object deletes itself instantly
solution: set airFrictionMult:= -inf and the object deletes itself instantly
"Never take life seriously, nobody gets out alive anyways"
-

laserfishy - Posts: 16
- Joined: Wed Jul 21, 2010 6:36 am
Re: Object delete code
it crashes? on my pc , both works 
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: Object delete code
I was told that density = 0 will crash Phun.
Setting just about anything equal to NaN will delete it, but may also delete some other things that you want to keep.
Setting just about anything equal to NaN will delete it, but may also delete some other things that you want to keep.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Object delete code
If you have algodoo, you can also set the inertiamultiplier to 0, hehehehehe. 
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: Object delete code
Density=0 indeed crashes phun.
AirFrictionMult=-inf deletes object, but that object exerts infinite force at anything it touches, deleting it too. Good way to avoid this is to set collideset to 0 first.
AirFrictionMult=-inf deletes object, but that object exerts infinite force at anything it touches, deleting it too. Good way to avoid this is to set collideset to 0 first.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Object delete code
okay didnt know started scripting after i bought algodoo so never tried some scripts in phun
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: Object delete code
*bump*
I dunno if this is common knowledge or not, but to delete a spring, set the length to +inf or -inf.
This will delete the spring without affecting anything else.
I dunno if this is common knowledge or not, but to delete a spring, set the length to +inf or -inf.
This will delete the spring without affecting anything else.
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: Object delete code
TC42 wrote:*bump*
![]()
I dunno if this is common knowledge or not, but to delete a spring, set the length to +inf or -inf.
This will delete the spring without affecting anything else.
I did not know of that. Thanks for sharing.
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Object delete code
Here another way to delete the object:
Works only in scenes without water but it does not effect other objects, even hinged or fixed to the deleted one.
Works only in scenes without water but it does not effect other objects, even hinged or fixed to the deleted one.
- Code: Select all
(e)=>{e.geom.liquify;scene.erasewater}
-

SyntaxError - Posts: 11
- Joined: Sat Apr 30, 2011 9:00 pm
Re: Object delete code
You can also delete by spawning two killers in the same place, or spawning one circle with infinite restitution and a script to change its collideSet and e.other.collideSet to 0. More complicated, but the best way I've found that should work in Phun in a vacuum.
I still haven't found a way to delete a hinge when there are no forces being acted upon it.
I still haven't found a way to delete a hinge when there are no forces being acted upon it.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Object delete code
Setting an objects density to NaN works as well 
-

bozbez - Posts: 149
- Joined: Tue Apr 12, 2011 7:01 pm
Re: Object delete code
Wow, there are really many ways to handle this.
Should be put into the tutorial page
Should be put into the tutorial page
-

SyntaxError - Posts: 11
- Joined: Sat Apr 30, 2011 9:00 pm
Re: Object delete code
I actually tried density = NaN and it didn't work. 
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Object delete code
Someone Else wrote:I actually tried density = NaN and it didn't work.
In Algodoo?
-

bozbez - Posts: 149
- Joined: Tue Apr 12, 2011 7:01 pm
Re: Object delete code
In Algodoo. Maybe I made it not work by saying collideSet = 0; density = NaN? So the circles couldn't collide and then spontaneously delete themselves?
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Object delete code
Didn't test it in Algodoo.
It shouldn't matter if you change the collideSet, but you don't need to.
It shouldn't matter if you change the collideSet, but you don't need to.
-

bozbez - Posts: 149
- Joined: Tue Apr 12, 2011 7:01 pm
Re: Object delete code
You don't use density = NaN for Algodoo, do you? I thought you used density = 0.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Object delete code
I tried and failed to use density = NaN because it should work in Phun.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
18 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests






