Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
g4borg

Searching Items in the map

Recommended Posts

Any ideas how to sweep the server for items?

Especially if I want to check each item of a specific type...

(Will answer myself if I find it out...)

Share this post


Link to post
Share on other sites
On 7/12/2019 at 5:43 PM, g4borg said:

Any ideas how to sweep the server for items?

Especially if I want to check each item of a specific type...

(Will answer myself if I find it out...)

Was wondering this myself but I'm sure it's possible, right? There has to be a storage somewhere which holds all the items in the world. I'm sure there are also ways to access and manipulate this storage. I'm going to have a look and see if I can find it.

Edit: the best thing I could find was the GetObjectsAtPosition or GetObjectsAtPosition3D in 3_Game/game.c. Problem is, it's a proto native method so the implementation isn't in EnScript. Maybe you can search the entire map that way but it might cause lag because I'm guessing there are a lot of items on the map.

Edited by IMT

Share this post


Link to post
Share on other sites

I guess to search we have to sweep the map X by y in intervals and execute the position search .

Share this post


Link to post
Share on other sites

Yeah I think so. These 2 methods return items in a given radius so in theory, you could search the entire map at once but I'm not sure if that would be smart performance wise. Maybe someone in the modders Discord has a different way. If you're going to ask them and they do know the answer, please let me know.

Although, if you think of it, there should be a list, an array or whatever somewhere with each item because they need to check the lifetime of each item, right? Unless they use these 2 methods to do that.

Edited by IMT

Share this post


Link to post
Share on other sites
Sign in to follow this  

×