to do 'following' functionality, credit goes to Sgreig for this code, using your desired scenerio:
boss.parent = player.parent
<game name="xxx">
</game>
<turnscript name="global_turnscript">
<enabled />
<script>
boss_following_the_player_function
</script>
</turnscript>
<function name="boss_following_the_player_function">
if (not boss.parent = player.parent) {
boss.parent = player.parent
}
</function<
concept:
http://docs.textadventures.co.uk/quest/ ... arent.htmlthe default new game code, has the 'player' Player Object in the 'room' Room Object, this is what it looks like as a script:
player.parent = room
and this is what it looks like as an Attribute code tag:
<object name="room">
</object>
<object name="player">
<attr name="parent" type="object">room</parent>
</object>
which is the same as:
<object name="room">
<object name="player">
</object>
</object>
and we can move the 'player' Player Object into a different Room Object, let's have it called, 'room2', like this:
player.parent = room2
the defining~setting~re-setting~altering~changing of the 'parent' Object Attribute does the same thing as the 'MoveObject' script:
MoveObject (player, room2)
anyways, back to explaining the concept, so, by doing this:
boss.parent = player.parent
player.parent <===> room <===> boss.parent
player.parent <===> room2 <===> boss.parent
and thus, whatever 'parent' Room Object the 'player' Player Object is in (set~re-set to), so too is the 'boss' Object, thus creating a 'following' functionality.
or, if you rather use the 'MoveObject' script, here's how it would look:
MoveObject (boss, player.parent)
<game name="xxx">
</game>
<turnscript name="global_turnscript">
<enabled />
<script>
boss_following_the_player_function
</script>
</turnscript>
<function name="boss_following_the_player_function">
if (not boss.parent = player.parent) {
MoveObject (boss, player.parent)
}
</function<