Jump to content

Number of entities stored in a map (C++)


george68
 Share

Recommended Posts

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.

 

  • Thanks 2

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

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.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...