Scene.my issues

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

Scene.my issues

Postby HavingPhun » Thu May 05, 2011 9:53 pm

If I use scene.my to change the color of an object then I open the scene later it will no longer change the color of the object. Please help. This is why i wish you could use entity ID for proggraming in thyme!
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: Scene.my issues

Postby TC42 » Thu May 05, 2011 9:57 pm

What exactly happens? Does the variable imbedded in the object change? Make sure it's {scene.my.variablename}
Make sure that there is no scene.my.variablename(2) or anything like that. Be sure you treat it as an array.
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Scene.my issues

Postby HavingPhun » Thu May 05, 2011 10:06 pm

Well I typed this ---
Code: Select all
scene.my.laser1color = [1,1,1,1]


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


Then I save the scene and opened it up later and the scene.my variable won't change the color of the laser anymore!! :evil:
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: Scene.my issues

Postby hiltropper » Thu May 05, 2011 10:52 pm

yea know this problem
when you set the color to a variable and for example import the object as phunlet , the variable no longer exists in the new scene if you start the simulation so let it paused and type in any start value for your var first into the console or so ,so that the color can be set to the var (after that ,it can be changed to your values).if not the color is set to nothing that means the last known float or integer value ,no var any longer. this is caused by the effect that your scene.my. is saved correctly but after a time when it isnt longer saved in the console ,too, it will be set after the start of the simulation . at this moment it is to late for the object to take the var as value , because it didnt exist in the moment of the start , but a millisec after.

hope it was your problem but if not this is a similar one i know
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Re: Scene.my issues

Postby Someone Else » Thu May 05, 2011 11:40 pm

@HavingPhun: Do the variables still exist? Type scene.my.laser1color into the console and see what you get.
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 HavingPhun » Fri May 06, 2011 1:10 am

Yes they still exist but they don't change the color of the object anymore. This annoys me very much because I could make a working Tv or projector if i didnt have this problem!! :evil: :evil: :evil: :evil: :evil:
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: Scene.my issues

Postby hiltropper » Fri May 06, 2011 3:52 pm

the point is does it exist in
color = {scene.my.color}
?
if my prob is yours then it would be something like color={200,1,1,1} and the var is gone so it cant change anymore
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Re: Scene.my issues

Postby Chronos » Fri May 06, 2011 9:08 pm

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

There's your problem. You want:

Code: Select all
color = {scene.my.laser1color}


You forgot the braces.
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 » Sat May 07, 2011 1:33 am

If he uses a laser or something to refresh it constantly, he does not need the braces.
And that's exactly what he said.
FuzzyLogicBrain wrote:Then in the laser I wrote in onlaserhit ---
Code: Select all
color = scene.my.laser1color

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 » Sat May 07, 2011 1:46 am

Someone Else wrote:If he uses a laser or something to refresh it constantly, he does not need the braces.
And that's exactly what he said.
FuzzyLogicBrain wrote:Then in the laser I wrote in onlaserhit ---
Code: Select all
color = scene.my.laser1color


No, see, without the braces, it'll remove that code and replace it with whatever scene.my.laser1color is at that time. With the braces, it won't remove the code, but still update the color.
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 » Sat May 07, 2011 1:55 am

Chronos wrote:
Someone Else wrote:If he uses a laser or something to refresh it constantly, he does not need the braces.
And that's exactly what he said.
FuzzyLogicBrain wrote:Then in the laser I wrote in onlaserhit ---
Code: Select all
color = scene.my.laser1color


No, see, without the braces, it'll remove that code and replace it with whatever scene.my.laser1color is at that time. With the braces, it won't remove the code, but still update the color.

No, see, he said he put that code in onLaserHit. Thus, it will update color at each blip.
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 » Sat May 07, 2011 3:52 am

Someone Else wrote:
Chronos wrote:
Someone Else wrote:If he uses a laser or something to refresh it constantly, he does not need the braces.
And that's exactly what he said.

No, see, without the braces, it'll remove that code and replace it with whatever scene.my.laser1color is at that time. With the braces, it won't remove the code, but still update the color.

No, see, he said he put that code in onLaserHit. Thus, it will update color at each blip.

Again, you don't understand. If you don't have the braces, it will remove the original code and replace it with whatever value the variable was at. It no longer is "color = scene.my.laser1color", it's "color = [1,1,1,1]" or whatever the variable was at at the time. I'm pretty sure you need the braces.
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 » Sat May 07, 2011 5:32 am

Does it really do that? :wtf:
I just closed Algodoo, so I can't check.

@HavingPhun: Did it show you anything funny when you typed in the code? Did it stay as color = scene.my.laser1color or did it snap to color = [1, 1, 1, 1]?

Or maybe, this is a glitch that stems from using scripted lasers. Try e.laser.color = scene.my.laser1color.
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 » Sat May 07, 2011 6:06 am

Someone Else wrote:Or maybe, this is a glitch that stems from using scripted lasers. Try e.laser.color = scene.my.laser1color.

Nope, it's not a glitch. It's the intended behavior. It's always been like that, and it (hopefully) always will.
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 hiltropper » Sat May 07, 2011 11:50 am

yes the braces are basic requirement very likely it will work with braces.
but when importing or so , you also have to set the variable first (as described above).
i checked it again few minutes ago
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
hiltropper
 
Posts: 85
Joined: Mon Dec 20, 2010 12:02 pm
Location: Germany

Re: Scene.my issues

Postby Someone Else » Sat May 07, 2011 7:22 pm

Now why would the Algoryx people make us always type in e.laser.color like that?
And I just tested it- color = scene.my.blah does indeed fail to fail as Chronos said it would.
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 HavingPhun » Sun May 08, 2011 12:39 am

so the code would be this in onlaserhit?
Code: Select all
e.laser.color = {scene.my.blah}

Also would this work still if i am changing the values of the variable throughout the scene?
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: Scene.my issues

Postby Chronos » Sun May 08, 2011 1:03 am

HavingPhun wrote:Also would this work still if i am changing the values of the variable throughout the scene?

That's why you want the braces. Otherwise, it'll change it once, then stop. That code should work (unless you typoed).
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 » Sun May 08, 2011 4:09 am

It should work without the braces, but the braces won't hurt.
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 TC42 » Sun May 08, 2011 4:21 am

No, it shouldn't work without braces. The braces are needed for dynamic values.
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Scene.my issues

Postby Someone Else » Sun May 08, 2011 5:08 am

What I understand is this:
Code: Select all
Without the braces, it will refresh each event. Every collision, blip, whatever.
With the braces, it will refresh whenever the value is changed.
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 » Sun May 08, 2011 5:38 am

Someone Else wrote:What I understand is this:
Code: Select all
Without the braces, it will refresh each event. Every collision, blip, whatever.
With the braces, it will refresh whenever the value is changed.

You're actually wrong. The way it goes is:

With the braces, it will refresh each event.
Without the braces, it will change once, then the value in the box will no longer be the variable. It'll be the value the variable was at the time the code was entered.
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 » Sun May 08, 2011 6:38 am

You're certain of that.

I'm not.

This is what I set up:
Code: Select all
I declared scene.my.blah = [1, 1, 1, 1]
In a laser, I made the onLaserHit color = scene.my.blah. I also tried e.laser.color = scene.my.blah to the same effect.
I placed two circles above the beam- one would hit the beam almost immediately, the other would take a few seconds.
Below the beam, I placed a box with onCollide scene.my.blah = [0, 1, 0, 1].
I started the sim.
The first circle hit the beam and the beam turned white.
The first circle hit the box to no visible effect.
The second circle hit the beam, turning the beam green.
The second circle hit the box to no effect.
I checked the onLaserHit. It had not changed.

I then repeated the experiment, but with color = {scene.my.blah}.
When I started the sim, the beam turned green when the first circle hit the box and changed the variable, not when the second circle hit the beam.

Thus proving that my understanding was correct.

If there was a smilie depicting a face with its thumbs in its ears, its fingers sticking up and wiggling, and its tongue sticking out, I would show five of those.
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 1:24 am

Someone Else wrote:You're certain of that.

I'm not.

This is what I set up:
Code: Select all
I declared scene.my.blah = [1, 1, 1, 1]
In a laser, I made the onLaserHit color = scene.my.blah. I also tried e.laser.color = scene.my.blah to the same effect.
I placed two circles above the beam- one would hit the beam almost immediately, the other would take a few seconds.
Below the beam, I placed a box with onCollide scene.my.blah = [0, 1, 0, 1].
I started the sim.
The first circle hit the beam and the beam turned white.
The first circle hit the box to no visible effect.
The second circle hit the beam, turning the beam green.
The second circle hit the box to no effect.
I checked the onLaserHit. It had not changed.

I then repeated the experiment, but with color = {scene.my.blah}.
When I started the sim, the beam turned green when the first circle hit the box and changed the variable, not when the second circle hit the beam.

Thus proving that my understanding was correct.

If there was a smilie depicting a face with its thumbs in its ears, its fingers sticking up and wiggling, and its tongue sticking out, I would show five of those.

You're completely doing it wrong. I'm uploading a video of me proving my point.
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 1:35 am

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

...

Well?
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

Next

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests