scan all entitys for optimization

Blitz3D Forums/Blitz3D Beginners Area/scan all entitys for optimization

Santiworld(Posted 2016) [#1]
Hi, i'm trying to make a scanner to know what entitys and variables i'm using in my game.

i can use entityclass beacouse only works if i know the ID of the entity.

¿there is another way to know how many Entitys i have in my game?.



i try with this, bus off corse, dosen't work :)

for i = 0 to 999999999
 class$ = entityclass(i)
   if class$ <> "" then
     ;Check this entity :)
   end if
 next




Yue(Posted 2016) [#2]
Hello , use Type to create entities , and creating the entity / object using a global variable is assigned a sum counter each time an object is created

Type TLight

     field light

End Type

global number_light%
Function Init_Light.TLight ()

   local Light.Tlight = new Tlight

    light\light% = createlight()
          
 number_light% = number_light% + 1
   return light

End Function