New possibility for dynamic objects

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

New possibility for dynamic objects

Postby Kilinich » Fri Jun 18, 2010 10:02 am

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...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: New possibility for dynamic objects

Postby KarateBrot » Fri Jun 18, 2010 8:14 pm

AWESOMEEEE
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: New possibility for dynamic objects

Postby Rideg » Sat Jun 19, 2010 12:10 am

KarateBrot wrote:AWESOMEEEE

AWESOMEEEE + 1
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: New possibility for dynamic objects

Postby fox11trot » Sat Jun 19, 2010 11:06 pm

how does geval work?
fox11trot
 
Posts: 62
Joined: Tue Sep 01, 2009 7:25 am

Re: New possibility for dynamic objects

Postby Dakta » Sun Jun 20, 2010 2:55 am

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!!!!
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: New possibility for dynamic objects

Postby fox11trot » Sun Jun 20, 2010 5:26 am

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?
fox11trot
 
Posts: 62
Joined: Tue Sep 01, 2009 7:25 am

Re: New possibility for dynamic objects

Postby Rrobba » Tue Jun 22, 2010 3:54 pm

Rideg wrote:
KarateBrot wrote:AWESOMEEEE

AWESOMEEEE + 1


AWESOMEEEE + 2
Image
I don't suffer from insanity. I enjoy every minute of it.
User avatar
Rrobba
[Best Sig 2010]
 
Posts: 1480
Joined: Mon Aug 31, 2009 6:01 pm
Location: Gibraltar

Re: New possibility for dynamic objects

Postby Chronos » Tue Jun 22, 2010 4:27 pm

MEh.
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: New possibility for dynamic objects

Postby phunHunger » Fri Jul 02, 2010 9:35 pm

Is it possible for you too outline exactly what a dynamic object is?

I have no idea what one is :)
Noobs are the best ;)
User avatar
phunHunger
 
Posts: 31
Joined: Mon Apr 26, 2010 10:01 pm

Re: New possibility for dynamic objects

Postby Mystery » Sat Jul 03, 2010 2:59 am

Dynamic variable is a variable that is constantly changing, there are a few examples of this.
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)}
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: New possibility for dynamic objects

Postby Rideg » Sun Aug 15, 2010 1:53 am

How do I use it? :wtf:
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: New possibility for dynamic objects

Postby Matten » Sun Aug 15, 2010 1:36 pm

*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:
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!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests