need help. just a simple problem

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

need help. just a simple problem

Postby crytek » Wed Mar 24, 2010 2:31 am

can someone give me the script to make an object delete itself when it is left clicked on?

also, please tell me where to put the script (onCollide, Friction, ect... and yes I know its none of those...).
crytek
 
Posts: 355
Joined: Mon Aug 31, 2009 9:55 pm

Re: need help. just a simple problem

Postby Mystery » Wed Mar 24, 2010 8:24 am

There are quite a few ways to go about this, my favorite (To my knowledge the easiest)
Is to make a oncollide script that spawns a small ball on app.mousepos and then have a hinge trigger to mouse clicks. I'll elaborate later with a tutorial like thing but i don't have the time Atm. If any one else whats to teach him feel free.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: need help. just a simple problem

Postby Mystery » Mon Mar 29, 2010 11:47 am

Arrg no one else posted.

Well for starters you need one of these
Code: Select all
Scene.addLaserPen {
    geom := 0;
    relPoint := [-4.444837, -2.4123414];
    velocity := +inf;
    fadeDist := 0.1;
    maxRays := 1;
    cutter := false;
    opaqueBorders := true;
    showLaserBodyAttrib := true;
    size := 0.1;
    collideSet := 127;
    collideWater := true;
    color := [1.0, 1.0, 1.0, 2.0];
    onLaserHit := (e)=>{Scene.addcircle({pos := app.mousepos; Color :=              [0,0,0,1]; radius := 0.001 ; density = +inf; oncollide := (e)=>{e.this.density = 0; e.other.density = 0} })};
    entityID := 15;
    zDepth := 4.0;
    rotation := 1.5707978;
    activationButton := "mouse_left" }


Copy and paste this into you scene, it will make a laser that is activated with left mouse clicks

Place a box near in front of it.

Every time you click something a small Kamikaze Circle (Kills its self and what ever it touches) will spawn on you mouse.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: need help. just a simple problem

Postby crytek » Tue Mar 30, 2010 12:38 am

thanks! one more thing. can you make it so the circles delete them self rapidly so they wont stay there?
crytek
 
Posts: 355
Joined: Mon Aug 31, 2009 9:55 pm

Re: need help. just a simple problem

Postby Mystery » Tue Mar 30, 2010 9:12 am

I'll work on. Dynamic Property's have always confused me. Algodoo defiantly was not meant to have them. They are very annoying to work with. I spent a bit less then a hour today trying to get it work for you, had it working great then out all the codes (Even the back ups) stopped working :S
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 5 guests