I have no clue if this will be helpful or not. This is one of the situations I started working on in my tutorial game and got it working but that was months ago. It's one of the last rooms I have yet to describe fully, so...
I'll just drop this here and you can take a look. I hope it is helpful.
<object name="patrolling guard room 1">
<inherit name="editor_room" />
<enter type="script">
</enter>
<firstenter type="script">
msg ("An alarm sounds when you enter the room. A guard will be here shortly. Better get a move on!")
SetObjectFlagOn (Magoo, "patrolled")
guarding
</firstenter>
<exit alias="southeast" to="patrolling guard room 2">
<inherit name="southeastdirection" />
</exit>
<exit alias="southwest" to="patrolling guard room 3">
<inherit name="southwestdirection" />
</exit>
<command name="explain guards cmd">
<pattern>explain; explain the room; explain room</pattern>
<script><![CDATA[
msg ("I'll let this stand alone. Hopefully you can make sense of it from exploring the GUI.<br/><br/>I have used a combination of flags set on the guards and Turn Script which moves the guards to the connected rooms.<br/><br/>Just be sure to look at the flags and the 'guarding TS' in the tree of things to the left of the GUI.<br/><br/>Please ask if you have any questions.")
]]></script>
</command>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
<look type="script">
if (game.pov = Xanadu) {
msg ("Holy moly! That looks exactly like you! To take control of Magoo, just type 'switch to Magoo'.")
}
else {
msg ("You are a simple being trapped in a test game.")
}
</look>
</object>
</object>
<object name="patrolling guard room 2">
<inherit name="editor_room" />
<exit alias="northwest" to="patrolling guard room 1">
<inherit name="northwestdirection" />
</exit>
<exit alias="west" to="patrolling guard room 3">
<inherit name="westdirection" />
</exit>
<command name="explain guards cmd1">
<pattern>explain; explain the room; explain room</pattern>
<script><![CDATA[
msg ("I'll let this stand alone. Hopefully you can make sense of it from exploring the GUI.<br/><br/>I have used a combination of flags set on the guards and Turn Script which moves the guards to the connected rooms.<br/><br/>Just be sure to look at the flags and the 'guarding TS' in the tree of things to the left of the GUI.<br/><br/>Please ask if you have any questions.")
]]></script>
</command>
</object>
<object name="patrolling guard room 3">
<inherit name="editor_room" />
<exit alias="east" to="patrolling guard room 2">
<inherit name="eastdirection" />
</exit>
<exit alias="northeast" to="patrolling guard room 1">
<inherit name="northeastdirection" />
</exit>
<command name="explain guards cmd2">
<pattern>explain; explain the room; explain room</pattern>
<script><![CDATA[
msg ("I'll let this stand alone. Hopefully you can make sense of it from exploring the GUI.<br/><br/>I have used a combination of flags set on the guards and Turn Script which moves the guards to the connected rooms.<br/><br/>Just be sure to look at the flags and the 'guarding TS' in the tree of things to the left of the GUI.<br/><br/>Please ask if you have any questions.")
]]></script>
</command>
</object>
<turnscript name="guarding TS">
<enabled />
<script>
if (ListContains(ScopeVisible(), guard)) {
msg ("You and the guard have happened to stumble into the same room. He looks incensed that he has been put to work. He takes his frustration out on you with his billy club. He pummels you to death. Sorry.")
finish
}
if (GetBoolean(Magoo, "patrolled")) {
if (GetBoolean(guard, "room1")) {
if (game.pov.parent = patrolling guard room 2) {
msg ("You look over your shoulder to the northwest and into patrol room 1 and you see the guard patrolling that room.")
}
else if (game.pov.parent = patrolling guard room 3) {
msg ("You look over your shoulder to the northeast and into patrol room 1 and you see the guard patrolling that room.")
}
}
else if (GetBoolean(guard, "room2")) {
if (game.pov.parent = patrolling guard room 1) {
msg ("You look off to your southeast and see a nasty looking guard patrolling guard room 2.")
}
else if (game.pov.parent = patrolling guard room 3) {
msg ("You hear some noise to the east and you take a look that way. You see the guard loitering in room 2.")
}
}
else if (GetBoolean(guard, "room3")) {
if (game.pov.parent = patrolling guard room 2) {
msg ("The guard is certainly making some noise off to the west as he searches patrol room 3 for you.")
}
else if (game.pov.parent = patrolling guard room 1) {
msg ("As you dawdle in room 1, the guard is frantically searching for you in patrol room 3 to your southwest.")
}
}
}
</script>
</turnscript>
<command name="look guard cmd">
<pattern>look at guard; x guard</pattern>
<script>
if (GetBoolean(guard, "room1")) {
msg ("You look carefully into room 1 where you believe the guard to be... He is large and angry. He is wielding a fearsome looking billy club.")
}
else if (GetBoolean(guard, "room2")) {
msg ("You look carefully into room 2 where you believe the guard to be... He is large and angry. He is wielding a nasty and heavy billy club.")
}
else if (GetBoolean(guard, "room3")) {
msg ("You look carefully into room 3 where you believe the guard to be... He is large and angry. He is weilding a fearsome looking billy club.")
}
</script>
And here is the 'guarding' function.
SetTurnTimeout (1) {
MoveObject (guard, patrolling guard room 1)
SetObjectFlagOn (guard, "room1")
SetObjectFlagOff (guard, "room3")
SetTurnTimeout (2) {
MoveObject (guard, patrolling guard room 2)
SetObjectFlagOn (guard, "room2")
SetObjectFlagOff (guard, "room1")
SetTurnTimeout (2) {
MoveObject (guard, patrolling guard room 3)
SetObjectFlagOn (guard, "room3")
SetObjectFlagOff (guard, "room2")
SetTurnTimeout (2) {
MoveObject (guard, patrolling guard room 1)
guarding
}
}
}
}
If you want me to hack an explanation out of that, I would be glad to do it, but not tonight! It's late. I've had a few drinks. GO BRONCOS!
In the meantime, if you want a closer look, I just posted to the game announcements section of the forum, the .aslx file for the entire tutorial to date. You can download that and take a look in the GUI at all the code mess above if that makes it easier.
And good luck!