Scene.my issues

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

Re: Scene.my issues

Postby Chronos » Mon May 09, 2011 1:40 am

Someone Else wrote:
Chronos wrote:You're completely doing it wrong. I'm uploading a video of me proving my point.

...

Well?

Uploading a 900 MB file takes some time, bro.

EDIT: Bamf

TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Scene.my issues

Postby Someone Else » Mon May 09, 2011 3:10 am

Sorry, but it's you who's got it wrong. If you do that, that's exactly what will happen. But, he said that he called upon color = scene.my.blah ONLASERHIT.

Thus, my experiment was correct. And yours is not.

HavingPhun wrote:Then in the laser I wrote in onlaserhit ---
Code: Select all
color = scene.my.laser1color

I can only assume that the laser would be constantly hitting something, constantly refreshing itself.

[/argument]
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: Scene.my issues

Postby Chronos » Mon May 09, 2011 4:58 am

Someone Else wrote:Sorry, but it's you who's got it wrong. If you do that, that's exactly what will happen. But, he said that he called upon color = scene.my.blah ONLASERHIT.

Thus, my experiment was correct. And yours is not.

HavingPhun wrote:Then in the laser I wrote in onlaserhit ---
Code: Select all
color = scene.my.laser1color

I can only assume that the laser would be constantly hitting something, constantly refreshing itself.

[/argument]

Oh, huh, I don't know how I missed something that important. Well now I feel a bit silly. :oops:
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Scene.my issues

Postby Someone Else » Mon May 09, 2011 5:46 pm

I only pointed it out fifteen times. :roll:
But anyway. At least we are both on the same page now.

And I am now sure that what I think is correct is actually correct.
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: Scene.my issues

Postby bozbez » Mon May 09, 2011 11:56 pm

What you think is correct is very correct :)
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: Scene.my issues

Postby Someone Else » Tue May 10, 2011 6:43 pm

bozbez wrote:What you think is correct is very correct :)

At least, when I think something is correct. Such is not always the case, however.
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: Scene.my issues

Postby hiltropper » Thu May 12, 2011 10:11 pm

i use this braces behaviour for example when spawning circles

Code: Select all
(e)=>{
    for({scene.my.v2}, (i)=>{
        scene.addcircle({
            pos := e.pos;
            density := 5;
            color := [1, 1, 1, 1];
            colorhsva := [44, 1, 1, 1];
            radius := scene.my.v1;
            fricition := 0;
            restitution := 0;
            collideset := 35
        })
    })
}


as you can see , scene.my.v2 is given as variable ,beacuse it has to be changeable permanently
scene.my.v1 is given as "change to value once" , because if a cirle spawns ,it gets a radius and this radius cannot be changed anymore (by the way otherwise algodoo would not accept it )
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Re: Scene.my issues

Postby daniels220 » Sun May 15, 2011 5:20 am

I don't think you need the braces around scene.my.v2—you're only actually using that value once, as a parameter in a function call (which is what for() is). Since scene.my.v2 can't change during the execution of the loop (since the loop runs in a single timestep, so no collisions/laserhits, and you aren't changing it in the inner function), you can just pass it by value.
daniels220
 
Posts: 95
Joined: Mon Aug 31, 2009 11:30 pm

Re: Scene.my issues

Postby hiltropper » Sun May 15, 2011 10:48 pm

no when you let out the braces algodoo does not accept it .it just spawns nothing so what has been said on this two sites here is important just mind when you should set braces .btw it is not changeable while the loop , but after (i am using it for a carburetor
script, circles are gasoline expansions)
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Re: Scene.my issues

Postby daniels220 » Tue May 17, 2011 9:52 pm

Works for me (Algodoo 1.8.5/Mac). Just to be clear, the code looks like:

Code: Select all
for(scene.my.v2, (i)=>{ //the spawn code })


You do need the braces after (i)=>, those define the function body.
daniels220
 
Posts: 95
Joined: Mon Aug 31, 2009 11:30 pm

Re: Scene.my issues

Postby hiltropper » Wed May 18, 2011 1:20 pm

ok for normal spawning yo are right , i thought it because of my motor with the carburetor but testet it again in general and then you can leave the braces
the braces after the assignment are normal
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Previous

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests