New possibility for dynamic objects
12 posts • Page 1 of 1
New possibility for dynamic objects
Emil comment: ...However, in 1.7.4 I will be introducing the Thyme function "geval" - like eval, but everything in it will be evaluated in the global scope - ie NOT through the dead parent.
Wow! That can be used for very complex and cool dynamic effects!
Can't wait to try it.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: New possibility for dynamic objects
KarateBrot wrote:AWESOMEEEE
AWESOMEEEE + 1
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: New possibility for dynamic objects
how does geval work?
- fox11trot
- Posts: 62
- Joined: Tue Sep 01, 2009 7:25 am
Re: New possibility for dynamic objects
Thyme noob alert!
Just pokin at ya.
Basically, whenever you do something in Thyme, it has a scope. The scope is what it’s called, it defines the reach of the effects of the action you just took in Thyme. It also affects variables. All variables have a scope, and this allows you to have two variables with the same name and different values.
In the past, executing code fro,m an object meant executing it in the limited scope of that object, and if it disappeared, that scope was (I think) left floating, but without an attached object for reference, making it useless, and very odd to program. Now, you can execute code in the global scope, so that it is executed in a scope that will still exist, and affect everything (thus the “global” part), which allows you to do much more awesome stuffs.
And I agree
AWESOME!!!11!1!1111!!!one!1!!!1!1ELEVEN!!11!!!!
Basically, whenever you do something in Thyme, it has a scope. The scope is what it’s called, it defines the reach of the effects of the action you just took in Thyme. It also affects variables. All variables have a scope, and this allows you to have two variables with the same name and different values.
In the past, executing code fro,m an object meant executing it in the limited scope of that object, and if it disappeared, that scope was (I think) left floating, but without an attached object for reference, making it useless, and very odd to program. Now, you can execute code in the global scope, so that it is executed in a scope that will still exist, and affect everything (thus the “global” part), which allows you to do much more awesome stuffs.
And I agree
AWESOME!!!11!1!1111!!!one!1!!!1!1ELEVEN!!11!!!!
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.

a Mammoth wrote:be boring and interesting.
I didn't know you could go up 3.1.3! Thanks Mystery person!Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
-

Dakta - Posts: 417
- Joined: Sat Sep 12, 2009 4:36 pm
Re: New possibility for dynamic objects
haha well im not entirely a noob at thyme. I know thyme just not programming if you get what i mean.
I still dont fully understand what difference this will make because can't you declare variables and edit them in the console?
I still dont fully understand what difference this will make because can't you declare variables and edit them in the console?
- fox11trot
- Posts: 62
- Joined: Tue Sep 01, 2009 7:25 am
Re: New possibility for dynamic objects
Rideg wrote:KarateBrot wrote:AWESOMEEEE
AWESOMEEEE + 1
AWESOMEEEE + 2

I don't suffer from insanity. I enjoy every minute of it.
-

Rrobba - [Best Sig 2010]
- Posts: 1480
- Joined: Mon Aug 31, 2009 6:01 pm
- Location: Gibraltar
Re: New possibility for dynamic objects
Is it possible for you too outline exactly what a dynamic object is?
I have no idea what one is
I have no idea what one is
Noobs are the best 
-

phunHunger - Posts: 31
- Joined: Mon Apr 26, 2010 10:01 pm
Re: New possibility for dynamic objects
Dynamic variable is a variable that is constantly changing, there are a few examples of this.
What Kilinich is referring to is doing something more complicated like
- Code: Select all
density = {sim.time}
What Kilinich is referring to is doing something more complicated like
- Code: Select all
density = {sim.time * (e.this.controlleracc / 3.15149)}
-

Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: New possibility for dynamic objects
*bump*
But I will answer your question...
You can just write your spawn script, including dynamic variables as a string in the geval function.
So for example a dynamic color could be:
But I will answer your question...
You can just write your spawn script, including dynamic variables as a string in the geval function.
So for example a dynamic color could be:
- Code: Select all
(e)=>{geval("Scene.addCircle({pos := e.pos;
radius := 0.1;
color := {[sim.time, 1, 1, 1]}
})")}
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!
-

Matten - Posts: 435
- Joined: Mon Apr 05, 2010 2:03 pm
- Location: The Netherlands
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests





