Erase Water Drops onCollide

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

Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 12:59 pm

Hi guys, need help with water drops:
The goal is to delete every water drop when it collides with object, but killer-object's script
Code: Select all
e.other.density := 0;

seems doesn't affect water and
Code: Select all
scene.erasewater

just deletes water from all scene.. :(
any ideas?
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby Kilinich » Mon Jul 04, 2011 1:31 pm

"killer" object, collided only with water ;)
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 1:45 pm

i've tried that, in that case other scripts, from the 'killer' object won't fire.. :cry:
i'm making an engine model, and everything was going not bad, except i can't make it consume fuel :D so one drop of fuel makes to much explosions and ruins all cylinder cycle..
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby Kilinich » Mon Jul 04, 2011 4:16 pm

the only workaround I see is to use circles instead of water :(
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Erase Water Drops onCollide

Postby bozbez » Mon Jul 04, 2011 6:08 pm

Alternatively, you could check the 'killer' box in the materiel menu, or i have missed a vital point because i read the topic too quickly.
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Erase Water Drops onCollide

Postby Gear97 » Mon Jul 04, 2011 8:10 pm

Sorry if missed something, but what about using a killer object to delete the water drops and make the rest of the things "imortal" ?
Gears are my favorite mechanism. Why do you think I have this username ? ;)
Make sure to spend some time to see my work http://www.algodoo.com/algobox/profile.php?id=96, just to kill sometime ;)
PS: Gear97™ Is a trademark from me. Any unauthorized use of the term "Gear" for usernames or other naming ideas will be punished.
User avatar
Gear97
 
Posts: 146
Joined: Sat Jan 02, 2010 5:34 pm
Location: Brazil

Re: Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 8:16 pm

bozbez wrote:Alternatively, you could check the 'killer' box in the materiel menu, or i have missed a vital point because i read the topic too quickly.

yep, i wrote about it in 3d post.. ;)

Kilinich wrote:the only workaround I see is to use circles instead of water :(

yeah... but that just sucks.. kills all beauty of realism, and especeally my gas pump :) that'll be my backup variant, but i think there is got to be a solution for erasing water with script, its seems to be so basic operation, that i just can't believe it's impossible :D
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 8:17 pm

Gear97 wrote:Sorry if missed something, but what about using a killer object to delete the water drops and make the rest of the things "imortal" ?

Guys, i just wrote about it:
osiris wrote:i've tried that, in that case other scripts, from the 'killer' object won't fire..
and it's vital.. :(
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby Gear97 » Mon Jul 04, 2011 9:30 pm

Hey osiris what do you mean by won´t fire I am not getting it ? Do you mean that because the killer kills anything it touches you can't use oncollide ?
Because if it is about this, I said in my last post that you can make things "imortal".
Sorry again if I missed some other thing.
Gears are my favorite mechanism. Why do you think I have this username ? ;)
Make sure to spend some time to see my work http://www.algodoo.com/algobox/profile.php?id=96, just to kill sometime ;)
PS: Gear97™ Is a trademark from me. Any unauthorized use of the term "Gear" for usernames or other naming ideas will be punished.
User avatar
Gear97
 
Posts: 146
Joined: Sat Jan 02, 2010 5:34 pm
Location: Brazil

Re: Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 9:47 pm

Gear97
Gear97 wrote: Do you mean that because the killer kills anything it touches you can't use oncollide ?

Yep, you got it right! but making things immortal won't help.. because oncollide must work with the object, wich must disapear :) it's easy when i can use density := 0 , but i need to do this with water, wich seems to be immune to density=0 trick.. let me explain..
:lol: the trouble is: i'm making an engine, so the on ignition a drop of fuel must disappear (erasing water) and a flame must appear... i'm doing it like this: when water touches spark-plug onCollide script must create a flame and erase water.. making a spark-plug a "killer" object prevents script from creating a flame, and not deleting water (witch i pretend to be a fuel :D ) just ruins the whole idea.. :(
Last edited by osiris on Mon Jul 04, 2011 9:54 pm, edited 1 time in total.
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby Gear97 » Mon Jul 04, 2011 9:50 pm

I see ... Thank you for the extra information, right I have no idea but I will see if I think of something. ;)
EDIT: Oh nice ! More information!!! :D
Last edited by Gear97 on Tue Jul 05, 2011 1:07 am, edited 2 times in total.
Gears are my favorite mechanism. Why do you think I have this username ? ;)
Make sure to spend some time to see my work http://www.algodoo.com/algobox/profile.php?id=96, just to kill sometime ;)
PS: Gear97™ Is a trademark from me. Any unauthorized use of the term "Gear" for usernames or other naming ideas will be punished.
User avatar
Gear97
 
Posts: 146
Joined: Sat Jan 02, 2010 5:34 pm
Location: Brazil

Re: Erase Water Drops onCollide

Postby osiris » Mon Jul 04, 2011 9:57 pm

Gear97
anyway, thanks for trying to help :thumbup:
also, i was editing my previous post just when you answered it.. so there is some more info about my scene..
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby Someone Else » Tue Jul 05, 2011 6:50 am

You could place two identical spark plugs exactly on top of each other, one killer that collides only with water, the other non-killer with the script that spawns the flame. (credit Kilinich, I think)

Alternatively, you could spawn a killer circle that collides only with water, and deletes itself onCollide.
(credit skateboardinben)
Code: Select all
scene.addCircle({
    collideSet := 0;
    killer := true;
    onCollide := (e)=>{
        collideWater = false;
        airFrictionMult = -inf}
})
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: Erase Water Drops onCollide

Postby osiris » Tue Jul 05, 2011 9:36 am

Someone Else,
Man, thanks! That's perfect: i'll just add second smoke-circle (i'm already making one for exhaust system), wich will kill water and disappear! :clap:
but i still can't believe that there is no script way for killing water.. :|
anyway, more smoke makes engine look more powerfull :lol:
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby osiris » Tue Jul 05, 2011 10:01 am

DAMN! :evil:
same thing: a killer-circle doesn't destruct itself: self-erasing script won't fire with killer-object - a water drop erased on touch and oncollide-script won't start..

Placing a killer object under the same non-killer object with script also won't help: they won't work both, or drop is erased by killer, or script work, but water wont get to the killer because it contacts with a script-containing object... :cry:
so, here i am, just where i started... :oops:
osiris
 
Posts: 8
Joined: Mon Jul 04, 2011 12:52 pm

Re: Erase Water Drops onCollide

Postby TC42 » Tue Jul 05, 2011 2:19 pm

Can you use immortal geoms? I think, otherwise, that Kilinich is right, you will have to use circles, as there is no script menu for water, nor any known way to delete individual water particles. And oncollide functions aren't called with killer objects (bug?). Maybe if you posted the engine you're working on, it would help...
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: Erase Water Drops onCollide

Postby Someone Else » Wed Jul 06, 2011 3:15 am

You could make the spawned killer circle collide on, say, E and spawn two of them.
Code: Select all
for(2, (i)=>{
    scene.addCircle({
        collideSet := 32;
        killer := true;
        pos := e.pos
    })
})


I have used this technique, too. Credit on this goes to davidz40.

Man, how in the world did I think that self-deleting a killer would work...
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


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest