Jump to content
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×