Problem: Try going the way

Hi, i´m working at an Inform 7 project at the moment but now i have a problem and i hope you can help me:

I want some characters to follow the player. Normally i can write something like “let the way the best route from the location of characterX to the location of the player; try characterX going the way” but what to do if i have more than one character? For example, if i write “A character is a kind of a man. In room X are two characters. In room Y is one character” and the characters should go to the player, how do i do that? I cant say “try all characters going the way”, because this is not specified enough.

Thanks for help :slight_smile:

You have to loop through each character who will move. Untested, syntax may not be exact:

Every turn: repeat with the individual running through all characters: let the way be the best route from the location of the individual to the location of the player; try the individual going the way.

You should also run a test for “If the way is a direction:” before you try the individual going the way, or else you will get an error whenever there isn’t a route from the individual to the location.

This works very well :sunglasses: