[etoys-dev] References in textual scripts

Bert Freudenberg bert at freudenbergs.de
Mon Dec 10 19:01:18 EST 2012


Huh? The reference pool is stored in the published project - why would we lose anything? The mechanism is there we just need to hook it up.

- Bert -

On 2012-12-11, at 00:53, karl ramberg <karlramberg at gmail.com> wrote:

> It should not be hard to insert the player name from a dropped tile,
> but we would still lose reference to the player during publishing and reloading of a project. 
> 
> Can you think of a way to keep the reference for published projects ?
> 
> Karl
> 
> 
> On Mon, Dec 10, 2012 at 2:37 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>> On 2012-12-07, at 22:55, Edward Mokurai Cherlin <mokurai at sugarlabs.org> wrote:
>> > I have an unanswered question that I would like help with. If I am
>> > writing Squeak code in a text tile, how do I refer to other Etoys
>> > objects? I have tried looking up their player and costume names, but
>> > that doesn't seem to work as I expected it to.
>> 
>> Currently, an object has to be used in a tile script once before it can be used in a textual script. I typically make a textual script first, throw in tiles from all the objects I need to use, then switch to textual mode and start editing. Another way is to make a new throw-away script and drop some tile from the object you want to reference in, then switch it to textual mode. That will reveal its player's reference name.
>> 
>> Behind the scenes this creates a (weak) reference to the player in the world's reference pool using a player's #uniqueNameForReference method. You can inspect "self referencePool" in a textual script to see all known references for a project.
>> 
>> A nice addition would be if dropping an object onto a textual script would insert its player's reference name. Or maybe you could even drop an entire message tile and it would insert its textual equivalent.
>> 
>> - Bert -
>> 
> 
> 


More information about the etoys-dev mailing list