@Silver + @Randomdays:
--------------
moving (setting) an Object inside of another Object:moving_Object_name.parent = destination_Object_name
-----------------
moving (setting) an Object to be inside the same Object as is another Object:moving_Object_name.parent = destination_Object_name.parent
for example (Sgreig's 'Follower' code):
if (not player2.parent = player.parent) {
player2.parent = player.parent
}
room initially contains player and player2:
player.parent = room
player2.parent = room
player moves to room2:
player.parent = room2
room2 contains player:
player.parent = room2
room contains player2:
player2.parent = room
now, to move player2 to where player is, {conceptually}:
{player2.parent = player.parent = room2}
player2.parent = player.parent
{player2.parent = room2}
player2.parent = room2
player.parent = room2
room2, now contains player and player2
-----------
there's also the 'MoveObject' Function, as it is often more well-known-about than the built-in 'parent' Object (Type) Attribute:
MoveObject (moving_Object_name, destination_Object_name)
well, this too can do the exact same thing as the 'parent' Object Attribute:
MoveObject (moving_Object_name, destination_Object_name.parent)
---------
the built-in 'parent' Object Attribute is unfortunately a bit hidden (and not really discussed anywhere too: not wiki nor tutorial ~ I think) in trying to find it on the wiki, as it's found within the Object Element:
http://docs.textadventures.co.uk/quest/elements/V
http://docs.textadventures.co.uk/quest/ ... bject.htmlV
http://docs.textadventures.co.uk/quest/ ... arent.html--------
and here is about Object (Type) Attributes (which the built-in 'parent' attribute is):
http://docs.textadventures.co.uk/quest/types/V
http://docs.textadventures.co.uk/quest/ ... bject.htmlalso...
another common usage for Object Attributes is equipment (body part~slot = equipment Object):
<object name="sword">
</object>
<object name="player">
<attr name="right_hand" type="object">sword</attr>
</object>
player.right_hand = sword
(Object Name: player)
Attribute Name: right_hand
Attribute Type: Object
Attribute Value: sword (an actual Object in your game)
and...
there's another built-in Object Attribute too:
<object name="player">
</object>
<game name="xxx">
<attr name="pov" type="object">player</attr>
// it's shortened alternative syntax form is this:
// <pov type="object">player</pov>
</game>
game.pov = player
(Object Name: game)
Attribute Name: pov
Attribute Type: Object
Attribute Value: player (an actual Player Object in the game)
--------
here's the wiki link for 'MoveObject' :
http://docs.textadventures.co.uk/quest/ ... bject.html-------
if you need help with any of this, let me know.