george68 Posted June 22, 2021 Share Posted June 22, 2021 Hi, Is there any way to get the number of entities they are stored in a map file. I know that I can iterate through all the entities using the hook function, but I was wondering If I can get the number of entities without iteration Quote Link to comment Share on other sites More sharing options...
reepblue Posted June 22, 2021 Share Posted June 22, 2021 If you are using C++, there is a vector containing all the entities in the World class. You can get the size of that. If you are using lua, I'd make a new variable and increment it with the map hook. 2 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted June 22, 2021 Share Posted June 22, 2021 There should be a World->CountEntities() now that I think of it. You can also check the Menu.lua script as that iterates through all the entities without a Map hook to find a camera. It should use the CountEntities() function. Sorry about that. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
george68 Posted June 22, 2021 Author Share Posted June 22, 2021 33 minutes ago, reepblue said: There should be a World->CountEntities() now that I think of it. You can also check the Menu.lua script as that iterates through all the entities without a Map hook to find a camera. It should use the CountEntities() function. Sorry about that. I'll take a look. Thank you very much! Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22, 2021 Share Posted June 22, 2021 I’m curious what you will use this for? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
george68 Posted June 23, 2021 Author Share Posted June 23, 2021 7 hours ago, Josh said: I’m curious what you will use this for? For maps with large number of entities, it would be nice if I can display a progress of loading. So, I need this information. So far I don't now how to get the number of entities in the map, without load it first. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.