I want to have my NPC “patrol” around a grid of rooms on every turn until the PC is either captured or finds the target destination.
I am trying to use a Daemon to accomplish this but the NPC doesn’t seem to budge.
I put the following code in the PC start room (of this puzzle). And honestly this is copied straight from the LearningT3Lite.pdf
Just eyeballing this, but I believe the problem is here:
The event list of moveInto() needs to be a list of function pointers. As it stands, your list is being populated by the return value of each moveInto() (so a list of nil’s, since that method doesn’t return a value).
Again, off the top of my head, I think you want this:
flightEvents: CyclicEventList
{
[
function () { nidhogg.moveInto(sky2G); },
function () { nidhogg.moveInto(sky1F); },
// ... etc.
]
}
Which can be reduced to the function short form like this:
That’s great, but be sure to call inherited() in it along with your own code, since the adv3Lite library uses takeTurn() to do a lot of Actor-related housekeeping.