Browse Search Popular Register Upload Rules User list Login:
Search:
Inter-entity-access-ANIMATED

Image:
no image found for this scene

Author: griggy

Group: Default

Filesize: 56.28 kB

Date added: 2015-12-08

Rating: 5

Downloads: 491

Views: 301

Comments: 6

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Demonstrates 3 methods of passing data between entities using Thyme.
The scene describes the methods and the scripts use them.
Please log in to rate this scene
edit
Similar scenes
Title: entityByName demo
Rating: 5.625
Filesize: 59.23 kB
Downloads: 1096
Comments: 2
Ratings: 2
Date added: 2017/12/20 09:46:32
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Exploding shell
Rating: 7.3333
Filesize: 0.76 MB
Downloads: 4450
Comments: 11
Ratings: 9
Date added: 2011/04/30 13:14:14
Made with: Phun
Rating: rated 7.3
download
Title: Solaris Inter-Urbino 12
Rating: 6.25
Filesize: 220.71 kB
Downloads: 2938
Comments: 7
Ratings: 6
Date added: 2009/12/23 13:50:28
Made with: Phun
Rating: rated 6.3
download
Title: Animated Art #4
Rating: 6.5
Filesize: 46.01 kB
Downloads: 3385
Comments: 2
Ratings: 4
Date added: 2011/04/23 15:22:54
Made with: Algodoo before v1.8.5
Rating: rated 6.5
download
Title: Animated Art #7
Rating: 5.625
Filesize: 142.01 kB
Downloads: 2786
Comments: 0
Ratings: 2
Date added: 2011/04/23 17:52:43
Made with: Algodoo before v1.8.5
Rating: rated 5.6
download
Title: Animated Art #9
Rating: 5
Filesize: 76.81 kB
Downloads: 2758
Comments: 0
Ratings: 1
Date added: 2011/04/26 20:25:02
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Good job! You obviously know a lot about Thyme scripting, and so I hope you will post more tutorials like this one. :tup:

Suggestion: In addition to showing some examples of scripts, it would be helpful if you could also include some text description of how the script works, and maybe explain when, where, and why you would use the various examples.

THANKS! :)
Method 1: The onClick handler of the circle updates a variable (a counter)in scene.my. The scoreboard "reads" that because it has {....} in its text attribute.

Method 2: The onClick handler of the circle updates its own counter. It also "writes" it to the scoreboard. To do that it needs the internal ref of the scoreboard. It can get that because the scoreboard writes it to scene.my. in its onSpawn handler (which is executed when the scene loads).

Method 3: The onClick handler of the circle updates its own counter. The scoreboard "reads" it from there. To do that it needs the internal ref of the circle. It can get that because the circle writes it to scene.my. in its onSpawn handler (which is executed when the scene loads).

As an alternative I could have obtained the internal ref of an entity (circle or scoreboard) by coding its geomID or entityID and calling either scene.entityByGeomID or scene.entityByID.

I am new to Algodoo and have found out most of this by trial and error.http://www.algodoo.com/algobox/theme/smilies/bonk.gif
So I have no idea when to use these methods. I was just showing what is possible. Method 1 is the easiest to understand and use.

I have seen other people call a function called "readable" and use an attribute(?) called "owner" when dealing with objects, but I have been unable to find out what they are. I would be grateful if anyone could tell me.
Thanks for the explanations! :tup:

Some time ago I was also puzzled about "readable" and "owner" and so I asked about them in the Algodoo forum. I got some answers, and they are now a little clearer to me now, but I am still a little bit puzzled about how and when to use them. Here is a link to the forum post:

http://www.algodoo.com/forum/viewtopic.php?f=13&t=10428&p=71160&hilit=readable#p71160

If you search the forum for "readable" and "owner", you will find some more posts that describe them. Some posts are useful and some are not, but I've learned some things about them through my own experimentation.
Thanks for that Xray. Silly me: I had been using Google searches without realising that the forum has its own.

I have read most of posts you indicated and found it interesting that you and other people have had exactly the same difficulties. I have also fallen into the trap of not realising that UNDO can remove code you have entered.

Thanks for your help.
Remember that all onSpawn events also called on undo so I'd rather you add condition sim.time == 0 ? {init code}:{}
Storing objects in scene.my. is very bad idea because of serialization problem in algodoo, it can't correctly store it, that's why better do it in non- _variables in objects...
Last edited at 2015/12/30 21:13:05 by Kilinich