getting persons "aware"

hey guys new day new problems.

I wanna get a rule to get a person getting aware about a the player and if the player is staying to long inside the room with the person. now the person is following the player all over the map. but how can i get this done. the idea is if their 4 guys in the room all of them are following the player across the map

[code]“Togetherness”

Blue Room is a room. Red Room is north of blue room. Green Room is east of Red Room. Purple room is south of Green Room and east of Blue Room.

Bob is a man in Red Room.

Togetherness is a number that varies.

Every turn when the location of Bob is the location:
increase togetherness by 1.

Every turn when togetherness is greater than 2:
if the player can see Bob:
say “Bob says, ‘Hey, don’t leave me!’”;
if the location of Bob is not the location:
let way be the best route from the location of bob to the location of the player;
try Bob going way.

Test me with “n/e/w/s/n/z/e/s/w/z”[/code]

good idea but still got problems:

every turn:
if a kontaminiert person is in the location:
say “test”;
increase kontacount of people in the location of the player by 1;
if kontacount of a person in the location is 2:
say “he is now following”;
now the noun is folgend.

it dont wanna understand my condition for increasing the “kontacount”

“If kontacount of a person in the location is 2” is a little too complicated for Inform to follow–I think the issue is that Inform can’t check “kontacount of a person” but needs to check a specific person. (Also there’s a problem with “the noun,” which I’ll explain below.)

The way to get around this is to define a new adjective:

Definition: A person is kontabereit if its kontacount is 2.

Then you can change your “if” clause to:

every turn: if a kontaminiert person is in the location: say "test"; increase kontacount of people in the location of the player by 1; if a kontabereit person is in the location: say "[List of kontabereit persons in the location] [are] now following."; now every kontabereit person in the location is folgend.

I should warn you that I can’t test this right now so I’m not sure it works.

The thing with “the noun” is that that “the noun” always means the direct object of the action. So if you’re examining the table, the noun is the table, if you’re taking the rock, the noun is the rock, if you’re going north, the noun is the direction north, if you’re giving the cake to Alice, the noun is the cake. It looked like you were using “the noun” to mean roughly “the thing I was just talking about,” which doesn’t work. If you were sure you wanted to deal with only one person at a time, you could actually use the if-clause to give a name to the kontabereit person:

every turn: if a kontaminiert person is in the location: say "test"; increase kontacount of people in the location of the player by 1; if a kontabereit person (called folgener) is in the location: say "[Folgener] is now following."; now folgener is folgend.

“Folgener” is a temporary variable that we assign when we check for kontabereit people–for the rest of that “if” statement “folgener” is going to be one of the kontabereit people in the location. But it seemed like you might want this to work on more than one person at once, so I wrote some code that worked on the whole list of kontabereit people.