Move an actor from node to node in a loop?

I have a night watchman actor. I want him to move from node to node in a clockwork cycle muttering to himself if I’m within range.
I am pretty sure I want to use a series of travelTo functions

local conn = bob.location.east; bob.travelTo(iceCave, conn, conn.connectorBack(bob.getTraveler(conn), iceCave));
And I put a set of the travelTo commands in a CyclicEventList, a series of Nils and travelto command pushing him to the next node. … ntlist.htm
But I cannot seem to get the CyclicEventList to trigger. It either errors or nothing happens.
Any advice?

You should be able to trigger a CyclicEventList by calling its doScript() method somewhere in your code.

If this isn’t working, it’s hard for anyone else to tell you why without seeing the way you’ve defined your CyclicEventList. It may be easier to use a TravelVia action or scriptedTravelTo than travelTo (with all its additional parameters), and in any case you’d need to wrap whatever you’re doing in anonymous functions (or use method/function pointers) in the CyclicEventList. Of course you may be doing all or some of this already, but without seeing how you’ve implemented your CyclicEvenrList I can’t tell.

The following (untested) snippet illustrates how you might incorporated the scriptedTravelTo or TravelVia ways of moving an actor into a CyclicEventList:

patrolList: CyclicEventList
  eventList = [
    {: bob.scriptedTravelTo(iceCave) },


    {: newActorAction(bob, TravelVia, iceCave.west) },


The first element of the list leaves the library to work out which way Bob needs to go to travel to the iceCave; this only works if his current location is directly adjacent to the iceCave (as it probably should be). The third element makes Bob travel via the west exit from the iceCave, and is probably the most straightforward and direct way of synthesizing a travel action. Both ways avoid having to worry about all the additional arguments you need to pass to travelTo().