Jump to content

A question out of curiosity.


Yue
 Share

Recommended Posts

	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?

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

	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)

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

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...