killing something but not killing it
20 posts • Page 1 of 1
killing something but not killing it
i have phun and i was wondering if there was some way to kill something without killing it. by this i mean that like with a regular killer it destroys the whole object. i don't want this i just want it to destroy the part it touches. almost like csg subtract. is there a script for that? anyone who can find and answer.
Last edited by canadian joe on Thu Feb 11, 2010 11:59 pm, edited 1 time in total.
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
No, it is not possible.
-
Dadasas - Posts: 46
- Joined: Tue Sep 01, 2009 2:03 am
Re: killing something but not killing it
well, no. But you can fake it. Make an object out of lots of small pieces, and then kill the pieces.
[/post]
Paradigm 29 wrote:I've been trying to figure out why people even buy hummers ever since I found out that they don't have machine guns.
-
izacque - Posts: 483
- Joined: Mon Sep 14, 2009 11:14 am
Re: killing something but not killing it
OK so that's a good idea. do you know what a script for that would be. by that i mean that on collide whatever the object touches turns into smaller pieces and then kills those. it would be very helpful because im building a scene and i definitely need this
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
he meant make an object OF small pieces
make sure to check out my work.
-
Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: killing something but not killing it
interesting idea, though... couldn't some complex spawning actually turn, for example, one box into four boxes hinged together?
[/post]
Paradigm 29 wrote:I've been trying to figure out why people even buy hummers ever since I found out that they don't have machine guns.
-
izacque - Posts: 483
- Joined: Mon Sep 14, 2009 11:14 am
Re: killing something but not killing it
Yes, it could, i could probobly do it.
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: killing something but not killing it
ok that works...exept i have phun not algodoo. if anyone could just type up a script that turns one shape into like 8 other shapes fixated together then that would be great. hoever did that scene in the post before this did do a very nice job. i just need the script written down as a post, not an entire scene. but again, good job with that scene
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
- Code: Select all
e.other.pos = [0, 0]; e.other.size = [0, 0]; app.step; app.undo; scene.my.my1 = scene.my.my1 + 1; Scene.addBox({ color := [0.09584715, 0.06036842, 0.25704986, 1.0]; entityID := 154; zDepth := 5.0; geomID := scene.my.my1 + 855; pos := e.other.pos + [-0.25, 0.25]; angle := 0.0; size := e.other.size * [0.5, 0.5] }); Scene.addBox({ color := [0.09584715, 0.06036842, 0.25704986, 1.0]; entityID := 155; zDepth := 7.0; geomID := scene.my.my1 + 856; pos := e.other.pos + [-0.25, -0.25]; angle := 0.0; size := e.other.size * [0.5, 0.5] }); Scene.addBox({ color := [0.09584715, 0.06036842, 0.25704986, 1.0]; entityID := 157; zDepth := 8.0; geomID := scene.my.my1 + 858; pos := e.other.pos + [0.25, -0.25]; angle := 0.0; size := e.other.size * [0.5, 0.5] }); Scene.addBox({ color := [0.09584715, 0.06036842, 0.25704986, 1.0]; entityID := 156; zDepth := 6.0; geomID := scene.my.my1 + 857; pos := e.other.pos + [0.25, 0.25]; angle := 0.0; size := e.other.size * [0.5, 0.5] }); Scene.addHinge({ geom0 := scene.my.my1 + 855; geom0pos := e.other.size * [0.25, 0.0]; geom1 := scene.my.my1 + 857; geom1pos := e.other.size * [-0.25, 0.0]; color := [0.13043503, 0.51888734, 0.052302003, 1.0]; entityID := 158; zDepth := 9.0; size := 0.08165382 }); Scene.addHinge({ geom0 := scene.my.my1 + 856; geom0pos := e.other.size * [0.0, 0.25]; geom1 := scene.my.my1 + 855; geom1pos := e.other.size * [0.0, -0.25]; color := [0.98707193, 0.8416413, 0.07365841, 1.0]; entityID := 159; zDepth := 10.0; size := 0.08165382 }); Scene.addHinge({ geom0 := scene.my.my1 + 858; geom0pos := e.other.size * [0.0, 0.25]; geom1 := scene.my.my1 + 857; geom1pos := e.other.size * [0.0, -0.25]; color := [0.78752655, 0.15908076, 0.015631914, 1.0]; entityID := 160; zDepth := 11.0; size := 0.08165382 }); Scene.addHinge({ geom0 := scene.my.my1 + 856; geom0pos := e.other.size * [0.25, 0.0]; geom1 := scene.my.my1 + 858; geom1pos := e.other.size * [-0.25, 0.0]; color := [0.6095219, 0.8971852, 0.55334485, 1.0]; entityID := 161; zDepth := 12.0; size := 0.08165382 }); e.other.density = 0; e.this.density = 0
Should work in phun.
Btw, Versieon Epic +1
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: killing something but not killing it
wow, good work . this is a really great script. how many pieces does it turn the box into thank you this is awesome. do you mind if i use this in one of my scenes . also is there a way to copy and paste this into the phun oncollide script im kinda new to scripting.
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
Press select all with the code i posted. ctrl + C (Copy)
Then in phun in on-collide (Needs advanced mode ON) paste it between (e)=>{ HERE! } on the object you want to split.
Then in phun in on-collide (Needs advanced mode ON) paste it between (e)=>{ HERE! } on the object you want to split.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: killing something but not killing it
cool,thanks ill try that
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
it didn't work, you can't paste in phun
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
canadian joe wrote:it didn't work, you can't paste in phun
you can
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: killing something but not killing it
yeah not dragging and dropping. you can copy (CTRL + C) it and paste (CTRL + V) it
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: killing something but not killing it
oh i did not know the whole paste shortcut thing. now i feel like a fool
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
IT CRASHED MY PHUN!!!!! IT MAKES THE WHOLE ERROR REPORT THING COME UP. This happens to make me feel sad inside
canadian joe wrote:im just writing this so i can sig it
RicH wrote:Phun's Army.
-
canadian joe - Posts: 115
- Joined: Wed Feb 10, 2010 9:42 pm
Re: killing something but not killing it
It crashed because it uses zero density. Use airFrictionMult of large negative values to achieve the same effect.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: killing something but not killing it
Edit: I figured it out, ignore the asking for help (if you saw it).
So I'm not much of a Thymer, but I have some programming knowledge. I think this is really cool but a) it has a couple problems with the physical results (I'll get to that in a moment) and b) it's doing the same thing four times, which immediately made me think "for loop." So I made a version that fixes all that.
The problems I fixed are:
The old version spawned the quadrant boxes at the corners of the original box, so they then "settled" into place with a jerk from the hinges. Worse, when further subdividing an already-subdivided box, the new quadrants still spawn 1m apart—not even the size of the smaller "parent." So I made it so they spawn exactly where they're supposed to end up.
The old version also spawned the hinges at a fixed size, so multiple subdivisions meant the boxes were obscured by the hinges. The hinges now spawn as 1/10 the size of the object.
I also took out "e.this.density = 0" for troubleshooting (that way I don't lose my test objects) but it can obviously be added back.
So I'm not much of a Thymer, but I have some programming knowledge. I think this is really cool but a) it has a couple problems with the physical results (I'll get to that in a moment) and b) it's doing the same thing four times, which immediately made me think "for loop." So I made a version that fixes all that.
- Code: Select all
(e)=>{
e.other.pos = [0, 0];
e.other.size = [0, 0];
app.step;
app.undo;
scene.my.my1 = scene.my.my1 + 1;
scene.my.size = e.other.size;
for(4,(i)=>{
offset := {
(i == 0) ? {[0.25,0.25]} : {
(i == 1) ? {[0.25,-0.25]} : {
(i == 2) ? {[-0.25,-0.25]} : {[-0.25,0.25]}
}
}
};
Scene.addBox({
color := [0.1,0.05,0.25,1.0];
entityID := 154 + i;
zDepth := 5.0 + i;
geomID := scene.my.my1 + 855 + i;
pos := e.other.pos + e.other.size * offset;
angle := 0.0;
size := e.other.size * [0.5, 0.5]
});
});
for(4,(j)=>{
offset := {
(j == 0) ? {[0,-0.25]} : {
(j == 1) ? {[-0.25,0]} : {
(j == 2) ? {[0,0.25]} : {[0.25,0]}
}
}
};
Scene.addHinge({
geom0 := scene.my.my1 + 855 + (j % 4);
geom0pos := e.other.size * offset;
geom1 := scene.my.my1 + 855 + ((j + 1) % 4);
geom1pos := e.other.size * offset * (-1);
color := [1,1,1,1.0];
entityID := 158 + j;
zDepth := 9.0 + j;
size := (e.other.size(0)^2 + e.other.size(1)^2)^0.5 * 0.1;
});
});
e.other.density = 0
}
The problems I fixed are:
The old version spawned the quadrant boxes at the corners of the original box, so they then "settled" into place with a jerk from the hinges. Worse, when further subdividing an already-subdivided box, the new quadrants still spawn 1m apart—not even the size of the smaller "parent." So I made it so they spawn exactly where they're supposed to end up.
The old version also spawned the hinges at a fixed size, so multiple subdivisions meant the boxes were obscured by the hinges. The hinges now spawn as 1/10 the size of the object.
I also took out "e.this.density = 0" for troubleshooting (that way I don't lose my test objects) but it can obviously be added back.
- daniels220
- Posts: 95
- Joined: Mon Aug 31, 2009 11:30 pm
20 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest