Delayed Killers

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

Delayed Killers

Postby Papriko » Thu Nov 26, 2009 4:54 pm

I noticed that killers only activate their onCollide event when they meet immortal objects. Is there a way to go around that? I wanted it about so:

We have a square. It is not a killer. The square hits -lets say- a circle. The square executes it's onCollide, destroys the circle and then itself.
I am currently only using Phun 5.28 and not Algodoo. I would annoy the people on the Phun Forum and not here, but the Forum refused new registrations when I looked the last time.
Papriko
 
Posts: 29
Joined: Tue Nov 17, 2009 8:43 pm

Re: Delayed Killers

Postby davidz40 » Thu Nov 26, 2009 5:45 pm

set oncollide to:
(Your script); density=0; e.other.density=0;
Phundamentalist
User avatar
davidz40
 
Posts: 438
Joined: Sun Sep 06, 2009 10:30 am

Re: Delayed Killers

Postby link145632 » Thu Nov 26, 2009 6:57 pm

well of course! their killers therefore they kill it before the oncollide reaction :lol: hope this helps it is not a bug, because the simulator checks for killer and immortal before oncollide settings if im correct.
HYDRO THYMER!
link145632
 
Posts: 26
Joined: Thu Sep 24, 2009 12:24 am
Location: Catching waves on the internet

Re: Delayed Killers

Postby Kilinich » Thu Nov 26, 2009 6:59 pm

Papriko wrote:I noticed that killers only activate their onCollide event when they meet immortal objects. Is there a way to go around that? I wanted it about so:

We have a square. It is not a killer. The square hits -lets say- a circle. The square executes it's onCollide, destroys the circle and then itself.


First - you can add copy of killer object and set it's onCollide to do you needs and kill himself.

Or you can script something like this:
Rating: rated 6.1
Filesize: 20.34 kB
Comments: 4
Ratings: 3
download
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: Delayed Killers

Postby Papriko » Fri Nov 27, 2009 7:46 pm

I think that density = 0 is for my usage good enough.

I have a second question: For the thing I plan the "delayed killer" needs to know the other's density and area. e.other.density is clear, but can I also use e.other.area or something like that?



EDIT: I mean 2 questions: does Phun/Algodoo know pi or do I have to use a hand-typed value like 3.14?
I am currently only using Phun 5.28 and not Algodoo. I would annoy the people on the Phun Forum and not here, but the Forum refused new registrations when I looked the last time.
Papriko
 
Posts: 29
Joined: Tue Nov 17, 2009 8:43 pm

Re: Delayed Killers

Postby Versieon » Fri Nov 27, 2009 8:22 pm

AFAIK you cannot read area of a complex object, and only radius of a circle useing the New Method.

math.pi gives pi
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Delayed Killers

Postby Papriko » Fri Nov 27, 2009 8:44 pm

Thanks for the answers, you all. Now a last question and this thread is (probably, not sure :D) finished.

When I can't find out the area of boxes and polygons, am I at least able to get it's weight? With weight and density I could also get the area.
I am currently only using Phun 5.28 and not Algodoo. I would annoy the people on the Phun Forum and not here, but the Forum refused new registrations when I looked the last time.
Papriko
 
Posts: 29
Joined: Tue Nov 17, 2009 8:43 pm

Re: Delayed Killers

Postby Kilinich » Fri Nov 27, 2009 9:31 pm

Papriko wrote:I have a second question: For the thing I plan the "delayed killer" needs to know the other's density and area. e.other.density is clear, but can I also use e.other.area or something like that?

No way to read "area" but you can measure area by yourself and put it into some unused property like controllerAcc and then read.

EDIT: I mean 2 questions: does Phun/Algodoo know pi or do I have to use a hand-typed value like 3.14?

Yes. math.pi
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: Delayed Killers

Postby Papriko » Fri Nov 27, 2009 11:00 pm

When I can get neither the area nor the weight to calculate the area by my own, I will probably also not need Pi. My idea could still work, but is much uglier, because the relation is absolutely wrong...

Well, I just want to say now thanks to you all for the good answers. Bye folks, I'll come again when I have another problem :mrgreen:
I am currently only using Phun 5.28 and not Algodoo. I would annoy the people on the Phun Forum and not here, but the Forum refused new registrations when I looked the last time.
Papriko
 
Posts: 29
Joined: Tue Nov 17, 2009 8:43 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests

cron