[Squeakland] Etoys - create duplicate (not sibling) from a script?

Dreyfuss Pierre-André (EDU) pierre-andre.dreyfuss at edu.ge.ch
Wed Jan 30 10:13:56 PST 2008

you have to use do menu item tile in the category miscellanous and choose duplicate as item.

This seems create a copy in the hand.

If you want just create a new robot this will work. But there is no handle on the new created object this way.

however once dropped it can be designated as the first element of the morph containing it.


-------- Message d'origine--------
De: squeakland-bounces at squeakland.org de la part de Mark Nelson
Date: mer. 30/01/2008 15:35
À: squeakland at squeakland.org
Objet : [Squeakland] Etoys - create duplicate (not sibling) from a script?

>From an Etoys SCRIPT, how can I create a 'duplicate' of a player
(equivalent to clicking on the green halo icon), rather than creating
a 'sibling/clone' of a player (equivalent to SHIFT-clicking on the
green halo icon)?  The 'copy' tile available under the miscellaneous
category seems to create a clone; the textual equivalent of
''Playfield include Ellipse's copy' is 'self include: Ellipse
getNewClone'.   What I need is the textual equivalent that would
create a 'duplicate' rather than a 'clone'.

[Why do I care?  In the course that I'm currently teaching, we've
created a 'robot' with embedded 'sensors'  (the 'robots' and 'sensors'
are created from individual Ellipse morphs; the sensors then get
embedded in the robot). The robot's actions depend on differences
between left and right sensor values. If I now make a 'duplicate' of
the robot using the green halo icon, the new robot works as expected.
However, if I make a 'clone' of the robot (either by SHIFT-clicking
the green halo icon, or by using the 'copy' tile in a script, the new
robot seems to pick up the sensor values from the original robot,
rather than from its own sensors.]

Thanks in advance,
--Mark Nelson

Squeakland mailing list
Squeakland at squeakland.org

More information about the Squeakland mailing list