Scripting - Get all NPC s on the current level

Arszi
Scavenger
Posts: 36
Joined: 04 Jan 2018, 06:45

Scripting - Get all NPC s on the current level

Postby Arszi » 08 Apr 2018, 03:58

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!

luppolo
Scavenger
Posts: 37
Joined: 04 Nov 2016, 21:58

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

Postby luppolo » 10 Apr 2018, 14:29

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

Arszi
Scavenger
Posts: 36
Joined: 04 Jan 2018, 06:45

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

Postby Arszi » 11 Apr 2018, 14:10

Thank you!


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest

cron