Page 1 of 1

Scripting - Get all NPC s on the current level

Posted: 08 Apr 2018, 03:58
by Arszi
I'd like to get a list of all NPC s, which happens to be on the current level.

I guess I have to iterate through all objects on the current level, then call IsStalker() on them, if I am correct.

How can I iterate throught the object which are on the same level, as the actor?

If any better solution exists for this, I am open to anything!

Re: Scripting - Get all NPC s on the current level

Posted: 10 Apr 2018, 14:29
by luppolo
there is db.OnlineStalkers but that only has the stalkers within the alife range which may be different depending on who plays, the only other way i can think is to call level.object_by_id(x) with x from 1 to 65534 and then check if it's a stalker

Re: Scripting - Get all NPC s on the current level

Posted: 11 Apr 2018, 14:10
by Arszi
Thank you!