Yue Posted September 29, 2021 Share Posted September 29, 2021 self.e = 0 function Loading() -- Hook Load Map. --local camera = worldMars:FindEntity("Camera") --camera:Hide() while self.e < worldMars:GetCurrent():CountEntities() do if Wind:IsClosed() then return( false ) end App:Update() self.e = self.e + 1 Context:GetCurrent():DrawRect(0,0,Context:GetCurrent():GetWidth(),Context:GetCurrent():GetHeight()) Context:GetCurrent():Sync() end end Why is it that there are commands that are not officially documented? As in this case, find the total number of entities that a world has. CountEntities() Is there any place where I can see those commands that may not exist due to lack of documentation? Quote Link to comment Share on other sites More sharing options...
Yue Posted September 29, 2021 Author Share Posted September 29, 2021 CountEntities() Another issue is that this command when one loads a map with a terrain depending on the size of the map returns more or less entities on the map. https://media2.giphy.com/media/3o72F7YT6s0EMFI0Za/200.gif Quote Link to comment Share on other sites More sharing options...
Yue Posted September 29, 2021 Author Share Posted September 29, 2021 self.e = 0 function Loading() while self.e < worldMars:GetCurrent():CountEntities()/1025.0 do if Wind:IsClosed() then return( false ) end App:Update() self.e = self.e + 1 * Time:GetSpeed() self.context:DrawRect(0,0,Context:GetCurrent():GetWidth(),Context:GetCurrent():GetHeight()) Wind:Update() end end A 2048 x 2048 map returns 1025 entities with the count command in the world. Then the system evaluates all these entities on the hook when loading the map. The solution is that knowing that data is divided and the count would be in relation to the entities that actually exist on the map. Although this value can be manipulated so that for example in the case of loading only three entities on the map, we can simulate an animation in a time that suits our taste. Always something new to learn. Translated with www.DeepL.com/Translator (free version) 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.