[etoys-dev] Re: Fwd: How can I tell if a Scripting Tile is moved into a script?

Steve Thomas sthomas1 at gosargon.com
Tue Jan 19 15:11:19 EST 2010


Stephen wrote:
>>
>> Folks,
>>
>> I am working on a Etoys Tutorial similar to Etoys Challange and I want to
be able to detect if certain tiles were used
>>(or not used), so that I can provide "pop up" hints to users.
>>
>> I tried creating a script on a "Scripting Tile Holder", but as soon as I
move the "Scripting Tile Holder" the script
>> disappears (literally, off the screen and it is removed from the object).
>>
>> To recreate: Open Etoys Challenge, then create a script for one the
Scripting Tiles (ex:Car forward by 10), then move
>> the Scripting Tile with you mouse and the script disappears.
>>
>> Another possible solution would be to somehow use reflection to see what
is in a particular script, but I would need
>> help in figuring out how to do that.

Yoshiki responded:
> I think this is a tricky one.  As you found out, Scripting Tile
>Holder is transient.  As soon as you pick it up, the green fringe
>around the tile goes away; it means that the Scripting Tile Holder for
>that tile goes away along with the scripts and tiles.  One may think
>that the Phrase Tile (inside the Scripting Tile Holder) may retain the
>identity, but once it is dropped into a scriptor, it results in a copy
>of original and also loses scripts.
>
> - One approach is to look at the scriptor and visit recursively the
>   tree structure of tiles in there and found out what kind of
>   commands (and Test) are used.  If you want to go this way, I or
>   somebody should be able to provide a short code snippet that does
>   it.
>
> - Another approach would be to make the playfield that contains these
>   phrases intelligent, and whenever a phrase is taken out from it, it
>   assumes that it is "used".  (Not perfect because it may be just moved
>   to the world).  Again, if you want to go this way, I or somebody should
>   be able to provide a short code snippet that looks at the elements
>   in the playfield and tells you what kind of tiles inside.
>
>I would guess that the first approach would be more "faithful" in
>guiding the user, but still there is a mechanism to compare the
>current situation and the goal and decide what kind of information to
>provide to the user...
>
>-- Yoshiki

Yes I would definitely prefer the more "faithful" solution.
If you would be kind enough to provide the code snippet (preferably inside
an Etoys Challenge project so I can see how it works) I will work on
learning squeak enough to modify it for my needs and work on the mechanism's
to compare current to goal and provide the information based on results and
timing.

Thanks,
Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakland.org/pipermail/etoys-dev/attachments/20100119/be0659e8/attachment.html


More information about the etoys-dev mailing list