Help ! Circle spawning stops ! HELP PLEASE !!

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

Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Sat Jun 05, 2010 4:44 pm

Hellow guys ! Gear97 again, so I had a problem: I made a spawner that spawns a circle with laser, and this circle with a laser keep spwaning circles and changing its density and controlleracc, but when I spawn another circle with laser: the oldest stop of spawn the circles, and the newest works good. :(
And the console says: variable "color" already declared in this scope. (or something like this)
PLEASE I NEED HELP ! :oops:
SOMEONE, PLEASE HELPS ME ! :oops:
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Matten » Sat Jun 05, 2010 4:47 pm

I'm not getting the full story, can you give the script of the spawner and density/controllerAcc changer?
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Sat Jun 05, 2010 4:54 pm

OK

Spawner:
Code: Select all
(e)=>{
    scene.addcircle({
        pos := app.mousepos;
        color := [0, 0.55, 0, 0.99];
        density := 235;
        radius := 0.16;
        drawcake := false;
        collideSet := 3;
        friction := 0.0;
        restitution := 1.0
    });
    scene.addlaserpen({
        pos := [(app.mousepos(0) - 0.06), app.mousepos(1)];
        size := 0.08;
        color := [1, 0, 0, 0];
        collideSet := 2;
        onLaserHit := (e)=>{
            e.geom.controlleracc = e.geom.controlleracc + 0.05;
            e.geom.controlleracc >= 10.0 ? {
                scene.addcircle({
                    pos := e.pos;
                    radius := 0.05;
                    color := [0, 0.3, 0.3, 1];
                    density := 70;
                    drawcake = false;
                    friction := 0.0;
                    restitution := 1.0
                });
                scene.addpen({
                    pos := e.pos;
                    color := [0, 0.3, 0.3, 1.0];
                    size := 0.05;
                    fadetime := 0.5
                })
            } : {};
            e.geom.controlleracc >= 10.0 ? {
                e.geom.controlleracc = 0.0;
                e.geom.density = e.geom.density - 1.0
            } : {};
            e.geom.density <= 206.0 ? {
                e.geom.color := [0.45, 0.45, 0.45, 1.0];
                e.laser.maxrays = 0
            } : {}
        };
        maxrays := 1
    })
}


The Laser in the "spawned" ball:
Code: Select all
(e)=>{
    e.geom.controlleracc = e.geom.controlleracc + 0.05;
    e.geom.controlleracc >= 10.0 ? {
        scene.addcircle({
            pos := e.pos;
            radius := 0.05;
            color := [0, 0.3, 0.3, 1];
            density := 70;
            drawcake = false;
            friction := 0.0;
            restitution := 1.0
        });
        scene.addpen({
            pos := e.pos;
            color := [0, 0.3, 0.3, 1.0];
            size := 0.05;
            fadetime := 0.5
        })
    } : {};
    e.geom.controlleracc >= 10.0 ? {
        e.geom.controlleracc = 0.0;
        e.geom.density = e.geom.density - 1.0
    } : {};
    e.geom.density <= 206.0 ? {
        e.geom.color := [0.45, 0.45, 0.45, 1.0];
        e.laser.maxrays = 0
    } : {}
}
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Matten » Sat Jun 05, 2010 5:04 pm

I can't find something wrong. All the color scripts are good and there's nothing wrong with the circle spawning. I think it's something with the laser.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Sat Jun 05, 2010 5:05 pm

HMM.. :(.
OK I will try to do something about this.
BUT I ALSO DONT HAVE IDEAS !
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Matten » Sat Jun 05, 2010 5:10 pm

Maybe you have to make the whole spawner again and then try if it works fine. Maybe it's just a wrong equal sign or something. And if you make it again you it maybe works.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Rideg » Sun Jun 06, 2010 2:17 am

Can you upload the scene and I'll fix it for you name it "help123".

Rideg signing out to sleep ;)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Sun Jun 06, 2010 4:00 pm

HERE IS IT ! :) :D
Rating: rated 5
Filesize: 35.63 kB
Comments: 1
Ratings: 2
download
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Matten » Sun Jun 06, 2010 5:08 pm

Hmmm...
I really don't understand why he doesn't work. He just stops with changing the controllerAcc, but the laser script is still the same. I really don't understand...
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Rideg » Sun Jun 06, 2010 7:48 pm

Rating: rated 5.6
Filesize: 19.74 kB
Comments: 2
Ratings: 2
download
Here's your solution ;)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Fri Jun 18, 2010 7:52 pm

:D Thank you !! :clap:
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Rideg » Fri Jun 18, 2010 8:34 pm

You're welcome. Can I ask what you are making? Or will I find out myself when/if you upload it?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Fri Jun 18, 2010 8:46 pm

You need to wait !!! MUAHAHAHAHAHHAHA !!!!
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: Help ! Circle spawning stops ! HELP PLEASE !!

Postby Gear97 » Sun Jun 20, 2010 6:07 pm

Rideg ! Here is what made with that circle spawner:
viewtopic.php?f=18&t=2376
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


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests