So, sorry to be a bother, but I have a further question.
The built-in functions in Gamestudio, like collision, scan etc all return pointers to entities, in the code above the "appearance" member of the NPC struct. How do I get from this to the NPC struct?
I was thinking maybe you would write a function for the appearance entity that would store and return a pointer to its parent NPC struct. Would that be the best way to do this?