English Entity not showing in entity table

3 replies
Goto Page
To the start Previous 1 Next To the start
Up
Goo
User
Offline Off
Hi!

I have two entities:
1: https://i.imgur.com/mXpqsjt.png
2: https://i.imgur.com/0EMNY5Q.png

And I'm trying to loop through all entities and get their values:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local houses = { }
     
     -- Loop through every entity on the map and attach X and Y positions to houses table.
     for _, loc in pairs(hc.ENTITIES) do
          local tx, ty = loc.x, loc.y
          
          if entity(tx, ty, 'name') == 'house' then
               houses[tonumber(entity(tx, ty, 'trigger'))] = { 0, tx, ty }
          end
     end
     
     hc.houses.houses = houses
     
     print(hc.util.get_table_as_string(hc.houses.houses))


But I only seem to get the second one!
The first one doesn't even exist in the entity table, I've tried printing all of it to the logs.
Weird thing is that it sometimes appears when I use the test mode in the editor.

What am I doing wrong? Or is this a bug?
15.06.19 09:47:14 am
Up
Edik
User
Offline Off
I made a test map with a zombie entity and two decal entitys.
Code:
1
2
3
4
local list=entitylist()
for _,e in pairs(list) do
   print("entity @ ("..e.x..","..e.y..") - "..entity(e.x,e.y,"typename"))
end

IMG:https://www.bilder-upload.eu/upload/b02d47-1560584966.png


I could see every entity but not the Decal.
Seems like entitylist() doesnt include Env_Decal. Looks like a bug for me, as the documentation says, that it can be read using entity.
@user DC:
15.06.19 10:36:04 am
Up
DC
Admin
Offline Off
The way how decals work has been changed in one of the updates for performance reasons. They are no longer present as entity once the map has been loaded.

So, yes, sorry, impossible to access that data.
If you want to interact with the entity via Lua please use cs2d entity env_image or cs2d entity env_sprite instead

Will update the documentation accordingly.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
15.06.19 08:01:35 pm
Up
Goo
User
Offline Off
OK thanks.
To the start Previous 1 Next To the start